|
||||||||||
| 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.SmallMacro
A small library of useful expression generators for SmallJava.
| Method Summary | |
static Expr |
forLoop(SmallMethod method,
java.lang.String varName,
int start,
int end,
Expr body)
Builds a for loop. |
static Expr |
printField(java.lang.String className,
java.lang.String descriptor,
java.lang.String fieldName)
Calls Util.out.print, printing the given field reference. |
static Expr |
println()
Calls Util.out.println (); |
static Expr |
println(java.lang.String msg)
Calls Util.out.println ("msg"); |
static Expr |
printLocal(SmallMethod method,
java.lang.String fieldName)
Calls Util.out.print, printing the given local field reference. |
| Methods inherited from class com.svincent.util.BaseObject |
dump,
dump,
dumpToString,
tag |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Method Detail |
public static Expr forLoop(SmallMethod method,
java.lang.String varName,
int start,
int end,
Expr body)
throws SmallJavaBuildingException
Builds
for ([varName]=[start]; [varName]<[end]; [varName]++)
[body]
into the given method.Note that the local int variable must be defined before calling this method, like so:
// --- print the integers between 0 and 9, inclusive.
method.local ("I", "i", new Expr.IntConst (0));
method.add (SmallMacro.forLoop (method, "i", 0, 10,
SmallMacro.printLocal (method, "i")));
public static Expr println()
throws SmallJavaBuildingException
public static Expr println(java.lang.String msg)
throws SmallJavaBuildingException
public static Expr printField(java.lang.String className,
java.lang.String descriptor,
java.lang.String fieldName)
throws SmallJavaBuildingException
public static Expr printLocal(SmallMethod method,
java.lang.String fieldName)
throws SmallJavaBuildingException
|
||||||||||
| 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.