📄 gcmdparser.java
字号:
return n; } public final ASTElemVarsDeclaration elemVarsDeclaration() throws RecognitionException, TokenStreamException { ASTElemVarsDeclaration n; List idList; ASTType t = null; n = null; try { // for error handling idList=idList(); { switch ( LA(1)) { case COLON: { match(COLON); t=type(); break; } case BAR: case SEMI: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } n = new ASTElemVarsDeclaration(idList, t); } catch (RecognitionException ex) { reportError(ex); consume(); consumeUntil(_tokenSet_37); } return n; } public final ASTVariableInitialization variableInitialization() throws RecognitionException, TokenStreamException { ASTVariableInitialization n; Token name = null; ASTType t; ASTExpression e; n = null; try { // for error handling name = LT(1); match(IDENT); match(COLON); t=type(); match(EQUAL); e=expression(); n = new ASTVariableInitialization((MyToken) name, t, e); } catch (RecognitionException ex) { reportError(ex); consume(); consumeUntil(_tokenSet_38); } return n; } public final ASTCollectionLiteral collectionLiteral() throws RecognitionException, TokenStreamException { ASTCollectionLiteral n; ASTCollectionItem ci; n = null; try { // for error handling MyToken op = (MyToken) LT(1); { switch ( LA(1)) { case LITERAL_Set: { match(LITERAL_Set); break; } case LITERAL_Sequence: { match(LITERAL_Sequence); break; } case LITERAL_Bag: { match(LITERAL_Bag); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } n = new ASTCollectionLiteral(op); match(LBRACE); ci=collectionItem(); n.addItem(ci); { _loop98: do { if ((LA(1)==COMMA)) { match(COMMA); ci=collectionItem(); n.addItem(ci); } else { break _loop98; } } while (true); } match(RBRACE); } catch (RecognitionException ex) { reportError(ex); consume(); consumeUntil(_tokenSet_30); } return n; } public final ASTEmptyCollectionLiteral emptyCollectionLiteral() throws RecognitionException, TokenStreamException { ASTEmptyCollectionLiteral n; ASTType t = null; n = null; try { // for error handling match(LITERAL_oclEmpty); match(LPAREN); t=collectionType(); match(RPAREN); n = new ASTEmptyCollectionLiteral(t); } catch (RecognitionException ex) { reportError(ex); consume(); consumeUntil(_tokenSet_30); } return n; } public final ASTUndefinedLiteral undefinedLiteral() throws RecognitionException, TokenStreamException { ASTUndefinedLiteral n; ASTType t = null; n = null; try { // for error handling match(LITERAL_oclUndefined); match(LPAREN); t=type(); match(RPAREN); n = new ASTUndefinedLiteral(t); } catch (RecognitionException ex) { reportError(ex); consume(); consumeUntil(_tokenSet_30); } return n; } public final ASTTupleLiteral tupleLiteral() throws RecognitionException, TokenStreamException { ASTTupleLiteral n; ASTTupleItem ti; n = null; List tiList = new ArrayList(); try { // for error handling match(LITERAL_Tuple); match(LBRACE); ti=tupleItem(); tiList.add(ti); { _loop105: do { if ((LA(1)==COMMA)) { match(COMMA); ti=tupleItem(); tiList.add(ti); } else { break _loop105; } } while (true); } match(RBRACE); n = new ASTTupleLiteral(tiList); } catch (RecognitionException ex) { reportError(ex); consume(); consumeUntil(_tokenSet_30); } return n; } public final ASTCollectionItem collectionItem() throws RecognitionException, TokenStreamException { ASTCollectionItem n; ASTExpression e; n = new ASTCollectionItem(); try { // for error handling e=expression(); n.setFirst(e); { switch ( LA(1)) { case DOTDOT: { match(DOTDOT); e=expression(); n.setSecond(e); break; } case COMMA: case RBRACE: { break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } catch (RecognitionException ex) { reportError(ex); consume(); consumeUntil(_tokenSet_39); } return n; } public final ASTCollectionType collectionType() throws RecognitionException, TokenStreamException { ASTCollectionType n; ASTType elemType = null; n = null; try { // for error handling MyToken op = (MyToken) LT(1); { switch ( LA(1)) { case LITERAL_Collection: { match(LITERAL_Collection); break; } case LITERAL_Set: { match(LITERAL_Set); break; } case LITERAL_Sequence: { match(LITERAL_Sequence); break; } case LITERAL_Bag: { match(LITERAL_Bag); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } match(LPAREN); elemType=type(); match(RPAREN); n = new ASTCollectionType(op, elemType); } catch (RecognitionException ex) { reportError(ex); consume(); consumeUntil(_tokenSet_17); } return n; } public final ASTTupleItem tupleItem() throws RecognitionException, TokenStreamException { ASTTupleItem n; Token name = null; ASTExpression e; n = null; try { // for error handling name = LT(1); match(IDENT); match(COLON); e=expression(); n = new ASTTupleItem((MyToken) name, e); } catch (RecognitionException ex) { reportError(ex); consume(); consumeUntil(_tokenSet_39); } return n; } public final ASTTupleType tupleType() throws RecognitionException, TokenStreamException { ASTTupleType n; ASTTuplePart tp; n = null; List tpList = new ArrayList(); try { // for error handling match(LITERAL_Tuple); match(LPAREN); tp=tuplePart(); tpList.add(tp); { _loop114: do { if ((LA(1)==COMMA)) { match(COMMA); tp=tuplePart(); tpList.add(tp); } else { break _loop114; } } while (true); } match(RPAREN); n = new ASTTupleType(tpList); } catch (RecognitionException ex) { reportError(ex); consume(); consumeUntil(_tokenSet_17); } return n; } public final ASTTuplePart tuplePart() throws RecognitionException, TokenStreamException { ASTTuplePart n; Token name = null; ASTType t; n = null; try { // for error handling name = LT(1); match(IDENT); match(COLON); t=type(); n = new ASTTuplePart((MyToken) name, t); } catch (RecognitionException ex) { reportError(ex); consume(); consumeUntil(_tokenSet_18); } return n; } public static final String[] _tokenNames = { "<0>", "EOF", "<2>", "NULL_TREE_LOOKAHEAD", "'('", "','", "')'", "an identifier", "':'", "\"let\"", "'='", "\"in\"", "\"implies\"", "\"or\"", "\"xor\"", "\"and\"", "'<>'", "'<'", "'>'", "'<='", "'>='", "'+'", "'-'", "'*'", "'/'", "\"div\"", "\"not\"", "'->'", "'.'", "\"allInstances\"", "'|'", "\"iterate\"", "';'", "'['", "']'", "'@'", "\"pre\"", "\"oclAsType\"", "\"oclIsKindOf\"", "\"oclIsTypeOf\"", "\"if\"", "\"then\"", "\"else\"", "\"endif\"", "\"true\"", "\"false\"", "INT", "REAL", "STRING", "'#'", "\"Set\"", "\"Sequence\"", "\"Bag\"", "'{'", "'}'", "'..'", "\"oclEmpty\"", "\"oclUndefined\"", "\"Tuple\"", "\"Collection\"", "\"create\"", "\"assign\"", "':='", "\"between\"", "\"destroy\"", "\"insert\"", "\"into\"", "\"delete\"", "\"from\"", "\"set\"", "\"openter\"", "\"opexit\"" }; private static final long[] mk_tokenSet_0() { long[] data = { 3458764513820541440L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); private static final long[] mk_tokenSet_1() { long[] data = { 2L, 0L}; return data; } public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); private static final long[] mk_tokenSet_2() { long[] data = { 3458764513820541442L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); private static final long[] mk_tokenSet_3() { long[] data = { 3458764518115509026L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); private static final long[] mk_tokenSet_4() { long[] data = { 3458764518115508738L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); private static final long[] mk_tokenSet_5() { long[] data = { 513394829139378832L, 0L}; return data; } public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5()); private static final long[] mk_tokenSet_6() { long[] data = { 3981166589922768530L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6()); private static final long[] mk_tokenSet_7() { long[] data = { 4557629610505795538L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7()); private static final long[] mk_tokenSet_8() { long[] data = { 9223358842715240434L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8()); private static final long[] mk_tokenSet_9() { long[] data = { 9223363240761753586L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9()); private static final long[] mk_tokenSet_10() { long[] data = { 3972159347254887058L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10()); private static final long[] mk_tokenSet_11() { long[] data = { 8592852608350156722L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11()); private static final long[] mk_tokenSet_12() { long[] data = { 9169315628933183474L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12()); private static final long[] mk_tokenSet_13() { long[] data = { -13194139535374L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13()); private static final long[] mk_tokenSet_14() { long[] data = { 4611686023796097344L, 0L}; return data; } public static final BitSet _tokenSet_14 = new BitSet(mk_tokenSet_14()); private static final long[] mk_tokenSet_15() { long[] data = { 3458764519189251682L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_15 = new BitSet(mk_tokenSet_15()); private static final long[] mk_tokenSet_16() { long[] data = { 8124509126307875554L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_16 = new BitSet(mk_tokenSet_16()); private static final long[] mk_tokenSet_17() { long[] data = { 5368710240L, 0L}; return data; } public static final BitSet _tokenSet_17 = new BitSet(mk_tokenSet_17()); private static final long[] mk_tokenSet_18() { long[] data = { 96L, 0L}; return data; } public static final BitSet _tokenSet_18 = new BitSet(mk_tokenSet_18()); private static final long[] mk_tokenSet_19() { long[] data = { 8124509126307879650L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_19 = new BitSet(mk_tokenSet_19()); private static final long[] mk_tokenSet_20() { long[] data = { 8124509126307887842L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_20 = new BitSet(mk_tokenSet_20()); private static final long[] mk_tokenSet_21() { long[] data = { 8124509126307904226L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_21 = new BitSet(mk_tokenSet_21()); private static final long[] mk_tokenSet_22() { long[] data = { 8124509126307936994L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_22 = new BitSet(mk_tokenSet_22()); private static final long[] mk_tokenSet_23() { long[] data = { 8124509126308003554L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_23 = new BitSet(mk_tokenSet_23()); private static final long[] mk_tokenSet_24() { long[] data = { 8124509126309969634L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_24 = new BitSet(mk_tokenSet_24()); private static final long[] mk_tokenSet_25() { long[] data = { 8124509126316261090L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_25 = new BitSet(mk_tokenSet_25()); private static final long[] mk_tokenSet_26() { long[] data = { 8124509126374981346L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_26 = new BitSet(mk_tokenSet_26()); private static final long[] mk_tokenSet_27() { long[] data = { 964220158080L, 0L}; return data; } public static final BitSet _tokenSet_27 = new BitSet(mk_tokenSet_27()); private static final long[] mk_tokenSet_28() { long[] data = { 8124509169727307506L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_28 = new BitSet(mk_tokenSet_28()); private static final long[] mk_tokenSet_29() { long[] data = { 9214364776933621490L, 255L, 0L, 0L}; return data; } public static final BitSet _tokenSet_29 = new BitSet(mk_tokenSet_29()); private static final long[] mk_tokenSet_30() { long[] data = { 8124509126777634530L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_30 = new BitSet(mk_tokenSet_30()); private static final long[] mk_tokenSet_31() { long[] data = { 522402072881002480L, 0L}; return data; } public static final BitSet _tokenSet_31 = new BitSet(mk_tokenSet_31()); private static final long[] mk_tokenSet_32() { long[] data = { 9223372019674906610L, 235L, 0L, 0L}; return data; } public static final BitSet _tokenSet_32 = new BitSet(mk_tokenSet_32()); private static final long[] mk_tokenSet_33() { long[] data = { 8637904024630198002L, 255L, 0L, 0L}; return data; } public static final BitSet _tokenSet_33 = new BitSet(mk_tokenSet_33()); private static final long[] mk_tokenSet_34() { long[] data = { 8646911215295004658L, 255L, 0L, 0L}; return data; } public static final BitSet _tokenSet_34 = new BitSet(mk_tokenSet_34()); private static final long[] mk_tokenSet_35() { long[] data = { 9223372019674906610L, 255L, 0L, 0L}; return data; } public static final BitSet _tokenSet_35 = new BitSet(mk_tokenSet_35()); private static final long[] mk_tokenSet_36() { long[] data = { 522402071807260368L, 0L}; return data; } public static final BitSet _tokenSet_36 = new BitSet(mk_tokenSet_36()); private static final long[] mk_tokenSet_37() { long[] data = { 5368709120L, 0L}; return data; } public static final BitSet _tokenSet_37 = new BitSet(mk_tokenSet_37()); private static final long[] mk_tokenSet_38() { long[] data = { 1073741824L, 0L}; return data; } public static final BitSet _tokenSet_38 = new BitSet(mk_tokenSet_38()); private static final long[] mk_tokenSet_39() { long[] data = { 18014398509482016L, 0L}; return data; } public static final BitSet _tokenSet_39 = new BitSet(mk_tokenSet_39()); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -