object MiniJavaTree
Module containing tree structures for representing MiniJava programs.
- Source
- MiniJavaTree.scala
- Alphabetic
- By Inheritance
- MiniJavaTree
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
AndExp
(left: Expression, right: Expression) extends BinaryExpression with Product with Serializable
Boolean conjunction (AND) expression.
-
case class
Argument
(tipe: Type, name: IdnDef) extends MiniJavaTree with Product with Serializable
An argument with a given type and name.
-
case class
ArrayAssign
(name: IdnUse, ind: Expression, exp: Expression) extends Statement with Product with Serializable
An assignment of the value of the
expexpression to the array element of the named array whose index is given by theindexpression. -
abstract
class
BinaryExpression
extends Expression with PrettyBinaryExpression
Common interface for binary expressions.
-
case class
Block
(stmts: Seq[Statement]) extends Statement with Product with Serializable
A block containing a possibly empty list of statements.
-
case class
BooleanType
() extends Type with Product with Serializable
The basic Boolean type.
-
case class
CallExp
(base: Expression, name: IdnUse, args: Seq[Expression]) extends Expression with Product with Serializable
Method call expression.
Method call expression. Yield the value returned by the method with the given name called on the object given by the
baseexpression with the given argument expressions. -
case class
Class
(name: IdnDef, superclass: Option[IdnUse], body: ClassBody) extends MiniJavaTree with Product with Serializable
A general class with a given name, optional super class, possibly empty list of instance variables, and a possibly empty list of methods.
-
case class
ClassBody
(fields: Seq[Field], methods: Seq[Method]) extends MiniJavaTree with Product with Serializable
The body of a class.
-
case class
ClassType
(name: IdnUse) extends Type with Product with Serializable
A type given by the named class.
-
abstract
class
Expression
extends MiniJavaTree with PrettyExpression
Common superclass of expressions.
-
case class
FalseExp
() extends Expression with Product with Serializable
Boolean FALSE expression.
-
case class
Field
(tipe: Type, name: IdnDef) extends MiniJavaTree with Product with Serializable
A class field with a given type and name.
-
type
Identifier = String
A representation of identifiers as strings.
-
case class
IdnDef
(idn: Identifier) extends IdnTree with Product with Serializable
A defining occurrence of an identifier.
-
case class
IdnExp
(name: IdnUse) extends Expression with Product with Serializable
Identifier expression.
-
abstract
class
IdnTree
extends MiniJavaTree
An identifier reference.
-
case class
IdnUse
(idn: Identifier) extends IdnTree with Product with Serializable
An applied occurrence (use) of an identifier.
-
case class
If
(exp: Expression, stmt1: Statement, stmt2: Statement) extends Statement with Product with Serializable
A conditional statement that tests the given expression, choosing
stmt1if the expression is true, otherwise choosingstmt2. -
case class
IndExp
(base: Expression, ind: Expression) extends Expression with Product with Serializable
Array index epression.
Array index epression. Yields the value of the
indelement of the array given bybase. -
case class
IntArrayType
() extends Type with Product with Serializable
An integer array type.
-
case class
IntExp
(value: Int) extends Expression with Product with Serializable
Integer value expression.
-
case class
IntType
() extends Type with Product with Serializable
The basic integer type.
-
case class
LengthExp
(base: Expression) extends Expression with Product with Serializable
Array length expression.
Array length expression. Yields the length of the array
base. -
case class
LessExp
(left: Expression, right: Expression) extends BinaryExpression with Product with Serializable
Less than expression.
-
case class
MainClass
(name: IdnDef, stmt: Statement) extends MiniJavaTree with Product with Serializable
A main class with a given name and body given by a single statement.
-
case class
Method
(name: IdnDef, body: MethodBody) extends MiniJavaTree with Product with Serializable
A method with a given return type, name, possibly empty list of arguments, possibly empty list of local variables, an optional list of statements that comprise the method body, and an expression whose value is to be returned by the method.
-
case class
MethodBody
(tipe: Type, args: Seq[Argument], vars: Seq[Var], optStmts: Seq[Statement], result: Expression) extends MiniJavaTree with Product with Serializable
The body of a method.
-
sealed abstract
class
MiniJavaTree
extends TreeNode
The common supertype of all source tree nodes.
-
case class
MinusExp
(left: Expression, right: Expression) extends BinaryExpression with Product with Serializable
Subtraction expression.
-
case class
NewArrayExp
(exp: Expression) extends Expression with Product with Serializable
Array creation expression.
Array creation expression. Yields a new integer array whose number of elements is given by
exp. -
case class
NewExp
(name: IdnUse) extends Expression with Product with Serializable
Instance creation expression.
Instance creation expression. Yields a new instance of the given class type.
-
case class
NotExp
(exp: Expression) extends UnaryExpression with Product with Serializable
Boolean NOT expression.
-
case class
PlusExp
(left: Expression, right: Expression) extends BinaryExpression with Product with Serializable
Addition expression.
-
case class
Println
(exp: Expression) extends Statement with Product with Serializable
An output statement that prints the value of the given expression followed by a newline.
-
case class
Program
(main: MainClass, classes: Seq[Class]) extends MiniJavaTree with Product with Serializable
A main program consisting of a main class and a possibly empty list of other classes (defines the root scope).
-
case class
StarExp
(left: Expression, right: Expression) extends BinaryExpression with Product with Serializable
Multiplication expression.
-
sealed abstract
class
Statement
extends MiniJavaTree
Common superclass of statements.
-
case class
ThisExp
() extends Expression with Product with Serializable
THIS expression.
-
case class
TrueExp
() extends Expression with Product with Serializable
Boolean TRUE expression.
-
abstract
class
Type
extends MiniJavaTree
Common superclass for types.
-
abstract
class
UnaryExpression
extends Expression with PrettyUnaryExpression
Common interface for unary expressions.
-
case class
Var
(tipe: Type, name: IdnDef) extends MiniJavaTree with Product with Serializable
A variable with a given type and name.
-
case class
VarAssign
(name: IdnUse, exp: Expression) extends Statement with Product with Serializable
An assignment of the value of the given expression to the variable with the given name.
-
case class
While
(exp: Expression, stmt: Statement) extends Statement with Product with Serializable
A while loop that tests the given expression and has as body the given statement.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): java.lang.Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )