|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jmlspecs.jmlrac.RacParser
A utility class for generating RAC nodes from a string and an array of RAC/JML nodes. This class provides several inner classes implementing RAC nodes and provides a set of factory methods for creating them.
RacNode| Nested Class Summary | |
static class |
RacParser.RacBlock
A RAC node class for representing blocks. |
static class |
RacParser.RacMethodDeclaration
A RAC node class for representing method declarations. |
static class |
RacParser.RacStatement
A RAC node class for representing statements. |
| Field Summary | |
static Object |
END_OF_LINE
A marker object denoting the end of line. |
| Constructor Summary | |
RacParser()
|
|
| Method Summary | |
private static List |
parse(String code,
Object[] asts)
Parses the given string representing verbatim code possibly with positional markers ($i) and returns a list of objects (strings, objects, END_OF_LINE's) with $i replaced by the i-th objects of the array asts. |
static RacParser.RacBlock |
parseBlock(String code)
Returns an object of RacBlock for the
given string. |
static RacParser.RacBlock |
parseBlock(String code,
Object ast)
Returns an object of RacBlock for the
given string. |
static RacParser.RacBlock |
parseBlock(String code,
Object ast1,
Object ast2)
Returns an object of RacBlock for the given
string. |
static RacParser.RacBlock |
parseBlock(String code,
Object ast1,
Object ast2,
Object ast3)
Returns an object of RacBlock for the given
string. |
static RacParser.RacMethodDeclaration |
parseMethod(String code)
Returns an object of RacMethodDeclaration for the
given string. |
static RacParser.RacMethodDeclaration |
parseMethod(String code,
Object ast)
Returns an object of RacMethodDeclaration for the
given string. |
static RacParser.RacMethodDeclaration |
parseMethod(String code,
Object ast1,
Object ast2)
Returns an object of RacMethodDeclaration for the
given string. |
static RacParser.RacMethodDeclaration |
parseMethod(String code,
Object ast1,
Object ast2,
Object ast3)
Returns an object of RacMethodDeclaration for the
given string. |
static RacParser.RacMethodDeclaration |
parseMethod(String code,
Object[] asts)
Returns an object of RacMethodDeclaration for the
given string. |
static RacParser.RacStatement |
parseStatement(String code)
Returns an object of RacStatement for the
given string. |
static RacParser.RacStatement |
parseStatement(String code,
Object ast)
Returns an object of RacStatement for the
given string. |
static RacParser.RacStatement |
parseStatement(String code,
Object ast1,
Object ast2)
Returns an object of RacStatement for the
given string. |
static RacParser.RacStatement |
parseStatement(String code,
Object ast1,
Object ast2,
Object ast3)
Returns an object of RacStatement for the
given string. |
static RacParser.RacStatement |
parseStatement(String code,
Object[] asts)
Returns an object of RacStatement for the
given string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final Object END_OF_LINE
| Constructor Detail |
public RacParser()
| Method Detail |
public static RacParser.RacMethodDeclaration parseMethod(String code)
RacMethodDeclaration for the
given string. The string is treated as a method declaration.
requires code != null;
public static RacParser.RacMethodDeclaration parseMethod(String code,
Object ast)
RacMethodDeclaration for the
given string. The string is treated as a method declaration and
may contain a marker ($0) at which position the object
ast is inserted.
requires code != null;
public static RacParser.RacMethodDeclaration parseMethod(String code,
Object ast1,
Object ast2)
RacMethodDeclaration for the
given string. The string is treated as a method declaration and
may contain markers ($0, $1) at which positions the objects
ast1 and ast2 are inserted repectively.
requires code != null;
public static RacParser.RacMethodDeclaration parseMethod(String code,
Object ast1,
Object ast2,
Object ast3)
RacMethodDeclaration for the
given string. The string is treated as a method declaration and
may contain markers ($0, $1, $2) at which positions the objects
ast1, ast2, and ast3 are
inserted repectively.
requires code != null;
public static RacParser.RacMethodDeclaration parseMethod(String code,
Object[] asts)
RacMethodDeclaration for the
given string. The string is treated as a method declaration and
may contain markers ($i) at which positions the i-th object
of the array asts is inserted.
requires code != null;
public static RacParser.RacStatement parseStatement(String code,
Object ast)
RacStatement for the
given string. The string is treated as a statement and
may contain a marker ($0) at which position the object
ast is inserted.
requires code != null;
public static RacParser.RacStatement parseStatement(String code,
Object ast1,
Object ast2)
RacStatement for the
given string. The string is treated as a statement and
may contain markers ($0, $1) at which positions the objects
ast1 and ast2 are inserted repectively.
For example, the following call creates a RacStatement
object representing an if-statement.
parseStatement("if (x > 1) { $0 } else { $1 }", s1, s2);
requires code != null;
public static RacParser.RacStatement parseStatement(String code,
Object ast1,
Object ast2,
Object ast3)
RacStatement for the
given string. The string is treated as a statement and
may contain markers ($0, $1, $2) at which positions the objects
ast1, ast2, and ast3 are
inserted repectively.
requires code != null;
public static RacParser.RacStatement parseStatement(String code)
RacStatement for the
given string. The string is treated as a statement.
requires code != null;
public static RacParser.RacStatement parseStatement(String code,
Object[] asts)
RacStatement for the
given string. The string is treated as a statement and
may contain markers ($i) at which positions the i-th object
of the array asts is inserted.
requires code != null;
public static RacParser.RacBlock parseBlock(String code)
RacBlock for the
given string. The string is treated as a block statement.
requires code != null;
public static RacParser.RacBlock parseBlock(String code,
Object ast)
RacBlock for the
given string. The string is treated as a block statement and
may contain a marker ($0) at which position the object
ast is inserted.
requires code != null;
public static RacParser.RacBlock parseBlock(String code,
Object ast1,
Object ast2)
RacBlock for the given
string. The string is treated as a block statement and may
contain two markers $0 and $1 and at which position the object
ast1, and ast2 are inserted
respectively.
requires code != null;
public static RacParser.RacBlock parseBlock(String code,
Object ast1,
Object ast2,
Object ast3)
RacBlock for the given
string. The string is treated as a block statement and may
contain three markers $0, $1, and $2 and at which position the
object ast1, ast2, and
ast3 are inserted respectively.
requires code != null;
private static List parse(String code,
Object[] asts)
asts. For example, if code is
"if ($0) {\n count = count + 1;\n}"
then, the returnes list is has the following form:
"if ("
arg0
") {"
END_OF_LINE
" count = count + 1;"
END_OF_LINE
"}"
requires code != null; ensures \result != null;
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||