com.svincent.smalljava
Class Expr.While

java.lang.Object
  |
  +--com.svincent.util.BaseObject
        |
        +--com.svincent.smalljava.Expr
              |
              +--com.svincent.smalljava.Expr.While
Enclosing class:
Expr

public static class Expr.While
extends Expr

Loop around, executing instructions until the given condition evaluates to 'true'.


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
 
Fields inherited from class com.svincent.smalljava.Expr
debugTypecheck, EmptyArray
 
Constructor Summary
Expr.While(Expr _cond)
           
Expr.While(Expr _cond, Expr _body)
           
 
Method Summary
protected  SmallType deriveType(SmallMethod m)
          Actually do the work.
protected  void generateInstructions(ClassFileWriter out, VariableTable vars)
          Generate a list of JVM instructions for this expression node.
protected  boolean printTrailingSemi()
          Returns true if, after printing this expression as a statement, there should be a trailing semicolon printed.
 void setBody(Expr _body)
           
 void writeAsJava(IndentPrintWriter out)
          Write this expression out as Java source code.
 
Methods inherited from class com.svincent.smalljava.Expr
evalType, getResultType, tag
 
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
 

Constructor Detail

Expr.While

public Expr.While(Expr _cond)

Expr.While

public Expr.While(Expr _cond,
                  Expr _body)
Method Detail

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()

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

setBody

public void setBody(Expr _body)

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.