Package eu.bandm.tools.umod
Class FormatCache_java
java.lang.Object
eu.bandm.tools.umod.FormatCache_java
Cache for metajava expressions, to that the parsing and construction
must happen only once for each input text.
Parsing errors are reported by exceptions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe only cache storage.protected static final FormatClosureThe parser for the metajava format expressions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Formatexpression(String s) Parse a Java expression, construct the format, cache it and return it.static FormatParse a Java statement, construct the format, cache it and return it.static Formatstatements(String s) Parse a sequence of Java statements, construct the format, cache it and return it.
-
Field Details
-
formatCache
The only cache storage. Since the valid external representations of the three syntactic forms "expression", "statement", and "statements" are disjoined, one map is sufficient. -
formatClosure
The parser for the metajava format expressions.
-
-
Constructor Details
-
FormatCache_java
public FormatCache_java()
-
-
Method Details
-
statement
Parse a Java statement, construct the format, cache it and return it.- Parameters:
s- source text- Returns:
- the parsing result
- Throws:
IllegalArgumentException- on a syntax error
-
statements
Parse a sequence of Java statements, construct the format, cache it and return it.- Parameters:
s- source text- Returns:
- the parsing result
- Throws:
IllegalArgumentException- on a syntax error
-
expression
Parse a Java expression, construct the format, cache it and return it.- Parameters:
s- source text- Returns:
- the parsing result
- Throws:
IllegalArgumentException- on a syntax error
-