📄 groovyrecognizer.java
字号:
throw new NoViableAltException(LT(1), getFilename()); } } } } else { break _loop257; } } while (true); } blockBody_AST = (AST)currentAST.root; returnAST = blockBody_AST; } public final void identifier() throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST identifier_AST = null; AST tmp27_AST = null; tmp27_AST = astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp27_AST); match(IDENT); { _loop62: do { if ((LA(1)==DOT)) { AST tmp28_AST = null; tmp28_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp28_AST); match(DOT); nls(); AST tmp29_AST = null; tmp29_AST = astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp29_AST); match(IDENT); } else { break _loop62; } } while (true); } identifier_AST = (AST)currentAST.root; returnAST = identifier_AST; } public final void importStatement() throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST importStatement_AST = null; Token i = null; AST i_AST = null; boolean isStatic = false; i = LT(1); i_AST = astFactory.create(i); astFactory.makeASTRoot(currentAST, i_AST); match(LITERAL_import); if ( inputState.guessing==0 ) { i_AST.setType(IMPORT); } { switch ( LA(1)) { case LITERAL_static: { match(LITERAL_static); if ( inputState.guessing==0 ) { i_AST.setType(STATIC_IMPORT); } break; } case IDENT: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } identifierStar(); astFactory.addASTChild(currentAST, returnAST); importStatement_AST = (AST)currentAST.root; returnAST = importStatement_AST; } public final void identifierStar() throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST identifierStar_AST = null; AST tmp31_AST = null; tmp31_AST = astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp31_AST); match(IDENT); { _loop65: do { if ((LA(1)==DOT) && (LA(2)==IDENT||LA(2)==NLS) && (_tokenSet_26.member(LA(3)))) { AST tmp32_AST = null; tmp32_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp32_AST); match(DOT); nls(); AST tmp33_AST = null; tmp33_AST = astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp33_AST); match(IDENT); } else { break _loop65; } } while (true); } { switch ( LA(1)) { case DOT: { AST tmp34_AST = null; tmp34_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp34_AST); match(DOT); nls(); AST tmp35_AST = null; tmp35_AST = astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp35_AST); match(STAR); break; } case LITERAL_as: { AST tmp36_AST = null; tmp36_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp36_AST); match(LITERAL_as); nls(); AST tmp37_AST = null; tmp37_AST = astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp37_AST); match(IDENT); break; } case EOF: case RCURLY: case SEMI: case NLS: case LITERAL_default: case LITERAL_else: case LITERAL_case: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } identifierStar_AST = (AST)currentAST.root; returnAST = identifierStar_AST; } protected final void typeDefinitionInternal( AST mods ) throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST typeDefinitionInternal_AST = null; AST cd_AST = null; AST id_AST = null; AST ed_AST = null; AST ad_AST = null; switch ( LA(1)) { case LITERAL_class: { classDefinition(mods); cd_AST = (AST)returnAST; astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { typeDefinitionInternal_AST = (AST)currentAST.root; typeDefinitionInternal_AST = cd_AST; currentAST.root = typeDefinitionInternal_AST; currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ? typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST; currentAST.advanceChildToEnd(); } typeDefinitionInternal_AST = (AST)currentAST.root; break; } case LITERAL_interface: { interfaceDefinition(mods); id_AST = (AST)returnAST; astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { typeDefinitionInternal_AST = (AST)currentAST.root; typeDefinitionInternal_AST = id_AST; currentAST.root = typeDefinitionInternal_AST; currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ? typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST; currentAST.advanceChildToEnd(); } typeDefinitionInternal_AST = (AST)currentAST.root; break; } case LITERAL_enum: { enumDefinition(mods); ed_AST = (AST)returnAST; astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { typeDefinitionInternal_AST = (AST)currentAST.root; typeDefinitionInternal_AST = ed_AST; currentAST.root = typeDefinitionInternal_AST; currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ? typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST; currentAST.advanceChildToEnd(); } typeDefinitionInternal_AST = (AST)currentAST.root; break; } case AT: { annotationDefinition(mods); ad_AST = (AST)returnAST; astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { typeDefinitionInternal_AST = (AST)currentAST.root; typeDefinitionInternal_AST = ad_AST; currentAST.root = typeDefinitionInternal_AST; currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ? typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST; currentAST.advanceChildToEnd(); } typeDefinitionInternal_AST = (AST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } returnAST = typeDefinitionInternal_AST; } public final void classDefinition( AST modifiers ) throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST classDefinition_AST = null; AST tp_AST = null; AST sc_AST = null; AST ic_AST = null; AST cb_AST = null; Token first = LT(1);AST prevCurrentClass = currentClass; match(LITERAL_class); AST tmp39_AST = null; tmp39_AST = astFactory.create(LT(1)); match(IDENT); nls(); if ( inputState.guessing==0 ) { currentClass = tmp39_AST; } { switch ( LA(1)) { case LT: { typeParameters(); tp_AST = (AST)returnAST; break; } case LITERAL_extends: case LCURLY: case LITERAL_implements: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } 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(7)).add(create(CLASS_DEF,"CLASS_DEF",first,LT(1))).add(modifiers).add(tmp39_AST).add(tp_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(); } if ( inputState.guessing==0 ) { currentClass = prevCurrentClass; } returnAST = classDefinition_AST; } public final void interfaceDefinition( AST modifiers ) throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST interfaceDefinition_AST = null; AST tp_AST = null; AST ie_AST = null; AST ib_AST = null; Token first = LT(1); match(LITERAL_interface); AST tmp41_AST = null; tmp41_AST = astFactory.create(LT(1)); match(IDENT); nls(); { switch ( LA(1)) { case LT: { typeParameters(); tp_AST = (AST)returnAST; break; } case LITERAL_extends: case LCURLY: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } interfaceExtends(); ie_AST = (AST)returnAST; interfaceBlock(); ib_AST = (AST)returnAST; if ( inputState.guessing==0 ) { interfaceDefinition_AST = (AST)currentAST.root; interfaceDefinition_AST = (AST)astFactory.make( (new ASTArray(6)).add(create(INTERFACE_DEF,"INTERFACE_DEF",first,LT(1))).add(modifiers).add(tmp41_AST).add(tp_AST).add(ie_AST).add(ib_AST)); currentAST.root = interfaceDefinition_AST; currentAST.child = interfaceDefinition_AST!=null &&interfaceDefinition_AST.getFirstChild()!=null ? interfaceDefinition_AST.getFirstChild() : interfaceDefinition_AST; currentAST.advanceChildToEnd(); } returnAST = interfaceDefinition_AST; } public final void enumDefinition( AST modifiers ) throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST enumDefinition_AST = null; AST ic_AST = null; AST eb_AST = null; Token first = LT(1); match(LITERAL_enum); AST tmp43_AST = null; tmp43_AST = astFactory.create(LT(1)); match(IDENT); implementsClause(); ic_AST = (AST)returnAST; enumBlock(); eb_AST = (AST)returnAST; if ( inputState.guessing==0 ) { enumDefinition_AST = (AST)currentAST.root; enumDefinition_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(ENUM_DEF,"ENUM_DEF",first,LT(1))).add(modifiers).add(tmp43_AST).add(ic_AST).add(eb_AST)); currentAST.root = enumDefinition_AST; currentAST.child = enumDefinition_AST!=null &&enumDefinition_AST.getFirstChild()!=null ? enumDefinition_AST.getFirstChild() : enumDefinition_AST; currentAST.advanceChildToEnd(); } returnAST = enumDefinition_AST; } public final void annotationDefinition( AST modifiers ) throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST annotationDefinition_AST = null; AST ab_AST = null; Token first = LT(1); AST tmp44_AST = null; tmp44_AST = astFactory.create(LT(1)); match(AT); match(LITERAL_interface); AST tmp46_AST = null; tmp46_AST = astFactory.create(LT(1)); match(IDENT); annotationBlock(); ab_AST = (AST)returnAST; if ( inputState.guessing==0 ) { annotationDefinition_AST = (AST)currentAST.root; annotationDefinition_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(ANNOTATION_DEF,"ANNOTATION_DEF",first,LT(1))).add(modifiers).add(tmp46_AST).add(ab_AST)); currentAST.root = annotationDefinition_AST; currentAST.child = annotationDefinition_AST!=null &&annotationDefinition_AST.getFirstChild()!=null ? annotationDefinition_AST.getFirstChild() : annotationDefinition_AST; currentAST.advanceChildToEnd(); } returnAST = annotationDefinition_AST; } /** A declaration is the creation of a reference or primitive-type variable, * or (if arguments are present) of a method. * Generically, this is called a 'variable' definition, even in the case of a class field or method. * It may start with the modifiers and/or a declaration keyword "def". * It may also start with the modifiers and a capitalized type name. * <p> * AST effect: Create a separate Type/Var tree for each var in the var list. * Must be guarded, as in (declarationStart) => declaration. */ 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; AST t2_AST = null; AST v2_AST = null; switch ( LA(1)) { case FINAL: case ABSTRACT: case STRICTFP: case LITERAL_static: case LITERAL_def: case AT: case LITERAL_private: case LITERAL_public: case LITERAL_protected: case LITERAL_transient: case LITERAL_native: case LITERAL_threadsafe:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -