📄 javarecognizer.java
字号:
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST compoundStatement_AST = null;
Token lc = null;
AST lc_AST = null;
lc = LT( 1 );
lc_AST = astFactory.create( lc );
astFactory.makeASTRoot( currentAST,
lc_AST );
match( LCURLY );
if ( inputState.guessing == 0 )
{
lc_AST.setType( SLIST );
}
{
_loop106 : do
{
if ( (_tokenSet_6.member( LA( 1 ) )) )
{
statement();
astFactory.addASTChild( currentAST,
returnAST );
}
else
{
break _loop106;
}
}
while ( true );
}
match( RCURLY );
compoundStatement_AST = (AST) currentAST.root;
returnAST = compoundStatement_AST;
}
public final void ruleCondition() throws RecognitionException,
TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST ruleCondition_AST = null;
logicalOrExpression();
astFactory.addASTChild( currentAST,
returnAST );
ruleCondition_AST = (AST) currentAST.root;
returnAST = ruleCondition_AST;
}
public final void logicalOrExpression() throws RecognitionException,
TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST logicalOrExpression_AST = null;
logicalAndExpression();
astFactory.addASTChild( currentAST,
returnAST );
{
_loop148 : do
{
if ( (LA( 1 ) == LOR) )
{
AST tmp25_AST = null;
tmp25_AST = astFactory.create( LT( 1 ) );
astFactory.makeASTRoot( currentAST,
tmp25_AST );
match( LOR );
logicalAndExpression();
astFactory.addASTChild( currentAST,
returnAST );
}
else
{
break _loop148;
}
}
while ( true );
}
logicalOrExpression_AST = (AST) currentAST.root;
returnAST = logicalOrExpression_AST;
}
public final void identifier() throws RecognitionException,
TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST identifier_AST = null;
AST tmp26_AST = null;
tmp26_AST = astFactory.create( LT( 1 ) );
astFactory.addASTChild( currentAST,
tmp26_AST );
match( IDENT );
{
_loop40 : do
{
if ( (LA( 1 ) == DOT) )
{
AST tmp27_AST = null;
tmp27_AST = astFactory.create( LT( 1 ) );
astFactory.makeASTRoot( currentAST,
tmp27_AST );
match( DOT );
AST tmp28_AST = null;
tmp28_AST = astFactory.create( LT( 1 ) );
astFactory.addASTChild( currentAST,
tmp28_AST );
match( IDENT );
}
else
{
break _loop40;
}
}
while ( true );
}
identifier_AST = (AST) currentAST.root;
returnAST = identifier_AST;
}
public final void identifierStar() throws RecognitionException,
TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST identifierStar_AST = null;
AST tmp29_AST = null;
tmp29_AST = astFactory.create( LT( 1 ) );
astFactory.addASTChild( currentAST,
tmp29_AST );
match( IDENT );
{
_loop43 : do
{
if ( (LA( 1 ) == DOT) && (LA( 2 ) == IDENT) )
{
AST tmp30_AST = null;
tmp30_AST = astFactory.create( LT( 1 ) );
astFactory.makeASTRoot( currentAST,
tmp30_AST );
match( DOT );
AST tmp31_AST = null;
tmp31_AST = astFactory.create( LT( 1 ) );
astFactory.addASTChild( currentAST,
tmp31_AST );
match( IDENT );
}
else
{
break _loop43;
}
}
while ( true );
}
{
switch ( LA( 1 ) )
{
case DOT :
{
AST tmp32_AST = null;
tmp32_AST = astFactory.create( LT( 1 ) );
astFactory.makeASTRoot( currentAST,
tmp32_AST );
match( DOT );
AST tmp33_AST = null;
tmp33_AST = astFactory.create( LT( 1 ) );
astFactory.addASTChild( currentAST,
tmp33_AST );
match( STAR );
break;
}
case SEMI :
{
break;
}
default :
{
throw new NoViableAltException( LT( 1 ),
getFilename() );
}
}
}
identifierStar_AST = (AST) currentAST.root;
returnAST = identifierStar_AST;
}
public final void modifiers() throws RecognitionException,
TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST modifiers_AST = null;
{
_loop47 : do
{
if ( (_tokenSet_7.member( LA( 1 ) )) )
{
modifier();
astFactory.addASTChild( currentAST,
returnAST );
}
else
{
break _loop47;
}
}
while ( true );
}
if ( inputState.guessing == 0 )
{
modifiers_AST = (AST) currentAST.root;
modifiers_AST = (AST) astFactory.make( (new ASTArray( 2 )).add( astFactory.create( MODIFIERS,
"MODIFIERS" ) ).add( modifiers_AST ) );
currentAST.root = modifiers_AST;
currentAST.child = modifiers_AST != null && modifiers_AST.getFirstChild() != null ? modifiers_AST.getFirstChild() : modifiers_AST;
currentAST.advanceChildToEnd();
}
modifiers_AST = (AST) currentAST.root;
returnAST = modifiers_AST;
}
public final void classDefinition(AST modifiers) throws RecognitionException,
TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST classDefinition_AST = null;
AST sc_AST = null;
AST ic_AST = null;
AST cb_AST = null;
match( LITERAL_class );
AST tmp35_AST = null;
tmp35_AST = astFactory.create( LT( 1 ) );
match( IDENT );
superClassClause();
sc_AST = (AST) returnAST;
implementsClause();
ic_AST = (AST) returnAST;
classBlock();
cb_AST = (AST) returnAST;
if ( inputState.guessing == 0 )
{
classDefinition_AST = (AST) currentAST.root;
classDefinition_AST = (AST) astFactory.make( (new ASTArray( 6 )).add( astFactory.create( CLASS_DEF,
"CLASS_DEF" ) ).add( modifiers ).add( tmp35_AST ).add( sc_AST ).add( ic_AST ).add( cb_AST ) );
currentAST.root = classDefinition_AST;
currentAST.child = classDefinition_AST != null && classDefinition_AST.getFirstChild() != null ? classDefinition_AST.getFirstChild() : classDefinition_AST;
currentAST.advanceChildToEnd();
}
returnAST = classDefinition_AST;
}
public final void interfaceDefinition(AST modifiers) throws RecognitionException,
TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST interfaceDefinition_AST = null;
AST ie_AST = null;
AST cb_AST = null;
match( LITERAL_interface );
AST tmp37_AST = null;
tmp37_AST = astFactory.create( LT( 1 ) );
match( IDENT );
interfaceExtends();
ie_AST = (AST) returnAST;
classBlock();
cb_AST = (AST) returnAST;
if ( inputState.guessing == 0 )
{
interfaceDefinition_AST = (AST) currentAST.root;
interfaceDefinition_AST = (AST) astFactory.make( (new ASTArray( 5 )).add( astFactory.create( INTERFACE_DEF,
"INTERFACE_DEF" ) ).add( modifiers ).add( tmp37_AST ).add( ie_AST ).add( cb_AST ) );
currentAST.root = interfaceDefinition_AST;
currentAST.child = interfaceDefinition_AST != null && interfaceDefinition_AST.getFirstChild() != null ? interfaceDefinition_AST.getFirstChild() : interfaceDefinition_AST;
currentAST.advanceChildToEnd();
}
returnAST = interfaceDefinition_AST;
}
/**
* A declaration is the creation of a reference or primitive-type variable Create a separate Type/Var tree for each var in the var list.
*/
public final void declaration() throws RecognitionException,
TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST declaration_AST = null;
AST m_AST = null;
AST t_AST = null;
AST v_AST = null;
modifiers();
m_AST = (AST) returnAST;
typeSpec( false );
t_AST = (AST) returnAST;
variableDefinitions( m_AST,
t_AST );
v_AST = (AST) returnAST;
if ( inputState.guessing == 0 )
{
declaration_AST = (AST) currentAST.root;
declaration_AST = v_AST;
currentAST.root = declaration_AST;
currentAST.child = declaration_AST != null && declaration_AST.getFirstChild() != null ? declaration_AST.getFirstChild() : declaration_AST;
currentAST.advanceChildToEnd();
}
returnAST = declaration_AST;
}
public final void typeSpec(boolean addImagNode) throws RecognitionException,
TokenStreamException
{
returnAST = null;
ASTPair currentAST = new ASTPair();
AST typeSpec_AST = null;
switch ( LA( 1 ) )
{
case IDENT :
{
classTypeSpec( addImagNode );
astFactory.addASTChild( currentAST,
returnAST );
typeSpec_AST = (AST) currentAST.root;
break;
}
case LITERAL_void :
case LITERAL_boolean :
case LITERAL_byte :
case LITERAL_char :
case LITERAL_short :
case LITERAL_int :
case LITERAL_float :
case LITERAL_long :
case LITERAL_double :
{
builtInTypeSpec( addImagNode );
astFactory.addASTChild( currentAST,
returnAST );
typeSpec_AST = (AST) currentAST.root;
break;
}
default :
{
throw new NoViableAltException( LT( 1 ),
getFilename() );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -