com.svincent.smalljava
Class Expr.If
java.lang.Object
|
+--com.svincent.util.BaseObject
|
+--com.svincent.smalljava.Expr
|
+--com.svincent.smalljava.Expr.If
- Enclosing class:
- Expr
- public static class Expr.If
- extends Expr
If condition evaluates to true, evaluate the then clase.
otherwise, evaluate the else clasue.
| Inner classes inherited from class com.svincent.smalljava.Expr |
Expr.Begin,
Expr.BooleanConst,
Expr.Call,
Expr.Comment,
Expr.DoubleConst,
Expr.EQ,
Expr.GE,
Expr.GetField,
Expr.GetLocal,
Expr.GetStatic,
Expr.GT,
Expr.If,
Expr.IntConst,
Expr.LE,
Expr.LT,
Expr.Minus,
Expr.NE,
Expr.New,
Expr.NewArray,
Expr.NullConst,
Expr.Plus,
Expr.Return,
Expr.SetArray,
Expr.SetField,
Expr.SetLocal,
Expr.StringConst,
Expr.SuperConstructor,
Expr.This,
Expr.While |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Expr.If
public Expr.If(Expr _cond)
Expr.If
public Expr.If(Expr _cond,
Expr _thenClause)
Expr.If
public Expr.If(Expr _cond,
Expr _thenClause,
Expr _elseClause)
printTrailingSemi
protected boolean printTrailingSemi()
- Description copied from class: Expr
- Returns true if, after printing this expression as a statement,
there should be a trailing semicolon printed. Notable exceptions
are {...} constructs, and ifs and whiles.
- Overrides:
- printTrailingSemi in class Expr
setThen
public void setThen(Expr _thenClause)
setElse
public void setElse(Expr _elseClause)
deriveType
protected SmallType deriveType(SmallMethod m)
throws SmallJavaValidationException
- Description copied from class: Expr
- Actually do the work.
deriveType should call 'evalType' for recursion, and super.deriveType
to repeat parent work.
These simple rules for you and me will result in a happy world where
the type returned is always cached appropriately.
- Overrides:
- deriveType in class Expr
- Tags copied from class: Expr
- See Also:
Expr.evalType(SmallMethod),
Expr.getResultType()
writeAsJava
public void writeAsJava(IndentPrintWriter out)
- Description copied from class: Expr
- Write this expression out as Java source code.
- Overrides:
- writeAsJava in class Expr
generateInstructions
protected void generateInstructions(ClassFileWriter out,
VariableTable vars)
- Description copied from class: Expr
- Generate a list of JVM instructions for this expression node.
- Overrides:
- generateInstructions in class Expr
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.