diff --git a/doc/scoot/Makefile b/doc/scoot/Makefile new file mode 100644 index 0000000..14ad2a0 --- /dev/null +++ b/doc/scoot/Makefile @@ -0,0 +1,8 @@ +language_subset.pdf: *.tex refs.bib + pdflatex language_subset + bibtex language_subset + pdflatex language_subset + pdflatex language_subset + +clean: + rm -f *.aux *.bbl *.blg *.log *.toc *.dvi *.out *.tdo *.gx.table *.gx.gnuplot language_subset.ps language_subset.pdf *~ diff --git a/doc/scoot/javita.tex b/doc/scoot/javita.tex new file mode 100644 index 0000000..a5c19aa --- /dev/null +++ b/doc/scoot/javita.tex @@ -0,0 +1,452 @@ +\documentclass{report} + +\usepackage{syntax} +\usepackage{xspace} +\usepackage{mathpartir} +\usepackage{url} + +\newcommand{\minijava}{MiniJava\xspace} +\newcommand{\javita}{Javita\xspace} + +\begin{document} +\title{Javita} + +\maketitle + +% jimple - grammar for classes? + + +\section{\javita - Java subset handled in Cuanto} +We informally define \javita, a subset of Java inspired by \minijava +(a grammar for \minijava is available here \label{sec:minijava}). + +We define a different subset of Java than \minijava that has less +language syntax restrictions. The \minijava syntax restrictions are +not important when using soot as frontend (we already have parsing and +typechecking). + +The \javita fragment contains: +\begin{itemize} +\item Integer and Boolean variables; +\item Operations on Integer variables (sum, difference, + multiplication, division, modulo); +\item Operations on Boolean variables (and, or, negation, xor, ...); +\item Control flow: Sequences, for loops, while loops, do while loops; +\item Declare static methods, with Integer and Boolean return values + and parameters; +\item Call to static methods; +\item Declaration of classes with static (Integer or Boolean) fields. +\end{itemize} + +The rest of the Java language is outside the fragment: +\begin{itemize} +\item No variables of type different from Boolean or Integer; +\item No dynamic memory allocation (no arrays, no creation of new objects);; +\item No calls to methods on objects, no dynamic dispatch; +\item No handling of exception; +\item No declaration of non-static fields, no inheritance, no + implementation of interfaces, no generics types. +\end{itemize} + +\bibliographystyle{plain} +\bibliography{refs} + +\appendix + +\section{Jimple grammar} +\begin{grammar} + ::= + + ::= + + ::=