|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.svincent.util.BaseObject
|
+--com.svincent.smalljava.Expr
Expr represents an executable expression. Most of the expression types you've come to know and love are here: ifs, whiles, arithmetic, field manipulation, etc. They're all right here, in Texas.
| Inner Class Summary | |
static class |
Expr.Begin
Execute a series of expressions, one after another. |
static class |
Expr.BooleanConst
Return the given boolean constant. |
static class |
Expr.Call
Call a method. |
static class |
Expr.Comment
A comment. |
static class |
Expr.DoubleConst
Return the given double constant. |
static class |
Expr.EQ
The normal == binary operator. |
static class |
Expr.GE
The normal >= binary operator. |
static class |
Expr.GetField
Get the value from an instance field |
static class |
Expr.GetLocal
Get the value from a local variable |
static class |
Expr.GetStatic
Get the value from a static field |
static class |
Expr.GT
The normal > binary operator. |
static class |
Expr.If
If condition evaluates to true, evaluate the then clase. |
static class |
Expr.IntConst
Return the given integer constant. |
static class |
Expr.LE
The normal <= binary operator. |
static class |
Expr.LT
The normal < binary operator. |
static class |
Expr.Minus
The normal - binary operator. |
static class |
Expr.NE
The normal != binary operator. |
static class |
Expr.New
Construct a new instance of the named class. |
static class |
Expr.NewArray
Construct a new array instance for containing the given type (Only makes single-dimensional arrays, for now) Also ignores types of initializer things. |
static class |
Expr.NullConst
Return the null constant.. |
static class |
Expr.Plus
The normal + binary operator. |
static class |
Expr.Return
Return a value from a method. |
static class |
Expr.SetArray
Assign a value to an array slot |
static class |
Expr.SetField
Assign a value to an instance field |
static class |
Expr.SetLocal
Assign a value to a local variable |
static class |
Expr.StringConst
Return the given String constant. |
static class |
Expr.SuperConstructor
call the null-arg super constructor.. |
static class |
Expr.This
Access the magic variable 'this'. |
static class |
Expr.While
Loop around, executing instructions until the given condition evaluates to 'true'. |
| Field Summary | |
static boolean |
debugTypecheck
Set to true to debug typecheck algorithms |
static Expr[] |
EmptyArray
A convenient empty Expression array. |
| Constructor Summary | |
Expr()
|
|
| Method Summary | |
protected abstract SmallType |
deriveType(SmallMethod m)
Actually do the work. |
protected SmallType |
evalType(SmallMethod m)
Not to be called by users. |
protected abstract void |
generateInstructions(ClassFileWriter out,
VariableTable vars)
Generate a list of JVM instructions for this expression node. |
SmallType |
getResultType()
Get the type of the result of this expression. |
protected boolean |
printTrailingSemi()
Returns true if, after printing this expression as a statement, there should be a trailing semicolon printed. |
java.lang.String |
tag()
|
abstract void |
writeAsJava(IndentPrintWriter out)
Write this expression out as Java source code. |
| Methods inherited from class com.svincent.util.BaseObject |
dump,
dump,
dumpToString |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final boolean debugTypecheck
public static final Expr[] EmptyArray
| Constructor Detail |
public Expr()
| Method Detail |
protected SmallType evalType(SmallMethod m)
throws SmallJavaValidationException
getResultType()
protected abstract SmallType deriveType(SmallMethod m)
throws SmallJavaValidationException
evalType(SmallMethod),
getResultType()public SmallType getResultType()
public java.lang.String tag()
public abstract void writeAsJava(IndentPrintWriter out)
protected abstract void generateInstructions(ClassFileWriter out,
VariableTable vars)
protected boolean printTrailingSemi()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This is documentation for Moksa Prolog, which can be found at http://www.svincent.com/moksa/
Copyright © 1999 Shawn P. Vincent.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.