mirror of
https://github.com/DMaroo/GhidRust.git
synced 2025-10-06 04:53:57 +02:00

* Add grammar for C and transpile it to Rust code * Add `generate.sh` to generate the JavaCC and JJTree files * Update `build.sh`
1817 lines
52 KiB
Plaintext
1817 lines
52 KiB
Plaintext
/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. c.jj */
|
|
/*@egen*//*
|
|
C grammar and JJTree definition for use with JavaCC
|
|
Contributed by Doug South (dsouth@squirrel.com.au) 21/3/97
|
|
From: https://github.com/javacc/javacc/blob/master/grammars/CParser.jj
|
|
*/
|
|
|
|
/* The following code has been significantly modified so as to make it compatible with Ghidra's decompiled output
|
|
* and for the Rust transpilation
|
|
*/
|
|
|
|
options {
|
|
|
|
|
|
}
|
|
|
|
PARSER_BEGIN(CParser)
|
|
|
|
import java.io.InputStream;
|
|
import java.io.ByteArrayInputStream;
|
|
import java.nio.charset.StandardCharsets;
|
|
import ghidrust.decompiler.parser.c.CVisitor;
|
|
|
|
public class CParser/*@bgen(jjtree)*/implements CParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/
|
|
protected static JJTCParserState jjtree = new JJTCParserState();
|
|
|
|
/*@egen*/
|
|
private static CParser c_parser;
|
|
|
|
// Run the parser
|
|
public static String transpile(String c_code) {
|
|
InputStream stream = new ByteArrayInputStream(c_code.getBytes(StandardCharsets.UTF_8));
|
|
c_parser = new CParser(stream);
|
|
|
|
try {
|
|
return parse();
|
|
} catch (ParseException e) {
|
|
System.out.println("Rust transpiler: Encountered errors during parsing.");
|
|
e.printStackTrace();
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static String parse() throws ParseException {
|
|
CParserVisitor visitor = new CVisitor();
|
|
return (String) c_parser.FunctionDefinition().jjtAccept(visitor, null);
|
|
}
|
|
}
|
|
|
|
PARSER_END(CParser)
|
|
|
|
SKIP : {
|
|
" "
|
|
| "\t"
|
|
| "\n"
|
|
| "\r"
|
|
| <"//" (~["\n","\r"])* ("\n" | "\r" | "\r\n")>
|
|
| <"/*" (~["*"])* "*" ("*" | ~["*","/"] (~["*"])* "*")* "/">
|
|
| "#" : PREPROCESSOR_OUTPUT
|
|
}
|
|
|
|
<PREPROCESSOR_OUTPUT> SKIP:
|
|
{
|
|
"\n" : DEFAULT
|
|
}
|
|
|
|
<PREPROCESSOR_OUTPUT> MORE:
|
|
{
|
|
"\\\n"
|
|
|
|
|
"\\\r\n"
|
|
|
|
|
< ~[] >
|
|
}
|
|
|
|
|
|
TOKEN : {
|
|
<INTEGER_LITERAL: <DECIMAL_LITERAL> (["l","L"])? | <HEX_LITERAL> (["l","L"])? | <OCTAL_LITERAL> (["l","L"])?>
|
|
| <#DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])*>
|
|
| <#HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+>
|
|
| <#OCTAL_LITERAL: "0" (["0"-"7"])*>
|
|
| <FLOATING_POINT_LITERAL: (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])? | "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])? | (["0"-"9"])+ <EXPONENT> (["f","F","d","D"])? | (["0"-"9"])+ (<EXPONENT>)? ["f","F","d","D"]>
|
|
| <#EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+>
|
|
| <CHARACTER_LITERAL: "\'" (~["\'","\\","\n","\r"] | "\\" (["n","t","b","r","f","\\","\'","\""] | ["0"-"7"] (["0"-"7"])? | ["0"-"3"] ["0"-"7"] ["0"-"7"])) "\'">
|
|
| <STRING_LITERAL: "\"" ( ~["\"","\\","\n","\r"] | "\\" ( ["n","t","b","r","f","\\","\'","\""] | ["0"-"7"] (["0"-"7"])? | ["0"-"3"] ["0"-"7"] ["0"-"7"] | ( ["\n","\r"] | "\r\n")))* "\"">
|
|
| <UNDEFINED_TYPE: "undefined" (<DECIMAL_LITERAL>)?> // Ghidra specific unknown type
|
|
}
|
|
|
|
TOKEN : {
|
|
<CONTINUE: "continue"> |
|
|
<VOLATILE: "volatile"> |
|
|
<REGISTER: "register"> |
|
|
<UNSIGNED: "unsigned"> |
|
|
<TYPEDEF: "typedef"> |
|
|
<DFLT: "default"> |
|
|
<DOUBLE: "double"> |
|
|
<SIZEOF: "sizeof"> |
|
|
<SWITCH: "switch"> |
|
|
<RETURN: "return"> |
|
|
<EXTERN: "extern"> |
|
|
<STRUCT: "struct"> |
|
|
<STATIC: "static"> |
|
|
<SIGNED: "signed"> |
|
|
<WHILE: "while"> |
|
|
<BREAK: "break"> |
|
|
<UNION: "union"> |
|
|
<CONST: "const"> |
|
|
<FLOAT: "float"> |
|
|
<SHORT: "short"> |
|
|
<ELSE: "else"> |
|
|
<CASE: "case"> |
|
|
<LONG: "long"> |
|
|
<ENUM: "enum"> |
|
|
<AUTO: "auto"> |
|
|
<VOID: "void"> |
|
|
<CHAR: "char"> |
|
|
<GOTO: "goto"> |
|
|
<FOR: "for"> |
|
|
<INT: "int"> |
|
|
<IF: "if"> |
|
|
<DO: "do"> |
|
|
<CODE: "code"> // code ptr, Ghidra specific
|
|
}
|
|
|
|
TOKEN : {
|
|
<IDENTIFIER: <LETTER> (<LETTER> | <DIGIT>)*>
|
|
| <#LETTER: ["$","A"-"Z","_","a"-"z"]>
|
|
| <#DIGIT: ["0"-"9"]>
|
|
}
|
|
|
|
|
|
SimpleNode FunctionDefinition() : {/*@bgen(jjtree) FunctionDefinition */
|
|
ASTFunctionDefinition jjtn000 = new ASTFunctionDefinition(JJTFUNCTIONDEFINITION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) FunctionDefinition */
|
|
try {
|
|
/*@egen*/
|
|
[LOOKAHEAD(DeclarationSpecifiers()) DeclarationSpecifiers()] Declarator()
|
|
CompoundStatement()/*@bgen(jjtree)*/
|
|
{
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
jjtc000 = false;
|
|
}
|
|
/*@egen*/
|
|
{
|
|
return jjtn000;
|
|
}/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void Declaration() : {/*@bgen(jjtree) Declaration */
|
|
ASTDeclaration jjtn000 = new ASTDeclaration(JJTDECLARATION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) Declaration */
|
|
try {
|
|
/*@egen*/
|
|
DeclarationSpecifiers() [ InitDeclaratorList() ] ";"/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void DeclarationList() : {/*@bgen(jjtree) DeclarationList */
|
|
ASTDeclarationList jjtn000 = new ASTDeclarationList(JJTDECLARATIONLIST);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) DeclarationList */
|
|
try {
|
|
/*@egen*/
|
|
( LOOKAHEAD(Declaration()) Declaration() )+/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void DeclarationSpecifiers() : {/*@bgen(jjtree) DeclarationSpecifiers */
|
|
ASTDeclarationSpecifiers jjtn000 = new ASTDeclarationSpecifiers(JJTDECLARATIONSPECIFIERS);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) DeclarationSpecifiers */
|
|
try {
|
|
/*@egen*/
|
|
StorageClassSpecifier() [ LOOKAHEAD(DeclarationSpecifiers())
|
|
DeclarationSpecifiers() ] |
|
|
TypeSpecifier() [ LOOKAHEAD(DeclarationSpecifiers())
|
|
DeclarationSpecifiers() ] |
|
|
TypeQualifier() [ LOOKAHEAD(DeclarationSpecifiers())
|
|
DeclarationSpecifiers() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void StorageClassSpecifier() :
|
|
{/*@bgen(jjtree) GhostStringToken */
|
|
ASTGhostStringToken jjtn000 = new ASTGhostStringToken(JJTGHOSTSTRINGTOKEN);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/
|
|
Token t;
|
|
}
|
|
{/*@bgen(jjtree) GhostStringToken */
|
|
try {
|
|
/*@egen*/
|
|
( t = <AUTO> | t = <REGISTER> | t = <STATIC> | t = <EXTERN> | t = <TYPEDEF> )/*@bgen(jjtree)*/
|
|
{
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
jjtc000 = false;
|
|
}
|
|
/*@egen*/
|
|
{
|
|
jjtn000.setValue(t.image);
|
|
}/*@bgen(jjtree)*/
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void TypeSpecifier() :
|
|
{/*@bgen(jjtree) TypeStringToken */
|
|
ASTTypeStringToken jjtn000 = new ASTTypeStringToken(JJTTYPESTRINGTOKEN);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/
|
|
Token t;
|
|
}
|
|
{/*@bgen(jjtree) TypeStringToken */
|
|
try {
|
|
/*@egen*/
|
|
( t = <VOID> | t = <CHAR> | t = <SHORT> | t = <INT> | t = <LONG> | t = <FLOAT> | t = <DOUBLE> | t = <SIGNED> |
|
|
t = <UNSIGNED> | t = <CODE> | t = <UNDEFINED_TYPE> )/*@bgen(jjtree)*/
|
|
{
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
jjtc000 = false;
|
|
}
|
|
/*@egen*/
|
|
{
|
|
jjtn000.setValue(t.image);
|
|
}/*@bgen(jjtree)*/
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void TypeQualifier() :
|
|
{/*@bgen(jjtree) StringToken */
|
|
ASTStringToken jjtn000 = new ASTStringToken(JJTSTRINGTOKEN);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/
|
|
Token t;
|
|
}
|
|
{/*@bgen(jjtree) StringToken */
|
|
try {
|
|
/*@egen*/
|
|
( t = <CONST> | t = <VOLATILE> )/*@bgen(jjtree)*/
|
|
{
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
jjtc000 = false;
|
|
}
|
|
/*@egen*/
|
|
{
|
|
jjtn000.setValue(t.image);
|
|
}/*@bgen(jjtree)*/
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void InitDeclaratorList() : {/*@bgen(jjtree) InitDeclaratorList */
|
|
ASTInitDeclaratorList jjtn000 = new ASTInitDeclaratorList(JJTINITDECLARATORLIST);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) InitDeclaratorList */
|
|
try {
|
|
/*@egen*/
|
|
InitDeclarator() ("," InitDeclarator())*/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void InitDeclarator() : {/*@bgen(jjtree) InitDeclarator */
|
|
ASTInitDeclarator jjtn000 = new ASTInitDeclarator(JJTINITDECLARATOR);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) InitDeclarator */
|
|
try {
|
|
/*@egen*/
|
|
Declarator() [ "=" Initializer() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void SpecifierQualifierList() : {/*@bgen(jjtree) SpecifierQualifierList */
|
|
ASTSpecifierQualifierList jjtn000 = new ASTSpecifierQualifierList(JJTSPECIFIERQUALIFIERLIST);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) SpecifierQualifierList */
|
|
try {
|
|
/*@egen*/
|
|
TypeSpecifier() [ LOOKAHEAD(SpecifierQualifierList())
|
|
SpecifierQualifierList() ]|
|
|
TypeQualifier() [ LOOKAHEAD(SpecifierQualifierList())
|
|
SpecifierQualifierList() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void Declarator() : {/*@bgen(jjtree) Declarator */
|
|
ASTDeclarator jjtn000 = new ASTDeclarator(JJTDECLARATOR);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) Declarator */
|
|
try {
|
|
/*@egen*/
|
|
[ Pointer() ] DirectDeclarator()/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void DirectDeclarator() : {/*@bgen(jjtree) DirectDeclarator */
|
|
ASTDirectDeclarator jjtn000 = new ASTDirectDeclarator(JJTDIRECTDECLARATOR);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) DirectDeclarator */
|
|
try {
|
|
/*@egen*/
|
|
( Identifier() | "(" Declarator() ")" )
|
|
( "[" [ ConstantExpression() ] "]" |
|
|
LOOKAHEAD(3) "(" ParameterTypeList() ")" |
|
|
"(" [ IdentifierList() ] ")" )*/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void Pointer() : {/*@bgen(jjtree) Pointer */
|
|
ASTPointer jjtn000 = new ASTPointer(JJTPOINTER);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) Pointer */
|
|
try {
|
|
/*@egen*/
|
|
"*" [ TypeQualifierList() ] [ Pointer() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void TypeQualifierList() : {/*@bgen(jjtree) TypeQualifierList */
|
|
ASTTypeQualifierList jjtn000 = new ASTTypeQualifierList(JJTTYPEQUALIFIERLIST);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) TypeQualifierList */
|
|
try {
|
|
/*@egen*/
|
|
(TypeQualifier())+/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void ParameterTypeList() : {/*@bgen(jjtree) ParameterTypeList */
|
|
ASTParameterTypeList jjtn000 = new ASTParameterTypeList(JJTPARAMETERTYPELIST);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) ParameterTypeList */
|
|
try {
|
|
/*@egen*/
|
|
ParameterList() ["," "..." ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void ParameterList() : {/*@bgen(jjtree) ParameterList */
|
|
ASTParameterList jjtn000 = new ASTParameterList(JJTPARAMETERLIST);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) ParameterList */
|
|
try {
|
|
/*@egen*/
|
|
ParameterDeclaration() (LOOKAHEAD(2) "," ParameterDeclaration())*/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void ParameterDeclaration() : {/*@bgen(jjtree) ParameterDeclaration */
|
|
ASTParameterDeclaration jjtn000 = new ASTParameterDeclaration(JJTPARAMETERDECLARATION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) ParameterDeclaration */
|
|
try {
|
|
/*@egen*/
|
|
DeclarationSpecifiers() ( LOOKAHEAD(Declarator()) Declarator() | [ AbstractDeclarator() ] )/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void IdentifierList() : {/*@bgen(jjtree) IdentifierList */
|
|
ASTIdentifierList jjtn000 = new ASTIdentifierList(JJTIDENTIFIERLIST);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) IdentifierList */
|
|
try {
|
|
/*@egen*/
|
|
Identifier() ("," Identifier())*/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void Initializer() : {/*@bgen(jjtree) Initializer */
|
|
ASTInitializer jjtn000 = new ASTInitializer(JJTINITIALIZER);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) Initializer */
|
|
try {
|
|
/*@egen*/
|
|
( AssignmentExpression() |
|
|
"{" InitializerList() [","] "}" )/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void InitializerList() : {/*@bgen(jjtree) InitializerList */
|
|
ASTInitializerList jjtn000 = new ASTInitializerList(JJTINITIALIZERLIST);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) InitializerList */
|
|
try {
|
|
/*@egen*/
|
|
Initializer() (LOOKAHEAD(2) "," Initializer())*/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void TypeName() : {/*@bgen(jjtree) TypeName */
|
|
ASTTypeName jjtn000 = new ASTTypeName(JJTTYPENAME);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) TypeName */
|
|
try {
|
|
/*@egen*/
|
|
SpecifierQualifierList() [ AbstractDeclarator() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
|
|
}
|
|
|
|
void AbstractDeclarator() : {/*@bgen(jjtree) AbstractDeclarator */
|
|
ASTAbstractDeclarator jjtn000 = new ASTAbstractDeclarator(JJTABSTRACTDECLARATOR);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) AbstractDeclarator */
|
|
try {
|
|
/*@egen*/
|
|
( LOOKAHEAD(3) Pointer() |
|
|
[Pointer()] DirectAbstractDeclarator() )/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void DirectAbstractDeclarator() : {/*@bgen(jjtree) DirectAbstractDeclarator */
|
|
ASTDirectAbstractDeclarator jjtn000 = new ASTDirectAbstractDeclarator(JJTDIRECTABSTRACTDECLARATOR);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) DirectAbstractDeclarator */
|
|
try {
|
|
/*@egen*/
|
|
( LOOKAHEAD(2) "(" AbstractDeclarator() ")" |
|
|
"[" [ConstantExpression()] "]" |
|
|
"(" [ParameterTypeList()] ")" )
|
|
|
|
( "[" [ ConstantExpression() ] "]" | "(" [ ParameterTypeList() ] ")" )*/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void Statement() : {/*@bgen(jjtree) Statement */
|
|
ASTStatement jjtn000 = new ASTStatement(JJTSTATEMENT);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) Statement */
|
|
try {
|
|
/*@egen*/
|
|
( LOOKAHEAD(2) LabeledStatement() |
|
|
ExpressionStatement() |
|
|
CompoundStatement() |
|
|
SelectionStatement() |
|
|
IterationStatement() |
|
|
JumpStatement() )/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void LabeledStatement() : {/*@bgen(jjtree) LabeledStatement */
|
|
ASTLabeledStatement jjtn000 = new ASTLabeledStatement(JJTLABELEDSTATEMENT);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) LabeledStatement */
|
|
try {
|
|
/*@egen*/
|
|
( Identifier() ":" Statement() |
|
|
<CASE> ConstantExpression() ":" Statement() |
|
|
<DFLT> ":" Statement() )/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void ExpressionStatement() : {/*@bgen(jjtree) ExpressionStatement */
|
|
ASTExpressionStatement jjtn000 = new ASTExpressionStatement(JJTEXPRESSIONSTATEMENT);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) ExpressionStatement */
|
|
try {
|
|
/*@egen*/
|
|
[ Expression() ] ";"/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void CompoundStatement() : {/*@bgen(jjtree) CompoundStatement */
|
|
ASTCompoundStatement jjtn000 = new ASTCompoundStatement(JJTCOMPOUNDSTATEMENT);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) CompoundStatement */
|
|
try {
|
|
/*@egen*/
|
|
"{" [ LOOKAHEAD(DeclarationList()) DeclarationList() ]
|
|
[ StatementList() ]
|
|
"}"/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void StatementList() : {/*@bgen(jjtree) StatementList */
|
|
ASTStatementList jjtn000 = new ASTStatementList(JJTSTATEMENTLIST);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) StatementList */
|
|
try {
|
|
/*@egen*/
|
|
(Statement())+/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void SelectionStatement() : {/*@bgen(jjtree) SelectionStatement */
|
|
ASTSelectionStatement jjtn000 = new ASTSelectionStatement(JJTSELECTIONSTATEMENT);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) SelectionStatement */
|
|
try {
|
|
/*@egen*/
|
|
( <IF> "(" Expression() ")" Statement() [ LOOKAHEAD(2) <ELSE> Statement() ] |
|
|
<SWITCH> "(" Expression() ")" Statement() )/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void IterationStatement() : {/*@bgen(jjtree) IterationStatement */
|
|
ASTIterationStatement jjtn000 = new ASTIterationStatement(JJTITERATIONSTATEMENT);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) IterationStatement */
|
|
try {
|
|
/*@egen*/
|
|
( <WHILE> "(" Expression() ")" Statement() |
|
|
<DO> Statement() <WHILE> "(" Expression() ")" ";" |
|
|
<FOR> "(" [ Expression() ] ";" [ Expression() ] ";" [ Expression() ] ")" Statement() )/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void JumpStatement() : {/*@bgen(jjtree) JumpStatement */
|
|
ASTJumpStatement jjtn000 = new ASTJumpStatement(JJTJUMPSTATEMENT);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) JumpStatement */
|
|
try {
|
|
/*@egen*/
|
|
( <GOTO> Identifier() ";" |
|
|
<CONTINUE> ";" |
|
|
<BREAK> ";" |
|
|
<RETURN> [ Expression() ] ";" )/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void Expression() : {/*@bgen(jjtree) Expression */
|
|
ASTExpression jjtn000 = new ASTExpression(JJTEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) Expression */
|
|
try {
|
|
/*@egen*/
|
|
AssignmentExpression() ( "," AssignmentExpression() )* | DeclarationSpecifiers() InitDeclaratorList()/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void AssignmentExpression() : {/*@bgen(jjtree) AssignmentExpression */
|
|
ASTAssignmentExpression jjtn000 = new ASTAssignmentExpression(JJTASSIGNMENTEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) AssignmentExpression */
|
|
try {
|
|
/*@egen*/
|
|
LOOKAHEAD(UnaryExpression() AssignmentOperator()) UnaryExpression() AssignmentOperator() AssignmentExpression() |
|
|
LOOKAHEAD(3) ConditionalExpression()/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void AssignmentOperator() : {/*@bgen(jjtree) AssignmentOperator */
|
|
ASTAssignmentOperator jjtn000 = new ASTAssignmentOperator(JJTASSIGNMENTOPERATOR);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) AssignmentOperator */
|
|
try {
|
|
/*@egen*/
|
|
( "=" | "*=" | "/=" | "%=" | "+=" | "-=" | "<<=" | ">>=" | "&=" | "^=" | "|=" )/*@bgen(jjtree)*/
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void ConditionalExpression() : {/*@bgen(jjtree) ConditionalExpression */
|
|
ASTConditionalExpression jjtn000 = new ASTConditionalExpression(JJTCONDITIONALEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) ConditionalExpression */
|
|
try {
|
|
/*@egen*/
|
|
LogicalORExpression() [ "?" Expression() ":" ConditionalExpression() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void ConstantExpression() : {/*@bgen(jjtree) ConstantExpression */
|
|
ASTConstantExpression jjtn000 = new ASTConstantExpression(JJTCONSTANTEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) ConstantExpression */
|
|
try {
|
|
/*@egen*/
|
|
ConditionalExpression()/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void LogicalORExpression() : {/*@bgen(jjtree) LogicalORExpression */
|
|
ASTLogicalORExpression jjtn000 = new ASTLogicalORExpression(JJTLOGICALOREXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) LogicalORExpression */
|
|
try {
|
|
/*@egen*/
|
|
LogicalANDExpression() [ "||" LogicalORExpression() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void LogicalANDExpression() : {/*@bgen(jjtree) LogicalANDExpression */
|
|
ASTLogicalANDExpression jjtn000 = new ASTLogicalANDExpression(JJTLOGICALANDEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) LogicalANDExpression */
|
|
try {
|
|
/*@egen*/
|
|
InclusiveORExpression() [ "&&" LogicalANDExpression() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void InclusiveORExpression() : {/*@bgen(jjtree) InclusiveORExpression */
|
|
ASTInclusiveORExpression jjtn000 = new ASTInclusiveORExpression(JJTINCLUSIVEOREXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) InclusiveORExpression */
|
|
try {
|
|
/*@egen*/
|
|
ExclusiveORExpression() [ "|" InclusiveORExpression() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void ExclusiveORExpression() : {/*@bgen(jjtree) ExclusiveORExpression */
|
|
ASTExclusiveORExpression jjtn000 = new ASTExclusiveORExpression(JJTEXCLUSIVEOREXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) ExclusiveORExpression */
|
|
try {
|
|
/*@egen*/
|
|
ANDExpression() [ "^" ExclusiveORExpression() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void ANDExpression() : {/*@bgen(jjtree) ANDExpression */
|
|
ASTANDExpression jjtn000 = new ASTANDExpression(JJTANDEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) ANDExpression */
|
|
try {
|
|
/*@egen*/
|
|
EqualityExpression() [ "&" ANDExpression() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void EqualityExpression() : {/*@bgen(jjtree) EqualityExpression */
|
|
ASTEqualityExpression jjtn000 = new ASTEqualityExpression(JJTEQUALITYEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) EqualityExpression */
|
|
try {
|
|
/*@egen*/
|
|
RelationalExpression() [ ( "==" | "!=" ) EqualityExpression() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void RelationalExpression() : {/*@bgen(jjtree) RelationalExpression */
|
|
ASTRelationalExpression jjtn000 = new ASTRelationalExpression(JJTRELATIONALEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) RelationalExpression */
|
|
try {
|
|
/*@egen*/
|
|
ShiftExpression() [ ( "<" | ">" | "<=" | ">=" ) RelationalExpression() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void ShiftExpression() : {/*@bgen(jjtree) ShiftExpression */
|
|
ASTShiftExpression jjtn000 = new ASTShiftExpression(JJTSHIFTEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) ShiftExpression */
|
|
try {
|
|
/*@egen*/
|
|
AdditiveExpression() [ ( "<<" | ">>" ) ShiftExpression() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void AdditiveExpression() : {/*@bgen(jjtree) AdditiveExpression */
|
|
ASTAdditiveExpression jjtn000 = new ASTAdditiveExpression(JJTADDITIVEEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) AdditiveExpression */
|
|
try {
|
|
/*@egen*/
|
|
MultiplicativeExpression() [ ( "+" | "-" ) AdditiveExpression() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void MultiplicativeExpression() : {/*@bgen(jjtree) MultiplicativeExpression */
|
|
ASTMultiplicativeExpression jjtn000 = new ASTMultiplicativeExpression(JJTMULTIPLICATIVEEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) MultiplicativeExpression */
|
|
try {
|
|
/*@egen*/
|
|
CastExpression() [ ( "*" | "/" | "%" ) MultiplicativeExpression() ]/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void CastExpression() : {/*@bgen(jjtree) CastExpression */
|
|
ASTCastExpression jjtn000 = new ASTCastExpression(JJTCASTEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) CastExpression */
|
|
try {
|
|
/*@egen*/
|
|
( LOOKAHEAD("(" TypeName() ")" CastExpression() ) "(" TypeName() ")" CastExpression() |
|
|
UnaryExpression() )/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void UnaryExpression() : {/*@bgen(jjtree) UnaryExpression */
|
|
ASTUnaryExpression jjtn000 = new ASTUnaryExpression(JJTUNARYEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) UnaryExpression */
|
|
try {
|
|
/*@egen*/
|
|
( LOOKAHEAD(3) PostfixExpression() |
|
|
"++" UnaryExpression() |
|
|
"--" UnaryExpression() |
|
|
UnaryOperator() CastExpression() |
|
|
<SIZEOF> ( LOOKAHEAD(UnaryExpression() ) UnaryExpression() | "(" TypeName() ")" ) )/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void UnaryOperator() : {/*@bgen(jjtree) UnaryOperator */
|
|
ASTUnaryOperator jjtn000 = new ASTUnaryOperator(JJTUNARYOPERATOR);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) UnaryOperator */
|
|
try {
|
|
/*@egen*/
|
|
( "&" | "*" | "+" | "-" | "~" | "!" )/*@bgen(jjtree)*/
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void PostfixExpression() : {/*@bgen(jjtree) PostfixExpression */
|
|
ASTPostfixExpression jjtn000 = new ASTPostfixExpression(JJTPOSTFIXEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) PostfixExpression */
|
|
try {
|
|
/*@egen*/
|
|
PrimaryExpression() ( "[" Expression() "]" |
|
|
"(" [ LOOKAHEAD(ArgumentExpressionList() ) ArgumentExpressionList() ] ")" |
|
|
"." Identifier() |
|
|
"->" Identifier() |
|
|
"++" |
|
|
"--" )*/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void PrimaryExpression() : {/*@bgen(jjtree) PrimaryExpression */
|
|
ASTPrimaryExpression jjtn000 = new ASTPrimaryExpression(JJTPRIMARYEXPRESSION);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) PrimaryExpression */
|
|
try {
|
|
/*@egen*/
|
|
( Identifier() |
|
|
Constant() |
|
|
"(" Expression() ")" )/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void ArgumentExpressionList() : {/*@bgen(jjtree) ArgumentExpressionList */
|
|
ASTArgumentExpressionList jjtn000 = new ASTArgumentExpressionList(JJTARGUMENTEXPRESSIONLIST);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/}
|
|
{/*@bgen(jjtree) ArgumentExpressionList */
|
|
try {
|
|
/*@egen*/
|
|
AssignmentExpression() ( "," AssignmentExpression() )*/*@bgen(jjtree)*/
|
|
} catch (Throwable jjte000) {
|
|
if (jjtc000) {
|
|
jjtree.clearNodeScope(jjtn000);
|
|
jjtc000 = false;
|
|
} else {
|
|
jjtree.popNode();
|
|
}
|
|
if (jjte000 instanceof RuntimeException) {
|
|
throw (RuntimeException)jjte000;
|
|
}
|
|
if (jjte000 instanceof ParseException) {
|
|
throw (ParseException)jjte000;
|
|
}
|
|
throw (Error)jjte000;
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void Identifier() :
|
|
{/*@bgen(jjtree) StringToken */
|
|
ASTStringToken jjtn000 = new ASTStringToken(JJTSTRINGTOKEN);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/
|
|
Token t;
|
|
}
|
|
{/*@bgen(jjtree) StringToken */
|
|
try {
|
|
/*@egen*/
|
|
t = <IDENTIFIER>/*@bgen(jjtree)*/
|
|
{
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
jjtc000 = false;
|
|
}
|
|
/*@egen*/
|
|
{
|
|
jjtn000.setValue(t.image);
|
|
}/*@bgen(jjtree)*/
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
}
|
|
|
|
void Constant() :
|
|
{/*@bgen(jjtree) StringToken */
|
|
ASTStringToken jjtn000 = new ASTStringToken(JJTSTRINGTOKEN);
|
|
boolean jjtc000 = true;
|
|
jjtree.openNodeScope(jjtn000);
|
|
/*@egen*/
|
|
Token t;
|
|
}
|
|
{/*@bgen(jjtree) StringToken */
|
|
try {
|
|
/*@egen*/
|
|
(t = <INTEGER_LITERAL> | t = <FLOATING_POINT_LITERAL> | t = <CHARACTER_LITERAL> | t = <STRING_LITERAL>)/*@bgen(jjtree)*/
|
|
{
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
jjtc000 = false;
|
|
}
|
|
/*@egen*/
|
|
{
|
|
jjtn000.setValue(t.image);
|
|
}/*@bgen(jjtree)*/
|
|
} finally {
|
|
if (jjtc000) {
|
|
jjtree.closeNodeScope(jjtn000, true);
|
|
}
|
|
}
|
|
/*@egen*/
|
|
} |