|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.ptree.util.PartialParser
The PartialParser
class is
an utilty class to make ptree objects from string.
ParseTree
,
Expression
,
Statement
,
StatementList
,
MemberDeclaration
,
MemberDeclarationList
,
ClassDeclaration
,
CompilationUnit
Constructor Summary | |
protected |
PartialParser()
Constructor should not be called. |
Method Summary | |
private static ParseTree |
initialize(Environment env,
ParseTree p)
|
static Expression |
makeExpression(Environment env,
String str)
Converts a string into an expression. |
static Statement |
makeStatement(Environment env,
String str)
Converts a string into a statement. |
static StatementList |
makeStatementList(Environment env,
String str)
Converts a string into a statement list. |
static String |
replace(String base,
Object a0)
|
static String |
replace(String base,
Object[] args)
Replaces "#s" "#EXPR" "#STMT" "#STMTS" in the given string with the given arguments. |
static String |
replace(String base,
Object a0,
Object a1)
|
static String |
replace(String base,
Object a0,
Object a1,
Object a2)
|
static String |
replace(String base,
Object a0,
Object a1,
Object a2,
Object a3)
|
static String |
replace(String base,
Object a0,
Object a1,
Object a2,
Object a3,
Object a4)
|
static String |
replace(String base,
Object a0,
Object a1,
Object a2,
Object a3,
Object a4,
Object a5)
|
static String |
replace(String base,
Object a0,
Object a1,
Object a2,
Object a3,
Object a4,
Object a5,
Object a6)
|
static String |
replace(String base,
Object a0,
Object a1,
Object a2,
Object a3,
Object a4,
Object a5,
Object a6,
Object a7)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected PartialParser()
Method Detail |
private static ParseTree initialize(Environment env, ParseTree p) throws ParseTreeException
ParseTreeException
public static final String replace(String base, Object[] args) throws MOPException
"##" is replaced with "#".
#s arg.toString() #EXPR ((Expression) arg).toString() #STMT ((Statement) arg).toString() #STMTS ((StatementList) arg).toString()
MOPException
public static final String replace(String base, Object a0) throws MOPException
MOPException
public static final String replace(String base, Object a0, Object a1) throws MOPException
MOPException
public static final String replace(String base, Object a0, Object a1, Object a2) throws MOPException
MOPException
public static final String replace(String base, Object a0, Object a1, Object a2, Object a3) throws MOPException
MOPException
public static final String replace(String base, Object a0, Object a1, Object a2, Object a3, Object a4) throws MOPException
MOPException
public static final String replace(String base, Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws MOPException
MOPException
public static final String replace(String base, Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws MOPException
MOPException
public static final String replace(String base, Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws MOPException
MOPException
public static Expression makeExpression(Environment env, String str) throws MOPException
"i + 3"
"f()"
MOPException
- if any critical error occurs.public static Statement makeStatement(Environment env, String str) throws MOPException
"i++;"
"for(;;){ f(); }"
But local variable declarations are not allowed.
MOPException
- if any critical error occurs.public static StatementList makeStatementList(Environment env, String str) throws MOPException
"i++; j = 3;"
Local variable declarations like following can also be parsed.
"int n, m;"
MOPException
- if any critical error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |