From: Hannu Niemistö Date: Fri, 15 Jun 2018 13:11:42 +0000 (+0300) Subject: Restricted version of imported ANTLR packages, compile with 3.5.2 X-Git-Tag: v1.43.0~136^2~465 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F49%2F1849%2F2;p=simantics%2Fplatform.git Restricted version of imported ANTLR packages, compile with 3.5.2 gitlab #24 Change-Id: Ie5bace3044f290d400a17c2bbe97774429c86ba8 --- diff --git a/bundles/org.simantics.graph.compiler/GenerateParser.xml b/bundles/org.simantics.graph.compiler/GenerateParser.xml new file mode 100644 index 000000000..c80b4c2e1 --- /dev/null +++ b/bundles/org.simantics.graph.compiler/GenerateParser.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/bundles/org.simantics.graph.compiler/META-INF/MANIFEST.MF b/bundles/org.simantics.graph.compiler/META-INF/MANIFEST.MF index d64d3d564..9e5345c87 100644 --- a/bundles/org.simantics.graph.compiler/META-INF/MANIFEST.MF +++ b/bundles/org.simantics.graph.compiler/META-INF/MANIFEST.MF @@ -2,11 +2,15 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Compiler Bundle-SymbolicName: org.simantics.graph.compiler;singleton:=true -Bundle-Version: 1.1.15.qualifier +Bundle-Version: 1.1.16.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.simantics.graph;bundle-version="1.0.0";visibility:=reexport, - org.simantics.ltk.antlr;bundle-version="1.0.0", + org.simantics.ltk.antlr;bundle-version="1.1.12", org.simantics.databoard;bundle-version="0.5.3", freemarker;bundle-version="2.3.16", org.junit;bundle-version="4.12.0";resolution:=optional Export-Package: org.simantics.graph.compiler +Import-Package: org.antlr.runtime;bundle-version="[3.5.2,4.0.0)", + org.antlr.runtime.debug;bundle-version="[3.5.2,4.0.0)", + org.antlr.runtime.misc;bundle-version="[3.5.2,4.0.0)", + org.antlr.runtime.tree;bundle-version="[3.5.2,4.0.0)" diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/Graph.tokens b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/Graph.tokens index 778fc9748..0a82788c1 100644 --- a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/Graph.tokens +++ b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/Graph.tokens @@ -14,80 +14,80 @@ T__77=77 T__78=78 T__79=79 T__80=80 -INDENT=4 -DEDENT=5 -FILE=6 -RESOURCE=7 -PROPERTY=8 -VARIABLE=9 -EMBEDDED_VALUE=10 +ARRAY=4 +ARRAY_TYPE=5 +ASSIGNMENT=6 +BLANK=7 +COMMENT=8 +DEDENT=9 +DOMAIN_OF=10 EMBEDDED_TYPE=11 -TEMPLATE_INSTANCE=12 -TEMPLATE_DEFINITION=13 -BLANK=14 -REF=15 -EQUALS=16 -INSTANCE_OF=17 -INHERITS=18 -SUBRELATION_OF=19 -HAS_DOMAIN=20 -HAS_RANGE=21 -DOMAIN_OF=22 -REQUIRES_VALUE_TYPE=23 -TYPE_DEFINITIONS=24 -TYPE_DEFINITION=25 -UNION_TYPE=26 -RECORD_TYPE=27 -TUPLE_TYPE=28 -ARRAY_TYPE=29 -TYPE_REFERENCE=30 -TYPE_ANNOTATION=31 -TYPE_COMPONENT=32 -VALUE_DEFINITIONS=33 -VALUE_DEFINITION=34 -NO_VALUE=35 -VARIANT=36 -ARRAY=37 -TUPLE=38 -TAGGED_VALUE=39 -RECORD=40 -MAP=41 -ASSIGNMENT=42 -TRUE=43 -FALSE=44 -ID=45 -COMMENT=46 -WS=47 -LPAREN=48 -RPAREN=49 -LBRACKET=50 -RBRACKET=51 -LCURLY=52 -RCURLY=53 -INT=54 -INT_RANGE=55 -FLOAT=56 -RANGE=57 -NEWLINE=58 -EXPONENT=59 -ESC_SEQ=60 -STRING=61 -URI=62 -HEX_DIGIT=63 -UNICODE_ESC=64 -'@'=65 -'.'=66 -''=70 -'==>'=71 -'>--'=72 -':'=73 +EMBEDDED_VALUE=12 +EQUALS=13 +ESC_SEQ=14 +EXPONENT=15 +FALSE=16 +FILE=17 +FLOAT=18 +HAS_DOMAIN=19 +HAS_RANGE=20 +HEX_DIGIT=21 +ID=22 +INDENT=23 +INHERITS=24 +INSTANCE_OF=25 +INT=26 +INT_RANGE=27 +LBRACKET=28 +LCURLY=29 +LPAREN=30 +MAP=31 +NEWLINE=32 +NO_VALUE=33 +PROPERTY=34 +RANGE=35 +RBRACKET=36 +RCURLY=37 +RECORD=38 +RECORD_TYPE=39 +REF=40 +REQUIRES_VALUE_TYPE=41 +RESOURCE=42 +RPAREN=43 +STRING=44 +SUBRELATION_OF=45 +TAGGED_VALUE=46 +TEMPLATE_DEFINITION=47 +TEMPLATE_INSTANCE=48 +TRUE=49 +TUPLE=50 +TUPLE_TYPE=51 +TYPE_ANNOTATION=52 +TYPE_COMPONENT=53 +TYPE_DEFINITION=54 +TYPE_DEFINITIONS=55 +TYPE_REFERENCE=56 +UNICODE_ESC=57 +UNION_TYPE=58 +URI=59 +VALUE_DEFINITION=60 +VALUE_DEFINITIONS=61 +VARIABLE=62 +VARIANT=63 +WS=64 +'$'=65 +'%'=66 +','=67 +'-->'=68 +'.'=69 +':'=70 +'<--'=71 +''=75 +'>--'=76 +'@'=77 +'false'=78 'true'=79 -'false'=80 +'|'=80 diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/GraphLexer.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/GraphLexer.java index 565ba3237..60cf59001 100644 --- a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/GraphLexer.java +++ b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/GraphLexer.java @@ -1,4 +1,4 @@ -// $ANTLR 3.3 Nov 30, 2010 12:50:56 src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g 2011-12-19 14:53:14 +// $ANTLR 3.5.2 src/org/simantics/graph/compiler/internal/parsing/Graph.g 2018-06-15 14:02:54 package org.simantics.graph.compiler.internal.parsing; import gnu.trove.list.array.*; @@ -9,2466 +9,2443 @@ import java.util.Stack; import java.util.List; import java.util.ArrayList; -@SuppressWarnings({"unused", "unchecked", "rawtypes"}) +@SuppressWarnings("all") public class GraphLexer extends Lexer { - public static final int EOF=-1; - public static final int T__65=65; - public static final int T__66=66; - public static final int T__67=67; - public static final int T__68=68; - public static final int T__69=69; - public static final int T__70=70; - public static final int T__71=71; - public static final int T__72=72; - public static final int T__73=73; - public static final int T__74=74; - public static final int T__75=75; - public static final int T__76=76; - public static final int T__77=77; - public static final int T__78=78; - public static final int T__79=79; - public static final int T__80=80; - public static final int INDENT=4; - public static final int DEDENT=5; - public static final int FILE=6; - public static final int RESOURCE=7; - public static final int PROPERTY=8; - public static final int VARIABLE=9; - public static final int EMBEDDED_VALUE=10; - public static final int EMBEDDED_TYPE=11; - public static final int TEMPLATE_INSTANCE=12; - public static final int TEMPLATE_DEFINITION=13; - public static final int BLANK=14; - public static final int REF=15; - public static final int EQUALS=16; - public static final int INSTANCE_OF=17; - public static final int INHERITS=18; - public static final int SUBRELATION_OF=19; - public static final int HAS_DOMAIN=20; - public static final int HAS_RANGE=21; - public static final int DOMAIN_OF=22; - public static final int REQUIRES_VALUE_TYPE=23; - public static final int TYPE_DEFINITIONS=24; - public static final int TYPE_DEFINITION=25; - public static final int UNION_TYPE=26; - public static final int RECORD_TYPE=27; - public static final int TUPLE_TYPE=28; - public static final int ARRAY_TYPE=29; - public static final int TYPE_REFERENCE=30; - public static final int TYPE_ANNOTATION=31; - public static final int TYPE_COMPONENT=32; - public static final int VALUE_DEFINITIONS=33; - public static final int VALUE_DEFINITION=34; - public static final int NO_VALUE=35; - public static final int VARIANT=36; - public static final int ARRAY=37; - public static final int TUPLE=38; - public static final int TAGGED_VALUE=39; - public static final int RECORD=40; - public static final int MAP=41; - public static final int ASSIGNMENT=42; - public static final int TRUE=43; - public static final int FALSE=44; - public static final int ID=45; - public static final int COMMENT=46; - public static final int WS=47; - public static final int LPAREN=48; - public static final int RPAREN=49; - public static final int LBRACKET=50; - public static final int RBRACKET=51; - public static final int LCURLY=52; - public static final int RCURLY=53; - public static final int INT=54; - public static final int INT_RANGE=55; - public static final int FLOAT=56; - public static final int RANGE=57; - public static final int NEWLINE=58; - public static final int EXPONENT=59; - public static final int ESC_SEQ=60; - public static final int STRING=61; - public static final int URI=62; - public static final int HEX_DIGIT=63; - public static final int UNICODE_ESC=64; - - int inParen = 0; - - TIntArrayList iStack = new TIntArrayList(); - { iStack.add(0); } - - List tokens = new ArrayList(); - public void emit(Token token) { - state.token = token; - tokens.add(token); - } - public Token nextToken() { - if(tokens.isEmpty()) { - super.nextToken(); - if ( tokens.isEmpty() ) { - /* When end-of-file is encountered, we - emit balancing number of DEDENT tokens. - */ - if(iStack.size() <= 1) - return getEOFToken(); - else { - while(iStack.size() > 1) { - iStack.removeAt(iStack.size()-1); - state.type = DEDENT; - emit(); - } - iStack.clear(); - } - } - } - return (Token)tokens.remove(0); - } - - - - // delegates - // delegators - - public GraphLexer() {;} - public GraphLexer(CharStream input) { - this(input, new RecognizerSharedState()); - } - public GraphLexer(CharStream input, RecognizerSharedState state) { - super(input,state); - - } - public String getGrammarFileName() { return "src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g"; } - - // $ANTLR start "T__65" - public final void mT__65() throws RecognitionException { - try { - int _type = T__65; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:46:7: ( '@' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:46:9: '@' - { - match('@'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__65" - - // $ANTLR start "T__66" - public final void mT__66() throws RecognitionException { - try { - int _type = T__66; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:47:7: ( '.' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:47:9: '.' - { - match('.'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__66" - - // $ANTLR start "T__67" - public final void mT__67() throws RecognitionException { - try { - int _type = T__67; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:48:7: ( '' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:51:9: '-->' - { - match("-->"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__70" - - // $ANTLR start "T__71" - public final void mT__71() throws RecognitionException { - try { - int _type = T__71; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:52:7: ( '==>' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:52:9: '==>' - { - match("==>"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__71" - - // $ANTLR start "T__72" - public final void mT__72() throws RecognitionException { - try { - int _type = T__72; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:53:7: ( '>--' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:53:9: '>--' - { - match(">--"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__72" - - // $ANTLR start "T__73" - public final void mT__73() throws RecognitionException { - try { - int _type = T__73; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:54:7: ( ':' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:54:9: ':' - { - match(':'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__73" - - // $ANTLR start "T__74" - public final void mT__74() throws RecognitionException { - try { - int _type = T__74; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:55:7: ( '=' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:55:9: '=' - { - match('='); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__74" - - // $ANTLR start "T__75" - public final void mT__75() throws RecognitionException { - try { - int _type = T__75; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:56:7: ( '%' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:56:9: '%' - { - match('%'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__75" - - // $ANTLR start "T__76" - public final void mT__76() throws RecognitionException { - try { - int _type = T__76; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:57:7: ( '$' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:57:9: '$' - { - match('$'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__76" - - // $ANTLR start "T__77" - public final void mT__77() throws RecognitionException { - try { - int _type = T__77; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:58:7: ( '|' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:58:9: '|' - { - match('|'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__77" - - // $ANTLR start "T__78" - public final void mT__78() throws RecognitionException { - try { - int _type = T__78; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:59:7: ( ',' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:59:9: ',' - { - match(','); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__78" - - // $ANTLR start "T__79" - public final void mT__79() throws RecognitionException { - try { - int _type = T__79; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:60:7: ( 'true' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:60:9: 'true' - { - match("true"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__79" - - // $ANTLR start "T__80" - public final void mT__80() throws RecognitionException { - try { - int _type = T__80; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:61:7: ( 'false' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:61:9: 'false' - { - match("false"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__80" - - // $ANTLR start "ID" - public final void mID() throws RecognitionException { - try { - int _type = ID; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:108:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:108:7: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* - { - if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:108:31: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* - loop1: - do { - int alt1=2; - int LA1_0 = input.LA(1); - - if ( ((LA1_0>='0' && LA1_0<='9')||(LA1_0>='A' && LA1_0<='Z')||LA1_0=='_'||(LA1_0>='a' && LA1_0<='z')) ) { - alt1=1; - } - - - switch (alt1) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g: - { - if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop1; - } - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "ID" - - // $ANTLR start "COMMENT" - public final void mCOMMENT() throws RecognitionException { - try { - int _type = COMMENT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:112:5: ( '//' (~ ( '\\n' ) )* | '/*' ( options {greedy=false; } : . )* '*/' ) - int alt4=2; - int LA4_0 = input.LA(1); - - if ( (LA4_0=='/') ) { - int LA4_1 = input.LA(2); - - if ( (LA4_1=='/') ) { - alt4=1; - } - else if ( (LA4_1=='*') ) { - alt4=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 4, 1, input); - - throw nvae; - } - } - else { - NoViableAltException nvae = - new NoViableAltException("", 4, 0, input); - - throw nvae; - } - switch (alt4) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:112:9: '//' (~ ( '\\n' ) )* - { - match("//"); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:112:14: (~ ( '\\n' ) )* - loop2: - do { - int alt2=2; - int LA2_0 = input.LA(1); - - if ( ((LA2_0>='\u0000' && LA2_0<='\t')||(LA2_0>='\u000B' && LA2_0<='\uFFFF')) ) { - alt2=1; - } - - - switch (alt2) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:112:14: ~ ( '\\n' ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop2; - } - } while (true); - - _channel=HIDDEN; - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:113:9: '/*' ( options {greedy=false; } : . )* '*/' - { - match("/*"); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:113:14: ( options {greedy=false; } : . )* - loop3: - do { - int alt3=2; - int LA3_0 = input.LA(1); - - if ( (LA3_0=='*') ) { - int LA3_1 = input.LA(2); - - if ( (LA3_1=='/') ) { - alt3=2; - } - else if ( ((LA3_1>='\u0000' && LA3_1<='.')||(LA3_1>='0' && LA3_1<='\uFFFF')) ) { - alt3=1; - } - - - } - else if ( ((LA3_0>='\u0000' && LA3_0<=')')||(LA3_0>='+' && LA3_0<='\uFFFF')) ) { - alt3=1; - } - - - switch (alt3) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:113:42: . - { - matchAny(); - - } - break; - - default : - break loop3; - } - } while (true); - - match("*/"); - - _channel=HIDDEN; - - } - break; - - } - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "COMMENT" - - // $ANTLR start "WS" - public final void mWS() throws RecognitionException { - try { - int _type = WS; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:116:5: ( ( ' ' | '\\t' | '\\r' ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:116:7: ( ' ' | '\\t' | '\\r' ) - { - if ( input.LA(1)=='\t'||input.LA(1)=='\r'||input.LA(1)==' ' ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - _channel=HIDDEN; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "WS" - - // $ANTLR start "LPAREN" - public final void mLPAREN() throws RecognitionException { - try { - int _type = LPAREN; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:122:11: ( '(' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:122:13: '(' - { - match('('); - ++ inParen; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "LPAREN" - - // $ANTLR start "RPAREN" - public final void mRPAREN() throws RecognitionException { - try { - int _type = RPAREN; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:123:11: ( ')' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:123:13: ')' - { - match(')'); - -- inParen; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RPAREN" - - // $ANTLR start "LBRACKET" - public final void mLBRACKET() throws RecognitionException { - try { - int _type = LBRACKET; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:124:11: ( '[' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:124:13: '[' - { - match('['); - ++ inParen; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "LBRACKET" - - // $ANTLR start "RBRACKET" - public final void mRBRACKET() throws RecognitionException { - try { - int _type = RBRACKET; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:125:11: ( ']' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:125:13: ']' - { - match(']'); - -- inParen; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RBRACKET" - - // $ANTLR start "LCURLY" - public final void mLCURLY() throws RecognitionException { - try { - int _type = LCURLY; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:126:11: ( '{' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:126:13: '{' - { - match('{'); - ++ inParen; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "LCURLY" - - // $ANTLR start "RCURLY" - public final void mRCURLY() throws RecognitionException { - try { - int _type = RCURLY; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:127:11: ( '}' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:127:13: '}' - { - match('}'); - -- inParen; - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RCURLY" - - // $ANTLR start "INT_RANGE" - public final void mINT_RANGE() throws RecognitionException { - try { - int _type = INT_RANGE; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:129:11: ( INT '..' ( INT )? | '..' INT ) - int alt6=2; - int LA6_0 = input.LA(1); - - if ( (LA6_0=='-'||(LA6_0>='0' && LA6_0<='9')) ) { - alt6=1; - } - else if ( (LA6_0=='.') ) { - alt6=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 6, 0, input); - - throw nvae; - } - switch (alt6) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:129:13: INT '..' ( INT )? - { - mINT(); - match(".."); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:129:22: ( INT )? - int alt5=2; - int LA5_0 = input.LA(1); - - if ( (LA5_0=='-'||(LA5_0>='0' && LA5_0<='9')) ) { - alt5=1; - } - switch (alt5) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:129:22: INT - { - mINT(); - - } - break; - - } - - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:130:13: '..' INT - { - match(".."); - - mINT(); - - } - break; - - } - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "INT_RANGE" - - // $ANTLR start "RANGE" - public final void mRANGE() throws RecognitionException { - try { - int _type = RANGE; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:132:11: ( FLOAT '..' ( FLOAT | INT )? | '..' FLOAT | INT '..' FLOAT ) - int alt8=3; - alt8 = dfa8.predict(input); - switch (alt8) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:132:13: FLOAT '..' ( FLOAT | INT )? - { - mFLOAT(); - match(".."); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:132:24: ( FLOAT | INT )? - int alt7=3; - alt7 = dfa7.predict(input); - switch (alt7) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:132:25: FLOAT - { - mFLOAT(); - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:132:33: INT - { - mINT(); - - } - break; - - } - - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:133:13: '..' FLOAT - { - match(".."); - - mFLOAT(); - - } - break; - case 3 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:134:13: INT '..' FLOAT - { - mINT(); - match(".."); - - mFLOAT(); - - } - break; - - } - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RANGE" - - // $ANTLR start "NEWLINE" - public final void mNEWLINE() throws RecognitionException { - try { - int _type = NEWLINE; - int _channel = DEFAULT_TOKEN_CHANNEL; - int spaces = 0; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:139:5: ( '\\n' ( ' ' | '//' (~ ( '\\n' ) )* '\\n' | '/*' ( options {greedy=false; } : . )* '*/' | '\\r' | '\\n' )* ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:139:7: '\\n' ( ' ' | '//' (~ ( '\\n' ) )* '\\n' | '/*' ( options {greedy=false; } : . )* '*/' | '\\r' | '\\n' )* - { - match('\n'); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:140:7: ( ' ' | '//' (~ ( '\\n' ) )* '\\n' | '/*' ( options {greedy=false; } : . )* '*/' | '\\r' | '\\n' )* - loop11: - do { - int alt11=6; - switch ( input.LA(1) ) { - case ' ': - { - alt11=1; - } - break; - case '/': - { - int LA11_3 = input.LA(2); - - if ( (LA11_3=='/') ) { - alt11=2; - } - else if ( (LA11_3=='*') ) { - alt11=3; - } - - - } - break; - case '\r': - { - alt11=4; - } - break; - case '\n': - { - alt11=5; - } - break; - - } - - switch (alt11) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:140:9: ' ' - { - match(' '); - ++spaces; - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:141:9: '//' (~ ( '\\n' ) )* '\\n' - { - match("//"); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:141:14: (~ ( '\\n' ) )* - loop9: - do { - int alt9=2; - int LA9_0 = input.LA(1); - - if ( ((LA9_0>='\u0000' && LA9_0<='\t')||(LA9_0>='\u000B' && LA9_0<='\uFFFF')) ) { - alt9=1; - } - - - switch (alt9) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:141:14: ~ ( '\\n' ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop9; - } - } while (true); - - match('\n'); - spaces = 0; - - } - break; - case 3 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:142:9: '/*' ( options {greedy=false; } : . )* '*/' - { - match("/*"); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:142:14: ( options {greedy=false; } : . )* - loop10: - do { - int alt10=2; - int LA10_0 = input.LA(1); - - if ( (LA10_0=='*') ) { - int LA10_1 = input.LA(2); - - if ( (LA10_1=='/') ) { - alt10=2; - } - else if ( ((LA10_1>='\u0000' && LA10_1<='.')||(LA10_1>='0' && LA10_1<='\uFFFF')) ) { - alt10=1; - } - - - } - else if ( ((LA10_0>='\u0000' && LA10_0<=')')||(LA10_0>='+' && LA10_0<='\uFFFF')) ) { - alt10=1; - } - - - switch (alt10) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:142:42: . - { - matchAny(); - - } - break; - - default : - break loop10; - } - } while (true); - - match("*/"); - - - } - break; - case 4 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:143:9: '\\r' - { - match('\r'); - - } - break; - case 5 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:144:9: '\\n' - { - match('\n'); - spaces = 0; - - } - break; - - default : - break loop11; - } - } while (true); - - - int c = input.LA(1); - - if(inParen > 0) { - _channel = HIDDEN; - } - else if(c == EOF) { - while(iStack.size() > 1) { - iStack.removeAt(iStack.size()-1); - state.type = DEDENT; - emit(); - } - _channel = HIDDEN; - iStack.clear(); - } - else { - int stackTop = iStack.get(iStack.size()-1); - if(spaces > stackTop) { - iStack.add(spaces); - _type = INDENT; - } - else if(spaces < stackTop) { - while(spaces < iStack.get(iStack.size()-1)) { - iStack.removeAt(iStack.size()-1); - state.type = DEDENT; - emit(); - } - state.type = NEWLINE; - emit(); - // TODO check that spaces == iStack.get(iStack.size()-1) - } - } - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "NEWLINE" - - // $ANTLR start "INDENT" - public final void mINDENT() throws RecognitionException { - try { - int _type = INDENT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:181:7: ({...}? => 'INDENT' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:181:9: {...}? => 'INDENT' - { - if ( !(( false )) ) { - throw new FailedPredicateException(input, "INDENT", " false "); - } - match("INDENT"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "INDENT" - - // $ANTLR start "DEDENT" - public final void mDEDENT() throws RecognitionException { - try { - int _type = DEDENT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:182:7: ({...}? => 'DEDENT' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:182:9: {...}? => 'DEDENT' - { - if ( !(( false )) ) { - throw new FailedPredicateException(input, "DEDENT", " false "); - } - match("DEDENT"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "DEDENT" - - // $ANTLR start "INT" - public final void mINT() throws RecognitionException { - try { - int _type = INT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:184:5: ( ( '-' )? ( '0' .. '9' )+ ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:184:7: ( '-' )? ( '0' .. '9' )+ - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:184:7: ( '-' )? - int alt12=2; - int LA12_0 = input.LA(1); - - if ( (LA12_0=='-') ) { - alt12=1; - } - switch (alt12) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:184:7: '-' - { - match('-'); - - } - break; - - } - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:184:12: ( '0' .. '9' )+ - int cnt13=0; - loop13: - do { - int alt13=2; - int LA13_0 = input.LA(1); - - if ( ((LA13_0>='0' && LA13_0<='9')) ) { - alt13=1; - } - - - switch (alt13) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:184:12: '0' .. '9' - { - matchRange('0','9'); - - } - break; - - default : - if ( cnt13 >= 1 ) break loop13; - EarlyExitException eee = - new EarlyExitException(13, input); - throw eee; - } - cnt13++; - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "INT" - - // $ANTLR start "FLOAT" - public final void mFLOAT() throws RecognitionException { - try { - int _type = FLOAT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:188:5: ( ( '-' )? ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:188:7: ( '-' )? ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:188:7: ( '-' )? - int alt14=2; - int LA14_0 = input.LA(1); - - if ( (LA14_0=='-') ) { - alt14=1; - } - switch (alt14) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:188:7: '-' - { - match('-'); - - } - break; - - } - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:189:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT ) - int alt19=2; - alt19 = dfa19.predict(input); - switch (alt19) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:189:7: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:189:7: ( '0' .. '9' )+ - int cnt15=0; - loop15: - do { - int alt15=2; - int LA15_0 = input.LA(1); - - if ( ((LA15_0>='0' && LA15_0<='9')) ) { - alt15=1; - } - - - switch (alt15) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:189:8: '0' .. '9' - { - matchRange('0','9'); - - } - break; - - default : - if ( cnt15 >= 1 ) break loop15; - EarlyExitException eee = - new EarlyExitException(15, input); - throw eee; - } - cnt15++; - } while (true); - - match('.'); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:189:23: ( '0' .. '9' )* - loop16: - do { - int alt16=2; - int LA16_0 = input.LA(1); - - if ( ((LA16_0>='0' && LA16_0<='9')) ) { - alt16=1; - } - - - switch (alt16) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:189:24: '0' .. '9' - { - matchRange('0','9'); - - } - break; - - default : - break loop16; - } - } while (true); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:189:35: ( EXPONENT )? - int alt17=2; - int LA17_0 = input.LA(1); - - if ( (LA17_0=='E'||LA17_0=='e') ) { - alt17=1; - } - switch (alt17) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:189:35: EXPONENT - { - mEXPONENT(); - - } - break; - - } - - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:190:7: ( '0' .. '9' )+ EXPONENT - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:190:7: ( '0' .. '9' )+ - int cnt18=0; - loop18: - do { - int alt18=2; - int LA18_0 = input.LA(1); - - if ( ((LA18_0>='0' && LA18_0<='9')) ) { - alt18=1; - } - - - switch (alt18) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:190:8: '0' .. '9' - { - matchRange('0','9'); - - } - break; - - default : - if ( cnt18 >= 1 ) break loop18; - EarlyExitException eee = - new EarlyExitException(18, input); - throw eee; - } - cnt18++; - } while (true); - - mEXPONENT(); - - } - break; - - } - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "FLOAT" - - // $ANTLR start "STRING" - public final void mSTRING() throws RecognitionException { - try { - int _type = STRING; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:195:5: ( '\"' ( ESC_SEQ | ~ ( '\\\\' | '\"' ) )* '\"' | '\"\"\"' (~ ( '\"' ) | '\"' ~ ( '\"' ) | '\"\"' ~ ( '\"' ) )* '\"\"\"' ) - int alt22=2; - int LA22_0 = input.LA(1); - - if ( (LA22_0=='\"') ) { - int LA22_1 = input.LA(2); - - if ( (LA22_1=='\"') ) { - int LA22_2 = input.LA(3); - - if ( (LA22_2=='\"') ) { - alt22=2; - } - else { - alt22=1;} - } - else if ( ((LA22_1>='\u0000' && LA22_1<='!')||(LA22_1>='#' && LA22_1<='\uFFFF')) ) { - alt22=1; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 22, 1, input); - - throw nvae; - } - } - else { - NoViableAltException nvae = - new NoViableAltException("", 22, 0, input); - - throw nvae; - } - switch (alt22) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:195:8: '\"' ( ESC_SEQ | ~ ( '\\\\' | '\"' ) )* '\"' - { - match('\"'); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:195:12: ( ESC_SEQ | ~ ( '\\\\' | '\"' ) )* - loop20: - do { - int alt20=3; - int LA20_0 = input.LA(1); - - if ( (LA20_0=='\\') ) { - alt20=1; - } - else if ( ((LA20_0>='\u0000' && LA20_0<='!')||(LA20_0>='#' && LA20_0<='[')||(LA20_0>=']' && LA20_0<='\uFFFF')) ) { - alt20=2; - } - - - switch (alt20) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:195:14: ESC_SEQ - { - mESC_SEQ(); - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:195:24: ~ ( '\\\\' | '\"' ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop20; - } - } while (true); - - match('\"'); - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:196:8: '\"\"\"' (~ ( '\"' ) | '\"' ~ ( '\"' ) | '\"\"' ~ ( '\"' ) )* '\"\"\"' - { - match("\"\"\""); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:196:14: (~ ( '\"' ) | '\"' ~ ( '\"' ) | '\"\"' ~ ( '\"' ) )* - loop21: - do { - int alt21=4; - int LA21_0 = input.LA(1); - - if ( (LA21_0=='\"') ) { - int LA21_1 = input.LA(2); - - if ( (LA21_1=='\"') ) { - int LA21_3 = input.LA(3); - - if ( ((LA21_3>='\u0000' && LA21_3<='!')||(LA21_3>='#' && LA21_3<='\uFFFF')) ) { - alt21=3; - } - - - } - else if ( ((LA21_1>='\u0000' && LA21_1<='!')||(LA21_1>='#' && LA21_1<='\uFFFF')) ) { - alt21=2; - } - - - } - else if ( ((LA21_0>='\u0000' && LA21_0<='!')||(LA21_0>='#' && LA21_0<='\uFFFF')) ) { - alt21=1; - } - - - switch (alt21) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:196:16: ~ ( '\"' ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:196:25: '\"' ~ ( '\"' ) - { - match('\"'); - if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - case 3 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:196:38: '\"\"' ~ ( '\"' ) - { - match("\"\""); - - if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop21; - } - } while (true); - - match("\"\"\""); - - - } - break; - - } - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "STRING" - - // $ANTLR start "URI" - public final void mURI() throws RecognitionException { - try { - int _type = URI; - int _channel = DEFAULT_TOKEN_CHANNEL; - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:200:5: ( '' ) )* '>' ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:200:8: '' ) )* '>' - { - match("' ) )* - loop23: - do { - int alt23=2; - int LA23_0 = input.LA(1); - - if ( ((LA23_0>='\u0000' && LA23_0<='=')||(LA23_0>='?' && LA23_0<='\uFFFF')) ) { - alt23=1; - } - - - switch (alt23) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:200:19: ~ ( '>' ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='=')||(input.LA(1)>='?' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop23; - } - } while (true); - - match('>'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "URI" - - // $ANTLR start "EXPONENT" - public final void mEXPONENT() throws RecognitionException { - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:204:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:204:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ - { - if ( input.LA(1)=='E'||input.LA(1)=='e' ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:204:22: ( '+' | '-' )? - int alt24=2; - int LA24_0 = input.LA(1); - - if ( (LA24_0=='+'||LA24_0=='-') ) { - alt24=1; - } - switch (alt24) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g: - { - if ( input.LA(1)=='+'||input.LA(1)=='-' ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - } - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:204:33: ( '0' .. '9' )+ - int cnt25=0; - loop25: - do { - int alt25=2; - int LA25_0 = input.LA(1); - - if ( ((LA25_0>='0' && LA25_0<='9')) ) { - alt25=1; - } - - - switch (alt25) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:204:34: '0' .. '9' - { - matchRange('0','9'); - - } - break; - - default : - if ( cnt25 >= 1 ) break loop25; - EarlyExitException eee = - new EarlyExitException(25, input); - throw eee; - } - cnt25++; - } while (true); - - - } - - } - finally { - } - } - // $ANTLR end "EXPONENT" - - // $ANTLR start "HEX_DIGIT" - public final void mHEX_DIGIT() throws RecognitionException { - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:207:11: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:207:13: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) - { - if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='F')||(input.LA(1)>='a' && input.LA(1)<='f') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - - } - finally { - } - } - // $ANTLR end "HEX_DIGIT" - - // $ANTLR start "ESC_SEQ" - public final void mESC_SEQ() throws RecognitionException { - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:211:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UNICODE_ESC ) - int alt26=2; - int LA26_0 = input.LA(1); - - if ( (LA26_0=='\\') ) { - int LA26_1 = input.LA(2); - - if ( (LA26_1=='\"'||LA26_1=='\''||LA26_1=='\\'||LA26_1=='b'||LA26_1=='f'||LA26_1=='n'||LA26_1=='r'||LA26_1=='t') ) { - alt26=1; - } - else if ( (LA26_1=='u') ) { - alt26=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 26, 1, input); - - throw nvae; - } - } - else { - NoViableAltException nvae = - new NoViableAltException("", 26, 0, input); - - throw nvae; - } - switch (alt26) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:211:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) - { - match('\\'); - if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:212:9: UNICODE_ESC - { - mUNICODE_ESC(); - - } - break; - - } - } - finally { - } - } - // $ANTLR end "ESC_SEQ" - - // $ANTLR start "UNICODE_ESC" - public final void mUNICODE_ESC() throws RecognitionException { - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:217:5: ( '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:217:9: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT - { - match('\\'); - match('u'); - mHEX_DIGIT(); - mHEX_DIGIT(); - mHEX_DIGIT(); - mHEX_DIGIT(); - - } - - } - finally { - } - } - // $ANTLR end "UNICODE_ESC" - - public void mTokens() throws RecognitionException { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:8: ( T__65 | T__66 | T__67 | T__68 | T__69 | T__70 | T__71 | T__72 | T__73 | T__74 | T__75 | T__76 | T__77 | T__78 | T__79 | T__80 | ID | COMMENT | WS | LPAREN | RPAREN | LBRACKET | RBRACKET | LCURLY | RCURLY | INT_RANGE | RANGE | NEWLINE | INDENT | DEDENT | INT | FLOAT | STRING | URI ) - int alt27=34; - alt27 = dfa27.predict(input); - switch (alt27) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:10: T__65 - { - mT__65(); - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:16: T__66 - { - mT__66(); - - } - break; - case 3 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:22: T__67 - { - mT__67(); - - } - break; - case 4 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:28: T__68 - { - mT__68(); - - } - break; - case 5 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:34: T__69 - { - mT__69(); - - } - break; - case 6 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:40: T__70 - { - mT__70(); - - } - break; - case 7 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:46: T__71 - { - mT__71(); - - } - break; - case 8 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:52: T__72 - { - mT__72(); - - } - break; - case 9 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:58: T__73 - { - mT__73(); - - } - break; - case 10 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:64: T__74 - { - mT__74(); - - } - break; - case 11 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:70: T__75 - { - mT__75(); - - } - break; - case 12 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:76: T__76 - { - mT__76(); - - } - break; - case 13 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:82: T__77 - { - mT__77(); - - } - break; - case 14 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:88: T__78 - { - mT__78(); - - } - break; - case 15 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:94: T__79 - { - mT__79(); - - } - break; - case 16 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:100: T__80 - { - mT__80(); - - } - break; - case 17 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:106: ID - { - mID(); - - } - break; - case 18 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:109: COMMENT - { - mCOMMENT(); - - } - break; - case 19 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:117: WS - { - mWS(); - - } - break; - case 20 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:120: LPAREN - { - mLPAREN(); - - } - break; - case 21 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:127: RPAREN - { - mRPAREN(); - - } - break; - case 22 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:134: LBRACKET - { - mLBRACKET(); - - } - break; - case 23 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:143: RBRACKET - { - mRBRACKET(); - - } - break; - case 24 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:152: LCURLY - { - mLCURLY(); - - } - break; - case 25 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:159: RCURLY - { - mRCURLY(); - - } - break; - case 26 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:166: INT_RANGE - { - mINT_RANGE(); - - } - break; - case 27 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:176: RANGE - { - mRANGE(); - - } - break; - case 28 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:182: NEWLINE - { - mNEWLINE(); - - } - break; - case 29 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:190: INDENT - { - mINDENT(); - - } - break; - case 30 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:197: DEDENT - { - mDEDENT(); - - } - break; - case 31 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:204: INT - { - mINT(); - - } - break; - case 32 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:208: FLOAT - { - mFLOAT(); - - } - break; - case 33 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:214: STRING - { - mSTRING(); - - } - break; - case 34 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:1:221: URI - { - mURI(); - - } - break; - - } - - } - - - protected DFA8 dfa8 = new DFA8(this); - protected DFA7 dfa7 = new DFA7(this); - protected DFA19 dfa19 = new DFA19(this); - protected DFA27 dfa27 = new DFA27(this); - static final String DFA8_eotS = - "\10\uffff"; - static final String DFA8_eofS = - "\10\uffff"; - static final String DFA8_minS = - "\1\55\1\60\1\56\1\uffff\1\56\1\uffff\1\55\1\uffff"; - static final String DFA8_maxS = - "\2\71\1\145\1\uffff\1\145\1\uffff\1\71\1\uffff"; - static final String DFA8_acceptS = - "\3\uffff\1\2\1\uffff\1\1\1\uffff\1\3"; - static final String DFA8_specialS = - "\10\uffff}>"; - static final String[] DFA8_transitionS = { - "\1\1\1\3\1\uffff\12\2", - "\12\2", - "\1\4\1\uffff\12\2\13\uffff\1\5\37\uffff\1\5", - "", - "\1\6\1\uffff\12\5\13\uffff\1\5\37\uffff\1\5", - "", - "\1\7\1\5\1\uffff\12\7", - "" - }; - - static final short[] DFA8_eot = DFA.unpackEncodedString(DFA8_eotS); - static final short[] DFA8_eof = DFA.unpackEncodedString(DFA8_eofS); - static final char[] DFA8_min = DFA.unpackEncodedStringToUnsignedChars(DFA8_minS); - static final char[] DFA8_max = DFA.unpackEncodedStringToUnsignedChars(DFA8_maxS); - static final short[] DFA8_accept = DFA.unpackEncodedString(DFA8_acceptS); - static final short[] DFA8_special = DFA.unpackEncodedString(DFA8_specialS); - static final short[][] DFA8_transition; - - static { - int numStates = DFA8_transitionS.length; - DFA8_transition = new short[numStates][]; - for (int i=0; i"; - static final String[] DFA7_transitionS = { - "\1\1\2\uffff\12\2", - "\12\2", - "\1\4\1\uffff\12\2\13\uffff\1\4\37\uffff\1\4", - "", - "", - "" - }; - - static final short[] DFA7_eot = DFA.unpackEncodedString(DFA7_eotS); - static final short[] DFA7_eof = DFA.unpackEncodedString(DFA7_eofS); - static final char[] DFA7_min = DFA.unpackEncodedStringToUnsignedChars(DFA7_minS); - static final char[] DFA7_max = DFA.unpackEncodedStringToUnsignedChars(DFA7_maxS); - static final short[] DFA7_accept = DFA.unpackEncodedString(DFA7_acceptS); - static final short[] DFA7_special = DFA.unpackEncodedString(DFA7_specialS); - static final short[][] DFA7_transition; - - static { - int numStates = DFA7_transitionS.length; - DFA7_transition = new short[numStates][]; - for (int i=0; i"; - static final String[] DFA19_transitionS = { - "\12\1", - "\1\2\1\uffff\12\1\13\uffff\1\3\37\uffff\1\3", - "", - "" - }; - - static final short[] DFA19_eot = DFA.unpackEncodedString(DFA19_eotS); - static final short[] DFA19_eof = DFA.unpackEncodedString(DFA19_eofS); - static final char[] DFA19_min = DFA.unpackEncodedStringToUnsignedChars(DFA19_minS); - static final char[] DFA19_max = DFA.unpackEncodedStringToUnsignedChars(DFA19_maxS); - static final short[] DFA19_accept = DFA.unpackEncodedString(DFA19_acceptS); - static final short[] DFA19_special = DFA.unpackEncodedString(DFA19_specialS); - static final short[][] DFA19_transition; - - static { - int numStates = DFA19_transitionS.length; - DFA19_transition = new short[numStates][]; - for (int i=0; i"; - static final String[] DFA27_transitionS = { - "\1\20\1\30\2\uffff\1\20\22\uffff\1\20\1\uffff\1\33\1\uffff"+ - "\1\11\1\10\2\uffff\1\21\1\22\2\uffff\1\13\1\4\1\2\1\17\12\27"+ - "\1\7\1\uffff\1\3\1\5\1\6\1\uffff\1\1\3\32\1\31\4\32\1\16\21"+ - "\32\1\23\1\uffff\1\24\1\uffff\1\32\1\uffff\5\32\1\15\15\32\1"+ - "\14\6\32\1\25\1\12\1\26", - "", - "\1\34", - "\1\40\44\uffff\1\37\1\uffff\1\36\23\uffff\1\41", - "\1\42\2\uffff\12\27", - "\1\43", - "", - "", - "", - "", - "", - "", - "\1\45", - "\1\46", - "\1\47", - "", - "", - "", - "", - "", - "", - "", - "", - "\1\51\1\uffff\12\27\13\uffff\1\52\37\uffff\1\52", - "", - "\1\53", - "", - "", - "\1\54\2\uffff\12\55", - "", - "", - "", - "", - "", - "", - "", - "", - "\1\56", - "\1\57", - "\1\60", - "", - "\1\61\1\uffff\12\62\13\uffff\1\63\37\uffff\1\63", - "\1\65\1\uffff\1\65\2\uffff\12\66", - "\1\67", - "\12\55", - "\1\71\1\uffff\12\55\13\uffff\1\71\37\uffff\1\71", - "\1\72", - "\1\73", - "\1\74", - "\1\75\1\71\1\uffff\12\76", - "\1\71\1\uffff\12\62\13\uffff\1\63\37\uffff\1\63", - "\1\77\1\uffff\1\77\2\uffff\12\100", - "", - "\12\66", - "\1\71\1\uffff\12\66", - "\1\101", - "", - "", - "\12\32\7\uffff\32\32\4\uffff\1\32\1\uffff\32\32", - "\1\103", - "\1\104", - "\12\76", - "\1\71\1\uffff\12\76\13\uffff\1\71\37\uffff\1\71", - "\12\100", - "\1\71\1\uffff\12\100", - "\1\105", - "", - "\12\32\7\uffff\32\32\4\uffff\1\32\1\uffff\32\32", - "\1\107", - "\1\110", - "", - "\12\32\7\uffff\32\32\4\uffff\1\32\1\uffff\32\32", - "\12\32\7\uffff\32\32\4\uffff\1\32\1\uffff\32\32", - "\1\uffff", - "\1\uffff", - "", - "" - }; - - static final short[] DFA27_eot = DFA.unpackEncodedString(DFA27_eotS); - static final short[] DFA27_eof = DFA.unpackEncodedString(DFA27_eofS); - static final char[] DFA27_min = DFA.unpackEncodedStringToUnsignedChars(DFA27_minS); - static final char[] DFA27_max = DFA.unpackEncodedStringToUnsignedChars(DFA27_maxS); - static final short[] DFA27_accept = DFA.unpackEncodedString(DFA27_acceptS); - static final short[] DFA27_special = DFA.unpackEncodedString(DFA27_specialS); - static final short[][] DFA27_transition; - - static { - int numStates = DFA27_transitionS.length; - DFA27_transition = new short[numStates][]; - for (int i=0; i=0 ) return s; - break; - case 1 : - int LA27_73 = input.LA(1); - - - int index27_73 = input.index(); - input.rewind(); - s = -1; - if ( (!((( false )))) ) {s = 26;} - - else if ( (( false )) ) {s = 75;} - - - input.seek(index27_73); - if ( s>=0 ) return s; - break; - } - NoViableAltException nvae = - new NoViableAltException(getDescription(), 27, _s, input); - error(nvae); - throw nvae; - } - } - + public static final int EOF=-1; + public static final int T__65=65; + public static final int T__66=66; + public static final int T__67=67; + public static final int T__68=68; + public static final int T__69=69; + public static final int T__70=70; + public static final int T__71=71; + public static final int T__72=72; + public static final int T__73=73; + public static final int T__74=74; + public static final int T__75=75; + public static final int T__76=76; + public static final int T__77=77; + public static final int T__78=78; + public static final int T__79=79; + public static final int T__80=80; + public static final int ARRAY=4; + public static final int ARRAY_TYPE=5; + public static final int ASSIGNMENT=6; + public static final int BLANK=7; + public static final int COMMENT=8; + public static final int DEDENT=9; + public static final int DOMAIN_OF=10; + public static final int EMBEDDED_TYPE=11; + public static final int EMBEDDED_VALUE=12; + public static final int EQUALS=13; + public static final int ESC_SEQ=14; + public static final int EXPONENT=15; + public static final int FALSE=16; + public static final int FILE=17; + public static final int FLOAT=18; + public static final int HAS_DOMAIN=19; + public static final int HAS_RANGE=20; + public static final int HEX_DIGIT=21; + public static final int ID=22; + public static final int INDENT=23; + public static final int INHERITS=24; + public static final int INSTANCE_OF=25; + public static final int INT=26; + public static final int INT_RANGE=27; + public static final int LBRACKET=28; + public static final int LCURLY=29; + public static final int LPAREN=30; + public static final int MAP=31; + public static final int NEWLINE=32; + public static final int NO_VALUE=33; + public static final int PROPERTY=34; + public static final int RANGE=35; + public static final int RBRACKET=36; + public static final int RCURLY=37; + public static final int RECORD=38; + public static final int RECORD_TYPE=39; + public static final int REF=40; + public static final int REQUIRES_VALUE_TYPE=41; + public static final int RESOURCE=42; + public static final int RPAREN=43; + public static final int STRING=44; + public static final int SUBRELATION_OF=45; + public static final int TAGGED_VALUE=46; + public static final int TEMPLATE_DEFINITION=47; + public static final int TEMPLATE_INSTANCE=48; + public static final int TRUE=49; + public static final int TUPLE=50; + public static final int TUPLE_TYPE=51; + public static final int TYPE_ANNOTATION=52; + public static final int TYPE_COMPONENT=53; + public static final int TYPE_DEFINITION=54; + public static final int TYPE_DEFINITIONS=55; + public static final int TYPE_REFERENCE=56; + public static final int UNICODE_ESC=57; + public static final int UNION_TYPE=58; + public static final int URI=59; + public static final int VALUE_DEFINITION=60; + public static final int VALUE_DEFINITIONS=61; + public static final int VARIABLE=62; + public static final int VARIANT=63; + public static final int WS=64; + + int inParen = 0; + + TIntArrayList iStack = new TIntArrayList(); + { iStack.add(0); } + + List tokens = new ArrayList(); + public void emit(Token token) { + state.token = token; + tokens.add(token); + } + public Token nextToken() { + if(tokens.isEmpty()) { + super.nextToken(); + if ( tokens.isEmpty() ) { + /* When end-of-file is encountered, we + emit balancing number of DEDENT tokens. + */ + if(iStack.size() <= 1) + return getEOFToken(); + else { + while(iStack.size() > 1) { + iStack.removeAt(iStack.size()-1); + state.type = DEDENT; + emit(); + } + iStack.clear(); + } + } + } + return (Token)tokens.remove(0); + } + + + + // delegates + // delegators + public Lexer[] getDelegates() { + return new Lexer[] {}; + } + + public GraphLexer() {} + public GraphLexer(CharStream input) { + this(input, new RecognizerSharedState()); + } + public GraphLexer(CharStream input, RecognizerSharedState state) { + super(input,state); + } + @Override public String getGrammarFileName() { return "src/org/simantics/graph/compiler/internal/parsing/Graph.g"; } + + // $ANTLR start "T__65" + public final void mT__65() throws RecognitionException { + try { + int _type = T__65; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:46:7: ( '$' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:46:9: '$' + { + match('$'); + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__65" + + // $ANTLR start "T__66" + public final void mT__66() throws RecognitionException { + try { + int _type = T__66; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:47:7: ( '%' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:47:9: '%' + { + match('%'); + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__66" + + // $ANTLR start "T__67" + public final void mT__67() throws RecognitionException { + try { + int _type = T__67; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:48:7: ( ',' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:48:9: ',' + { + match(','); + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__67" + + // $ANTLR start "T__68" + public final void mT__68() throws RecognitionException { + try { + int _type = T__68; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:49:7: ( '-->' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:49:9: '-->' + { + match("-->"); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__68" + + // $ANTLR start "T__69" + public final void mT__69() throws RecognitionException { + try { + int _type = T__69; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:50:7: ( '.' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:50:9: '.' + { + match('.'); + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__69" + + // $ANTLR start "T__70" + public final void mT__70() throws RecognitionException { + try { + int _type = T__70; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:51:7: ( ':' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:51:9: ':' + { + match(':'); + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__70" + + // $ANTLR start "T__71" + public final void mT__71() throws RecognitionException { + try { + int _type = T__71; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:52:7: ( '<--' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:52:9: '<--' + { + match("<--"); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__71" + + // $ANTLR start "T__72" + public final void mT__72() throws RecognitionException { + try { + int _type = T__72; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:53:7: ( '' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:56:9: '==>' + { + match("==>"); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__75" + + // $ANTLR start "T__76" + public final void mT__76() throws RecognitionException { + try { + int _type = T__76; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:57:7: ( '>--' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:57:9: '>--' + { + match(">--"); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__76" + + // $ANTLR start "T__77" + public final void mT__77() throws RecognitionException { + try { + int _type = T__77; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:58:7: ( '@' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:58:9: '@' + { + match('@'); + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__77" + + // $ANTLR start "T__78" + public final void mT__78() throws RecognitionException { + try { + int _type = T__78; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:59:7: ( 'false' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:59:9: 'false' + { + match("false"); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__78" + + // $ANTLR start "T__79" + public final void mT__79() throws RecognitionException { + try { + int _type = T__79; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:60:7: ( 'true' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:60:9: 'true' + { + match("true"); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__79" + + // $ANTLR start "T__80" + public final void mT__80() throws RecognitionException { + try { + int _type = T__80; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:61:7: ( '|' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:61:9: '|' + { + match('|'); + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "T__80" + + // $ANTLR start "ID" + public final void mID() throws RecognitionException { + try { + int _type = ID; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:108:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:108:7: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* + { + if ( (input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:108:31: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* + loop1: + while (true) { + int alt1=2; + int LA1_0 = input.LA(1); + if ( ((LA1_0 >= '0' && LA1_0 <= '9')||(LA1_0 >= 'A' && LA1_0 <= 'Z')||LA1_0=='_'||(LA1_0 >= 'a' && LA1_0 <= 'z')) ) { + alt1=1; + } + + switch (alt1) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + break loop1; + } + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "ID" + + // $ANTLR start "COMMENT" + public final void mCOMMENT() throws RecognitionException { + try { + int _type = COMMENT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:112:5: ( '//' (~ ( '\\n' ) )* | '/*' ( options {greedy=false; } : . )* '*/' ) + int alt4=2; + int LA4_0 = input.LA(1); + if ( (LA4_0=='/') ) { + int LA4_1 = input.LA(2); + if ( (LA4_1=='/') ) { + alt4=1; + } + else if ( (LA4_1=='*') ) { + alt4=2; + } + + else { + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 4, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + NoViableAltException nvae = + new NoViableAltException("", 4, 0, input); + throw nvae; + } + + switch (alt4) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:112:9: '//' (~ ( '\\n' ) )* + { + match("//"); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:112:14: (~ ( '\\n' ) )* + loop2: + while (true) { + int alt2=2; + int LA2_0 = input.LA(1); + if ( ((LA2_0 >= '\u0000' && LA2_0 <= '\t')||(LA2_0 >= '\u000B' && LA2_0 <= '\uFFFF')) ) { + alt2=1; + } + + switch (alt2) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\t')||(input.LA(1) >= '\u000B' && input.LA(1) <= '\uFFFF') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + break loop2; + } + } + + _channel=HIDDEN; + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:113:9: '/*' ( options {greedy=false; } : . )* '*/' + { + match("/*"); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:113:14: ( options {greedy=false; } : . )* + loop3: + while (true) { + int alt3=2; + int LA3_0 = input.LA(1); + if ( (LA3_0=='*') ) { + int LA3_1 = input.LA(2); + if ( (LA3_1=='/') ) { + alt3=2; + } + else if ( ((LA3_1 >= '\u0000' && LA3_1 <= '.')||(LA3_1 >= '0' && LA3_1 <= '\uFFFF')) ) { + alt3=1; + } + + } + else if ( ((LA3_0 >= '\u0000' && LA3_0 <= ')')||(LA3_0 >= '+' && LA3_0 <= '\uFFFF')) ) { + alt3=1; + } + + switch (alt3) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:113:42: . + { + matchAny(); + } + break; + + default : + break loop3; + } + } + + match("*/"); + + _channel=HIDDEN; + } + break; + + } + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "COMMENT" + + // $ANTLR start "WS" + public final void mWS() throws RecognitionException { + try { + int _type = WS; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:116:5: ( ( ' ' | '\\t' | '\\r' ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:116:7: ( ' ' | '\\t' | '\\r' ) + { + if ( input.LA(1)=='\t'||input.LA(1)=='\r'||input.LA(1)==' ' ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + _channel=HIDDEN; + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "WS" + + // $ANTLR start "LPAREN" + public final void mLPAREN() throws RecognitionException { + try { + int _type = LPAREN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:122:11: ( '(' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:122:13: '(' + { + match('('); + ++ inParen; + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "LPAREN" + + // $ANTLR start "RPAREN" + public final void mRPAREN() throws RecognitionException { + try { + int _type = RPAREN; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:123:11: ( ')' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:123:13: ')' + { + match(')'); + -- inParen; + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "RPAREN" + + // $ANTLR start "LBRACKET" + public final void mLBRACKET() throws RecognitionException { + try { + int _type = LBRACKET; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:124:11: ( '[' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:124:13: '[' + { + match('['); + ++ inParen; + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "LBRACKET" + + // $ANTLR start "RBRACKET" + public final void mRBRACKET() throws RecognitionException { + try { + int _type = RBRACKET; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:125:11: ( ']' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:125:13: ']' + { + match(']'); + -- inParen; + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "RBRACKET" + + // $ANTLR start "LCURLY" + public final void mLCURLY() throws RecognitionException { + try { + int _type = LCURLY; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:126:11: ( '{' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:126:13: '{' + { + match('{'); + ++ inParen; + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "LCURLY" + + // $ANTLR start "RCURLY" + public final void mRCURLY() throws RecognitionException { + try { + int _type = RCURLY; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:127:11: ( '}' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:127:13: '}' + { + match('}'); + -- inParen; + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "RCURLY" + + // $ANTLR start "INT_RANGE" + public final void mINT_RANGE() throws RecognitionException { + try { + int _type = INT_RANGE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:129:11: ( INT '..' ( INT )? | '..' INT ) + int alt6=2; + int LA6_0 = input.LA(1); + if ( (LA6_0=='-'||(LA6_0 >= '0' && LA6_0 <= '9')) ) { + alt6=1; + } + else if ( (LA6_0=='.') ) { + alt6=2; + } + + else { + NoViableAltException nvae = + new NoViableAltException("", 6, 0, input); + throw nvae; + } + + switch (alt6) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:129:13: INT '..' ( INT )? + { + mINT(); + + match(".."); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:129:22: ( INT )? + int alt5=2; + int LA5_0 = input.LA(1); + if ( (LA5_0=='-'||(LA5_0 >= '0' && LA5_0 <= '9')) ) { + alt5=1; + } + switch (alt5) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:129:22: INT + { + mINT(); + + } + break; + + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:130:13: '..' INT + { + match(".."); + + mINT(); + + } + break; + + } + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "INT_RANGE" + + // $ANTLR start "RANGE" + public final void mRANGE() throws RecognitionException { + try { + int _type = RANGE; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:132:11: ( FLOAT '..' ( FLOAT | INT )? | '..' FLOAT | INT '..' FLOAT ) + int alt8=3; + alt8 = dfa8.predict(input); + switch (alt8) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:132:13: FLOAT '..' ( FLOAT | INT )? + { + mFLOAT(); + + match(".."); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:132:24: ( FLOAT | INT )? + int alt7=3; + alt7 = dfa7.predict(input); + switch (alt7) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:132:25: FLOAT + { + mFLOAT(); + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:132:33: INT + { + mINT(); + + } + break; + + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:133:13: '..' FLOAT + { + match(".."); + + mFLOAT(); + + } + break; + case 3 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:134:13: INT '..' FLOAT + { + mINT(); + + match(".."); + + mFLOAT(); + + } + break; + + } + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "RANGE" + + // $ANTLR start "NEWLINE" + public final void mNEWLINE() throws RecognitionException { + try { + int _type = NEWLINE; + int _channel = DEFAULT_TOKEN_CHANNEL; + int spaces = 0; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:139:5: ( '\\n' ( ' ' | '//' (~ ( '\\n' ) )* '\\n' | '/*' ( options {greedy=false; } : . )* '*/' | '\\r' | '\\n' )* ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:139:7: '\\n' ( ' ' | '//' (~ ( '\\n' ) )* '\\n' | '/*' ( options {greedy=false; } : . )* '*/' | '\\r' | '\\n' )* + { + match('\n'); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:140:7: ( ' ' | '//' (~ ( '\\n' ) )* '\\n' | '/*' ( options {greedy=false; } : . )* '*/' | '\\r' | '\\n' )* + loop11: + while (true) { + int alt11=6; + switch ( input.LA(1) ) { + case ' ': + { + alt11=1; + } + break; + case '/': + { + int LA11_3 = input.LA(2); + if ( (LA11_3=='/') ) { + alt11=2; + } + else if ( (LA11_3=='*') ) { + alt11=3; + } + + } + break; + case '\r': + { + alt11=4; + } + break; + case '\n': + { + alt11=5; + } + break; + } + switch (alt11) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:140:9: ' ' + { + match(' '); + ++spaces; + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:141:9: '//' (~ ( '\\n' ) )* '\\n' + { + match("//"); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:141:14: (~ ( '\\n' ) )* + loop9: + while (true) { + int alt9=2; + int LA9_0 = input.LA(1); + if ( ((LA9_0 >= '\u0000' && LA9_0 <= '\t')||(LA9_0 >= '\u000B' && LA9_0 <= '\uFFFF')) ) { + alt9=1; + } + + switch (alt9) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\t')||(input.LA(1) >= '\u000B' && input.LA(1) <= '\uFFFF') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + break loop9; + } + } + + match('\n'); + spaces = 0; + } + break; + case 3 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:142:9: '/*' ( options {greedy=false; } : . )* '*/' + { + match("/*"); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:142:14: ( options {greedy=false; } : . )* + loop10: + while (true) { + int alt10=2; + int LA10_0 = input.LA(1); + if ( (LA10_0=='*') ) { + int LA10_1 = input.LA(2); + if ( (LA10_1=='/') ) { + alt10=2; + } + else if ( ((LA10_1 >= '\u0000' && LA10_1 <= '.')||(LA10_1 >= '0' && LA10_1 <= '\uFFFF')) ) { + alt10=1; + } + + } + else if ( ((LA10_0 >= '\u0000' && LA10_0 <= ')')||(LA10_0 >= '+' && LA10_0 <= '\uFFFF')) ) { + alt10=1; + } + + switch (alt10) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:142:42: . + { + matchAny(); + } + break; + + default : + break loop10; + } + } + + match("*/"); + + } + break; + case 4 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:143:9: '\\r' + { + match('\r'); + } + break; + case 5 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:144:9: '\\n' + { + match('\n'); + spaces = 0; + } + break; + + default : + break loop11; + } + } + + + int c = input.LA(1); + + if(inParen > 0) { + _channel = HIDDEN; + } + else if(c == EOF) { + while(iStack.size() > 1) { + iStack.removeAt(iStack.size()-1); + state.type = DEDENT; + emit(); + } + _channel = HIDDEN; + iStack.clear(); + } + else { + int stackTop = iStack.get(iStack.size()-1); + if(spaces > stackTop) { + iStack.add(spaces); + _type = INDENT; + } + else if(spaces < stackTop) { + while(spaces < iStack.get(iStack.size()-1)) { + iStack.removeAt(iStack.size()-1); + state.type = DEDENT; + emit(); + } + state.type = NEWLINE; + emit(); + // TODO check that spaces == iStack.get(iStack.size()-1) + } + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "NEWLINE" + + // $ANTLR start "INDENT" + public final void mINDENT() throws RecognitionException { + try { + int _type = INDENT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:181:7: ({...}? => 'INDENT' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:181:9: {...}? => 'INDENT' + { + if ( !(( false )) ) { + throw new FailedPredicateException(input, "INDENT", " false "); + } + match("INDENT"); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "INDENT" + + // $ANTLR start "DEDENT" + public final void mDEDENT() throws RecognitionException { + try { + int _type = DEDENT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:182:7: ({...}? => 'DEDENT' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:182:9: {...}? => 'DEDENT' + { + if ( !(( false )) ) { + throw new FailedPredicateException(input, "DEDENT", " false "); + } + match("DEDENT"); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "DEDENT" + + // $ANTLR start "INT" + public final void mINT() throws RecognitionException { + try { + int _type = INT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:184:5: ( ( '-' )? ( '0' .. '9' )+ ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:184:7: ( '-' )? ( '0' .. '9' )+ + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:184:7: ( '-' )? + int alt12=2; + int LA12_0 = input.LA(1); + if ( (LA12_0=='-') ) { + alt12=1; + } + switch (alt12) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:184:7: '-' + { + match('-'); + } + break; + + } + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:184:12: ( '0' .. '9' )+ + int cnt13=0; + loop13: + while (true) { + int alt13=2; + int LA13_0 = input.LA(1); + if ( ((LA13_0 >= '0' && LA13_0 <= '9')) ) { + alt13=1; + } + + switch (alt13) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + if ( cnt13 >= 1 ) break loop13; + EarlyExitException eee = new EarlyExitException(13, input); + throw eee; + } + cnt13++; + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "INT" + + // $ANTLR start "FLOAT" + public final void mFLOAT() throws RecognitionException { + try { + int _type = FLOAT; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:188:5: ( ( '-' )? ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:188:7: ( '-' )? ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:188:7: ( '-' )? + int alt14=2; + int LA14_0 = input.LA(1); + if ( (LA14_0=='-') ) { + alt14=1; + } + switch (alt14) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:188:7: '-' + { + match('-'); + } + break; + + } + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:189:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT ) + int alt19=2; + alt19 = dfa19.predict(input); + switch (alt19) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:189:7: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:189:7: ( '0' .. '9' )+ + int cnt15=0; + loop15: + while (true) { + int alt15=2; + int LA15_0 = input.LA(1); + if ( ((LA15_0 >= '0' && LA15_0 <= '9')) ) { + alt15=1; + } + + switch (alt15) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + if ( cnt15 >= 1 ) break loop15; + EarlyExitException eee = new EarlyExitException(15, input); + throw eee; + } + cnt15++; + } + + match('.'); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:189:23: ( '0' .. '9' )* + loop16: + while (true) { + int alt16=2; + int LA16_0 = input.LA(1); + if ( ((LA16_0 >= '0' && LA16_0 <= '9')) ) { + alt16=1; + } + + switch (alt16) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + break loop16; + } + } + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:189:35: ( EXPONENT )? + int alt17=2; + int LA17_0 = input.LA(1); + if ( (LA17_0=='E'||LA17_0=='e') ) { + alt17=1; + } + switch (alt17) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:189:35: EXPONENT + { + mEXPONENT(); + + } + break; + + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:190:7: ( '0' .. '9' )+ EXPONENT + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:190:7: ( '0' .. '9' )+ + int cnt18=0; + loop18: + while (true) { + int alt18=2; + int LA18_0 = input.LA(1); + if ( ((LA18_0 >= '0' && LA18_0 <= '9')) ) { + alt18=1; + } + + switch (alt18) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + if ( cnt18 >= 1 ) break loop18; + EarlyExitException eee = new EarlyExitException(18, input); + throw eee; + } + cnt18++; + } + + mEXPONENT(); + + } + break; + + } + + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "FLOAT" + + // $ANTLR start "STRING" + public final void mSTRING() throws RecognitionException { + try { + int _type = STRING; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:195:5: ( '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' | '\"\"\"' (~ ( '\"' ) | '\"' ~ ( '\"' ) | '\"\"' ~ ( '\"' ) )* '\"\"\"' ) + int alt22=2; + int LA22_0 = input.LA(1); + if ( (LA22_0=='\"') ) { + int LA22_1 = input.LA(2); + if ( (LA22_1=='\"') ) { + int LA22_2 = input.LA(3); + if ( (LA22_2=='\"') ) { + alt22=2; + } + + else { + alt22=1; + } + + } + else if ( ((LA22_1 >= '\u0000' && LA22_1 <= '!')||(LA22_1 >= '#' && LA22_1 <= '\uFFFF')) ) { + alt22=1; + } + + else { + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 22, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + NoViableAltException nvae = + new NoViableAltException("", 22, 0, input); + throw nvae; + } + + switch (alt22) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:195:8: '\"' ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* '\"' + { + match('\"'); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:195:12: ( ESC_SEQ |~ ( '\\\\' | '\"' ) )* + loop20: + while (true) { + int alt20=3; + int LA20_0 = input.LA(1); + if ( (LA20_0=='\\') ) { + alt20=1; + } + else if ( ((LA20_0 >= '\u0000' && LA20_0 <= '!')||(LA20_0 >= '#' && LA20_0 <= '[')||(LA20_0 >= ']' && LA20_0 <= '\uFFFF')) ) { + alt20=2; + } + + switch (alt20) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:195:14: ESC_SEQ + { + mESC_SEQ(); + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:195:24: ~ ( '\\\\' | '\"' ) + { + if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '!')||(input.LA(1) >= '#' && input.LA(1) <= '[')||(input.LA(1) >= ']' && input.LA(1) <= '\uFFFF') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + break loop20; + } + } + + match('\"'); + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:196:8: '\"\"\"' (~ ( '\"' ) | '\"' ~ ( '\"' ) | '\"\"' ~ ( '\"' ) )* '\"\"\"' + { + match("\"\"\""); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:196:14: (~ ( '\"' ) | '\"' ~ ( '\"' ) | '\"\"' ~ ( '\"' ) )* + loop21: + while (true) { + int alt21=4; + int LA21_0 = input.LA(1); + if ( (LA21_0=='\"') ) { + int LA21_1 = input.LA(2); + if ( (LA21_1=='\"') ) { + int LA21_3 = input.LA(3); + if ( ((LA21_3 >= '\u0000' && LA21_3 <= '!')||(LA21_3 >= '#' && LA21_3 <= '\uFFFF')) ) { + alt21=3; + } + + } + else if ( ((LA21_1 >= '\u0000' && LA21_1 <= '!')||(LA21_1 >= '#' && LA21_1 <= '\uFFFF')) ) { + alt21=2; + } + + } + else if ( ((LA21_0 >= '\u0000' && LA21_0 <= '!')||(LA21_0 >= '#' && LA21_0 <= '\uFFFF')) ) { + alt21=1; + } + + switch (alt21) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:196:16: ~ ( '\"' ) + { + if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '!')||(input.LA(1) >= '#' && input.LA(1) <= '\uFFFF') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:196:25: '\"' ~ ( '\"' ) + { + match('\"'); + if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '!')||(input.LA(1) >= '#' && input.LA(1) <= '\uFFFF') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + case 3 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:196:38: '\"\"' ~ ( '\"' ) + { + match("\"\""); + + if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '!')||(input.LA(1) >= '#' && input.LA(1) <= '\uFFFF') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + break loop21; + } + } + + match("\"\"\""); + + } + break; + + } + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "STRING" + + // $ANTLR start "URI" + public final void mURI() throws RecognitionException { + try { + int _type = URI; + int _channel = DEFAULT_TOKEN_CHANNEL; + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:200:5: ( '' ) )* '>' ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:200:8: '' ) )* '>' + { + match("' ) )* + loop23: + while (true) { + int alt23=2; + int LA23_0 = input.LA(1); + if ( ((LA23_0 >= '\u0000' && LA23_0 <= '=')||(LA23_0 >= '?' && LA23_0 <= '\uFFFF')) ) { + alt23=1; + } + + switch (alt23) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '=')||(input.LA(1) >= '?' && input.LA(1) <= '\uFFFF') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + break loop23; + } + } + + match('>'); + } + + state.type = _type; + state.channel = _channel; + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "URI" + + // $ANTLR start "EXPONENT" + public final void mEXPONENT() throws RecognitionException { + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:205:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:205:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ + { + if ( input.LA(1)=='E'||input.LA(1)=='e' ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:205:22: ( '+' | '-' )? + int alt24=2; + int LA24_0 = input.LA(1); + if ( (LA24_0=='+'||LA24_0=='-') ) { + alt24=1; + } + switch (alt24) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + if ( input.LA(1)=='+'||input.LA(1)=='-' ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + } + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:205:33: ( '0' .. '9' )+ + int cnt25=0; + loop25: + while (true) { + int alt25=2; + int LA25_0 = input.LA(1); + if ( ((LA25_0 >= '0' && LA25_0 <= '9')) ) { + alt25=1; + } + + switch (alt25) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + + default : + if ( cnt25 >= 1 ) break loop25; + EarlyExitException eee = new EarlyExitException(25, input); + throw eee; + } + cnt25++; + } + + } + + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "EXPONENT" + + // $ANTLR start "HEX_DIGIT" + public final void mHEX_DIGIT() throws RecognitionException { + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:208:11: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + if ( (input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'F')||(input.LA(1) >= 'a' && input.LA(1) <= 'f') ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "HEX_DIGIT" + + // $ANTLR start "ESC_SEQ" + public final void mESC_SEQ() throws RecognitionException { + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:212:5: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | UNICODE_ESC ) + int alt26=2; + int LA26_0 = input.LA(1); + if ( (LA26_0=='\\') ) { + int LA26_1 = input.LA(2); + if ( (LA26_1=='\"'||LA26_1=='\''||LA26_1=='\\'||LA26_1=='b'||LA26_1=='f'||LA26_1=='n'||LA26_1=='r'||LA26_1=='t') ) { + alt26=1; + } + else if ( (LA26_1=='u') ) { + alt26=2; + } + + else { + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 26, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + + else { + NoViableAltException nvae = + new NoViableAltException("", 26, 0, input); + throw nvae; + } + + switch (alt26) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:212:9: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) + { + match('\\'); + if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) { + input.consume(); + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse; + } + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:213:9: UNICODE_ESC + { + mUNICODE_ESC(); + + } + break; + + } + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "ESC_SEQ" + + // $ANTLR start "UNICODE_ESC" + public final void mUNICODE_ESC() throws RecognitionException { + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:218:5: ( '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:218:9: '\\\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT + { + match('\\'); + match('u'); + mHEX_DIGIT(); + + mHEX_DIGIT(); + + mHEX_DIGIT(); + + mHEX_DIGIT(); + + } + + } + finally { + // do for sure before leaving + } + } + // $ANTLR end "UNICODE_ESC" + + @Override + public void mTokens() throws RecognitionException { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:8: ( T__65 | T__66 | T__67 | T__68 | T__69 | T__70 | T__71 | T__72 | T__73 | T__74 | T__75 | T__76 | T__77 | T__78 | T__79 | T__80 | ID | COMMENT | WS | LPAREN | RPAREN | LBRACKET | RBRACKET | LCURLY | RCURLY | INT_RANGE | RANGE | NEWLINE | INDENT | DEDENT | INT | FLOAT | STRING | URI ) + int alt27=34; + alt27 = dfa27.predict(input); + switch (alt27) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:10: T__65 + { + mT__65(); + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:16: T__66 + { + mT__66(); + + } + break; + case 3 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:22: T__67 + { + mT__67(); + + } + break; + case 4 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:28: T__68 + { + mT__68(); + + } + break; + case 5 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:34: T__69 + { + mT__69(); + + } + break; + case 6 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:40: T__70 + { + mT__70(); + + } + break; + case 7 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:46: T__71 + { + mT__71(); + + } + break; + case 8 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:52: T__72 + { + mT__72(); + + } + break; + case 9 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:58: T__73 + { + mT__73(); + + } + break; + case 10 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:64: T__74 + { + mT__74(); + + } + break; + case 11 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:70: T__75 + { + mT__75(); + + } + break; + case 12 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:76: T__76 + { + mT__76(); + + } + break; + case 13 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:82: T__77 + { + mT__77(); + + } + break; + case 14 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:88: T__78 + { + mT__78(); + + } + break; + case 15 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:94: T__79 + { + mT__79(); + + } + break; + case 16 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:100: T__80 + { + mT__80(); + + } + break; + case 17 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:106: ID + { + mID(); + + } + break; + case 18 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:109: COMMENT + { + mCOMMENT(); + + } + break; + case 19 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:117: WS + { + mWS(); + + } + break; + case 20 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:120: LPAREN + { + mLPAREN(); + + } + break; + case 21 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:127: RPAREN + { + mRPAREN(); + + } + break; + case 22 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:134: LBRACKET + { + mLBRACKET(); + + } + break; + case 23 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:143: RBRACKET + { + mRBRACKET(); + + } + break; + case 24 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:152: LCURLY + { + mLCURLY(); + + } + break; + case 25 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:159: RCURLY + { + mRCURLY(); + + } + break; + case 26 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:166: INT_RANGE + { + mINT_RANGE(); + + } + break; + case 27 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:176: RANGE + { + mRANGE(); + + } + break; + case 28 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:182: NEWLINE + { + mNEWLINE(); + + } + break; + case 29 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:190: INDENT + { + mINDENT(); + + } + break; + case 30 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:197: DEDENT + { + mDEDENT(); + + } + break; + case 31 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:204: INT + { + mINT(); + + } + break; + case 32 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:208: FLOAT + { + mFLOAT(); + + } + break; + case 33 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:214: STRING + { + mSTRING(); + + } + break; + case 34 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:1:221: URI + { + mURI(); + + } + break; + + } + } + + + protected DFA8 dfa8 = new DFA8(this); + protected DFA7 dfa7 = new DFA7(this); + protected DFA19 dfa19 = new DFA19(this); + protected DFA27 dfa27 = new DFA27(this); + static final String DFA8_eotS = + "\10\uffff"; + static final String DFA8_eofS = + "\10\uffff"; + static final String DFA8_minS = + "\1\55\1\60\1\56\1\uffff\1\56\1\uffff\1\55\1\uffff"; + static final String DFA8_maxS = + "\2\71\1\145\1\uffff\1\145\1\uffff\1\71\1\uffff"; + static final String DFA8_acceptS = + "\3\uffff\1\2\1\uffff\1\1\1\uffff\1\3"; + static final String DFA8_specialS = + "\10\uffff}>"; + static final String[] DFA8_transitionS = { + "\1\1\1\3\1\uffff\12\2", + "\12\2", + "\1\4\1\uffff\12\2\13\uffff\1\5\37\uffff\1\5", + "", + "\1\6\1\uffff\12\5\13\uffff\1\5\37\uffff\1\5", + "", + "\1\7\1\5\1\uffff\12\7", + "" + }; + + static final short[] DFA8_eot = DFA.unpackEncodedString(DFA8_eotS); + static final short[] DFA8_eof = DFA.unpackEncodedString(DFA8_eofS); + static final char[] DFA8_min = DFA.unpackEncodedStringToUnsignedChars(DFA8_minS); + static final char[] DFA8_max = DFA.unpackEncodedStringToUnsignedChars(DFA8_maxS); + static final short[] DFA8_accept = DFA.unpackEncodedString(DFA8_acceptS); + static final short[] DFA8_special = DFA.unpackEncodedString(DFA8_specialS); + static final short[][] DFA8_transition; + + static { + int numStates = DFA8_transitionS.length; + DFA8_transition = new short[numStates][]; + for (int i=0; i"; + static final String[] DFA7_transitionS = { + "\1\1\2\uffff\12\2", + "\12\2", + "\1\4\1\uffff\12\2\13\uffff\1\4\37\uffff\1\4", + "", + "", + "" + }; + + static final short[] DFA7_eot = DFA.unpackEncodedString(DFA7_eotS); + static final short[] DFA7_eof = DFA.unpackEncodedString(DFA7_eofS); + static final char[] DFA7_min = DFA.unpackEncodedStringToUnsignedChars(DFA7_minS); + static final char[] DFA7_max = DFA.unpackEncodedStringToUnsignedChars(DFA7_maxS); + static final short[] DFA7_accept = DFA.unpackEncodedString(DFA7_acceptS); + static final short[] DFA7_special = DFA.unpackEncodedString(DFA7_specialS); + static final short[][] DFA7_transition; + + static { + int numStates = DFA7_transitionS.length; + DFA7_transition = new short[numStates][]; + for (int i=0; i"; + static final String[] DFA19_transitionS = { + "\12\1", + "\1\2\1\uffff\12\1\13\uffff\1\3\37\uffff\1\3", + "", + "" + }; + + static final short[] DFA19_eot = DFA.unpackEncodedString(DFA19_eotS); + static final short[] DFA19_eof = DFA.unpackEncodedString(DFA19_eofS); + static final char[] DFA19_min = DFA.unpackEncodedStringToUnsignedChars(DFA19_minS); + static final char[] DFA19_max = DFA.unpackEncodedStringToUnsignedChars(DFA19_maxS); + static final short[] DFA19_accept = DFA.unpackEncodedString(DFA19_acceptS); + static final short[] DFA19_special = DFA.unpackEncodedString(DFA19_specialS); + static final short[][] DFA19_transition; + + static { + int numStates = DFA19_transitionS.length; + DFA19_transition = new short[numStates][]; + for (int i=0; i"; + static final String[] DFA27_transitionS = { + "\1\20\1\30\2\uffff\1\20\22\uffff\1\20\1\uffff\1\33\1\uffff\1\1\1\2\2"+ + "\uffff\1\21\1\22\2\uffff\1\3\1\4\1\5\1\17\12\27\1\6\1\uffff\1\7\1\10"+ + "\1\11\1\uffff\1\12\3\32\1\31\4\32\1\16\21\32\1\23\1\uffff\1\24\1\uffff"+ + "\1\32\1\uffff\5\32\1\13\15\32\1\14\6\32\1\25\1\15\1\26", + "", + "", + "", + "\1\34\2\uffff\12\27", + "\1\35", + "", + "\1\37\44\uffff\1\40\1\uffff\1\41\23\uffff\1\42", + "\1\43", + "", + "", + "\1\45", + "\1\46", + "", + "\1\47", + "", + "", + "", + "", + "", + "", + "", + "", + "\1\51\1\uffff\12\27\13\uffff\1\52\37\uffff\1\52", + "", + "\1\53", + "", + "", + "", + "\1\54\2\uffff\12\55", + "", + "", + "", + "", + "", + "", + "", + "\1\56", + "\1\57", + "\1\60", + "", + "\1\61\1\uffff\12\62\13\uffff\1\63\37\uffff\1\63", + "\1\65\1\uffff\1\65\2\uffff\12\66", + "\1\67", + "\12\55", + "\1\71\1\uffff\12\55\13\uffff\1\71\37\uffff\1\71", + "\1\72", + "\1\73", + "\1\74", + "\1\75\1\71\1\uffff\12\76", + "\1\71\1\uffff\12\62\13\uffff\1\63\37\uffff\1\63", + "\1\77\1\uffff\1\77\2\uffff\12\100", + "", + "\12\66", + "\1\71\1\uffff\12\66", + "\1\101", + "", + "", + "\1\102", + "\12\32\7\uffff\32\32\4\uffff\1\32\1\uffff\32\32", + "\1\104", + "\12\76", + "\1\71\1\uffff\12\76\13\uffff\1\71\37\uffff\1\71", + "\12\100", + "\1\71\1\uffff\12\100", + "\1\105", + "\12\32\7\uffff\32\32\4\uffff\1\32\1\uffff\32\32", + "", + "\1\107", + "\1\110", + "", + "\12\32\7\uffff\32\32\4\uffff\1\32\1\uffff\32\32", + "\12\32\7\uffff\32\32\4\uffff\1\32\1\uffff\32\32", + "\1\uffff", + "\1\uffff", + "", + "" + }; + + static final short[] DFA27_eot = DFA.unpackEncodedString(DFA27_eotS); + static final short[] DFA27_eof = DFA.unpackEncodedString(DFA27_eofS); + static final char[] DFA27_min = DFA.unpackEncodedStringToUnsignedChars(DFA27_minS); + static final char[] DFA27_max = DFA.unpackEncodedStringToUnsignedChars(DFA27_maxS); + static final short[] DFA27_accept = DFA.unpackEncodedString(DFA27_acceptS); + static final short[] DFA27_special = DFA.unpackEncodedString(DFA27_specialS); + static final short[][] DFA27_transition; + + static { + int numStates = DFA27_transitionS.length; + DFA27_transition = new short[numStates][]; + for (int i=0; i=0 ) return s; + break; + + case 1 : + int LA27_74 = input.LA(1); + + int index27_74 = input.index(); + input.rewind(); + s = -1; + if ( (!((( false )))) ) {s = 26;} + else if ( (( false )) ) {s = 76;} + + input.seek(index27_74); + if ( s>=0 ) return s; + break; + } + NoViableAltException nvae = + new NoViableAltException(getDescription(), 27, _s, input); + error(nvae); + throw nvae; + } + } } diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/GraphParser.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/GraphParser.java index 94df985e0..8fca98c53 100644 --- a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/GraphParser.java +++ b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/parsing/GraphParser.java @@ -1,4 +1,4 @@ -// $ANTLR 3.3 Nov 30, 2010 12:50:56 src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g 2011-12-19 14:53:14 +// $ANTLR 3.5.2 src/org/simantics/graph/compiler/internal/parsing/Graph.g 2018-06-15 14:02:54 package org.simantics.graph.compiler.internal.parsing; import org.antlr.runtime.*; @@ -10,6233 +10,5825 @@ import java.util.HashMap; import org.antlr.runtime.tree.*; -@SuppressWarnings("unused") -public class GraphParser extends Parser { - public static final String[] tokenNames = new String[] { - "", "", "", "", "INDENT", "DEDENT", "FILE", "RESOURCE", "PROPERTY", "VARIABLE", "EMBEDDED_VALUE", "EMBEDDED_TYPE", "TEMPLATE_INSTANCE", "TEMPLATE_DEFINITION", "BLANK", "REF", "EQUALS", "INSTANCE_OF", "INHERITS", "SUBRELATION_OF", "HAS_DOMAIN", "HAS_RANGE", "DOMAIN_OF", "REQUIRES_VALUE_TYPE", "TYPE_DEFINITIONS", "TYPE_DEFINITION", "UNION_TYPE", "RECORD_TYPE", "TUPLE_TYPE", "ARRAY_TYPE", "TYPE_REFERENCE", "TYPE_ANNOTATION", "TYPE_COMPONENT", "VALUE_DEFINITIONS", "VALUE_DEFINITION", "NO_VALUE", "VARIANT", "ARRAY", "TUPLE", "TAGGED_VALUE", "RECORD", "MAP", "ASSIGNMENT", "TRUE", "FALSE", "ID", "COMMENT", "WS", "LPAREN", "RPAREN", "LBRACKET", "RBRACKET", "LCURLY", "RCURLY", "INT", "INT_RANGE", "FLOAT", "RANGE", "NEWLINE", "EXPONENT", "ESC_SEQ", "STRING", "URI", "HEX_DIGIT", "UNICODE_ESC", "'@'", "'.'", "''", "'==>'", "'>--'", "':'", "'='", "'%'", "'$'", "'|'", "','", "'true'", "'false'" - }; - public static final int EOF=-1; - public static final int T__65=65; - public static final int T__66=66; - public static final int T__67=67; - public static final int T__68=68; - public static final int T__69=69; - public static final int T__70=70; - public static final int T__71=71; - public static final int T__72=72; - public static final int T__73=73; - public static final int T__74=74; - public static final int T__75=75; - public static final int T__76=76; - public static final int T__77=77; - public static final int T__78=78; - public static final int T__79=79; - public static final int T__80=80; - public static final int INDENT=4; - public static final int DEDENT=5; - public static final int FILE=6; - public static final int RESOURCE=7; - public static final int PROPERTY=8; - public static final int VARIABLE=9; - public static final int EMBEDDED_VALUE=10; - public static final int EMBEDDED_TYPE=11; - public static final int TEMPLATE_INSTANCE=12; - public static final int TEMPLATE_DEFINITION=13; - public static final int BLANK=14; - public static final int REF=15; - public static final int EQUALS=16; - public static final int INSTANCE_OF=17; - public static final int INHERITS=18; - public static final int SUBRELATION_OF=19; - public static final int HAS_DOMAIN=20; - public static final int HAS_RANGE=21; - public static final int DOMAIN_OF=22; - public static final int REQUIRES_VALUE_TYPE=23; - public static final int TYPE_DEFINITIONS=24; - public static final int TYPE_DEFINITION=25; - public static final int UNION_TYPE=26; - public static final int RECORD_TYPE=27; - public static final int TUPLE_TYPE=28; - public static final int ARRAY_TYPE=29; - public static final int TYPE_REFERENCE=30; - public static final int TYPE_ANNOTATION=31; - public static final int TYPE_COMPONENT=32; - public static final int VALUE_DEFINITIONS=33; - public static final int VALUE_DEFINITION=34; - public static final int NO_VALUE=35; - public static final int VARIANT=36; - public static final int ARRAY=37; - public static final int TUPLE=38; - public static final int TAGGED_VALUE=39; - public static final int RECORD=40; - public static final int MAP=41; - public static final int ASSIGNMENT=42; - public static final int TRUE=43; - public static final int FALSE=44; - public static final int ID=45; - public static final int COMMENT=46; - public static final int WS=47; - public static final int LPAREN=48; - public static final int RPAREN=49; - public static final int LBRACKET=50; - public static final int RBRACKET=51; - public static final int LCURLY=52; - public static final int RCURLY=53; - public static final int INT=54; - public static final int INT_RANGE=55; - public static final int FLOAT=56; - public static final int RANGE=57; - public static final int NEWLINE=58; - public static final int EXPONENT=59; - public static final int ESC_SEQ=60; - public static final int STRING=61; - public static final int URI=62; - public static final int HEX_DIGIT=63; - public static final int UNICODE_ESC=64; - - // delegates - // delegators - - - public GraphParser(TokenStream input) { - this(input, new RecognizerSharedState()); - } - public GraphParser(TokenStream input, RecognizerSharedState state) { - super(input, state); - - } - - protected TreeAdaptor adaptor = new CommonTreeAdaptor(); - - public void setTreeAdaptor(TreeAdaptor adaptor) { - this.adaptor = adaptor; - } - public TreeAdaptor getTreeAdaptor() { - return adaptor; - } - - public String[] getTokenNames() { return GraphParser.tokenNames; } - public String getGrammarFileName() { return "src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g"; } - - - public static class file_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "file" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:1: file : ( NEWLINE )? ( resourceDefinitions )? EOF -> ^( FILE ( resourceDefinitions )? ) ; - public final GraphParser.file_return file() throws RecognitionException { - GraphParser.file_return retval = new GraphParser.file_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token NEWLINE1=null; - Token EOF3=null; - GraphParser.resourceDefinitions_return resourceDefinitions2 = null; - - - CommonTree NEWLINE1_tree=null; - CommonTree EOF3_tree=null; - RewriteRuleTokenStream stream_NEWLINE=new RewriteRuleTokenStream(adaptor,"token NEWLINE"); - RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF"); - RewriteRuleSubtreeStream stream_resourceDefinitions=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinitions"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:6: ( ( NEWLINE )? ( resourceDefinitions )? EOF -> ^( FILE ( resourceDefinitions )? ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:8: ( NEWLINE )? ( resourceDefinitions )? EOF - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:8: ( NEWLINE )? - int alt1=2; - int LA1_0 = input.LA(1); - - if ( (LA1_0==NEWLINE) ) { - alt1=1; - } - switch (alt1) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:8: NEWLINE - { - NEWLINE1=(Token)match(input,NEWLINE,FOLLOW_NEWLINE_in_file1230); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_NEWLINE.add(NEWLINE1); - - - } - break; - - } - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:17: ( resourceDefinitions )? - int alt2=2; - int LA2_0 = input.LA(1); - - if ( (LA2_0==ID||LA2_0==LPAREN||LA2_0==LBRACKET||LA2_0==LCURLY||LA2_0==INT||LA2_0==FLOAT||(LA2_0>=STRING && LA2_0<=URI)||LA2_0==65||(LA2_0>=75 && LA2_0<=76)||(LA2_0>=79 && LA2_0<=80)) ) { - alt2=1; - } - switch (alt2) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:17: resourceDefinitions - { - pushFollow(FOLLOW_resourceDefinitions_in_file1233); - resourceDefinitions2=resourceDefinitions(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions2.getTree()); - - } - break; - - } - - EOF3=(Token)match(input,EOF,FOLLOW_EOF_in_file1236); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_EOF.add(EOF3); - - - - // AST REWRITE - // elements: resourceDefinitions - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 224:42: -> ^( FILE ( resourceDefinitions )? ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:45: ^( FILE ( resourceDefinitions )? ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(FILE, "FILE"), root_1); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:224:52: ( resourceDefinitions )? - if ( stream_resourceDefinitions.hasNext() ) { - adaptor.addChild(root_1, stream_resourceDefinitions.nextTree()); - - } - stream_resourceDefinitions.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "file" - - public static class resourceDefinitions_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "resourceDefinitions" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:226:1: resourceDefinitions : resourceDefinition ( NEWLINE resourceDefinition )* ; - public final GraphParser.resourceDefinitions_return resourceDefinitions() throws RecognitionException { - GraphParser.resourceDefinitions_return retval = new GraphParser.resourceDefinitions_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token NEWLINE5=null; - GraphParser.resourceDefinition_return resourceDefinition4 = null; - - GraphParser.resourceDefinition_return resourceDefinition6 = null; - - - CommonTree NEWLINE5_tree=null; - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:227:6: ( resourceDefinition ( NEWLINE resourceDefinition )* ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:227:8: resourceDefinition ( NEWLINE resourceDefinition )* - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_resourceDefinition_in_resourceDefinitions1260); - resourceDefinition4=resourceDefinition(); - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, resourceDefinition4.getTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:227:27: ( NEWLINE resourceDefinition )* - loop3: - do { - int alt3=2; - int LA3_0 = input.LA(1); - - if ( (LA3_0==NEWLINE) ) { - alt3=1; - } - - - switch (alt3) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:227:28: NEWLINE resourceDefinition - { - NEWLINE5=(Token)match(input,NEWLINE,FOLLOW_NEWLINE_in_resourceDefinitions1263); if (state.failed) return retval; - pushFollow(FOLLOW_resourceDefinition_in_resourceDefinitions1266); - resourceDefinition6=resourceDefinition(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, resourceDefinition6.getTree()); - - } - break; - - default : - break loop3; - } - } while (true); - - - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "resourceDefinitions" - - public static class resourceDefinition_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "resourceDefinition" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:230:1: resourceDefinition : ( resource ( localProperty )* ( INDENT property ( NEWLINE property )* DEDENT )? -> ^( RESOURCE resource ( localProperty )* ( property )* ) | template -> ^( RESOURCE ^( BLANK template ) template ) ); - public final GraphParser.resourceDefinition_return resourceDefinition() throws RecognitionException { - GraphParser.resourceDefinition_return retval = new GraphParser.resourceDefinition_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token INDENT9=null; - Token NEWLINE11=null; - Token DEDENT13=null; - GraphParser.resource_return resource7 = null; - - GraphParser.localProperty_return localProperty8 = null; - - GraphParser.property_return property10 = null; - - GraphParser.property_return property12 = null; - - GraphParser.template_return template14 = null; - - - CommonTree INDENT9_tree=null; - CommonTree NEWLINE11_tree=null; - CommonTree DEDENT13_tree=null; - RewriteRuleTokenStream stream_DEDENT=new RewriteRuleTokenStream(adaptor,"token DEDENT"); - RewriteRuleTokenStream stream_NEWLINE=new RewriteRuleTokenStream(adaptor,"token NEWLINE"); - RewriteRuleTokenStream stream_INDENT=new RewriteRuleTokenStream(adaptor,"token INDENT"); - RewriteRuleSubtreeStream stream_template=new RewriteRuleSubtreeStream(adaptor,"rule template"); - RewriteRuleSubtreeStream stream_resource=new RewriteRuleSubtreeStream(adaptor,"rule resource"); - RewriteRuleSubtreeStream stream_property=new RewriteRuleSubtreeStream(adaptor,"rule property"); - RewriteRuleSubtreeStream stream_localProperty=new RewriteRuleSubtreeStream(adaptor,"rule localProperty"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:231:5: ( resource ( localProperty )* ( INDENT property ( NEWLINE property )* DEDENT )? -> ^( RESOURCE resource ( localProperty )* ( property )* ) | template -> ^( RESOURCE ^( BLANK template ) template ) ) - int alt7=2; - int LA7_0 = input.LA(1); - - if ( (LA7_0==ID||LA7_0==LPAREN||LA7_0==LBRACKET||LA7_0==LCURLY||LA7_0==INT||LA7_0==FLOAT||(LA7_0>=STRING && LA7_0<=URI)||(LA7_0>=75 && LA7_0<=76)||(LA7_0>=79 && LA7_0<=80)) ) { - alt7=1; - } - else if ( (LA7_0==65) ) { - alt7=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 7, 0, input); - - throw nvae; - } - switch (alt7) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:231:7: resource ( localProperty )* ( INDENT property ( NEWLINE property )* DEDENT )? - { - pushFollow(FOLLOW_resource_in_resourceDefinition1300); - resource7=resource(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_resource.add(resource7.getTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:232:7: ( localProperty )* - loop4: - do { - int alt4=2; - int LA4_0 = input.LA(1); - - if ( (LA4_0==ID||LA4_0==URI||(LA4_0>=67 && LA4_0<=75)) ) { - alt4=1; - } - - - switch (alt4) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:232:7: localProperty - { - pushFollow(FOLLOW_localProperty_in_resourceDefinition1308); - localProperty8=localProperty(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_localProperty.add(localProperty8.getTree()); - - } - break; - - default : - break loop4; - } - } while (true); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:233:7: ( INDENT property ( NEWLINE property )* DEDENT )? - int alt6=2; - int LA6_0 = input.LA(1); - - if ( (LA6_0==INDENT) ) { - alt6=1; - } - switch (alt6) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:233:8: INDENT property ( NEWLINE property )* DEDENT - { - INDENT9=(Token)match(input,INDENT,FOLLOW_INDENT_in_resourceDefinition1318); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_INDENT.add(INDENT9); - - pushFollow(FOLLOW_property_in_resourceDefinition1320); - property10=property(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_property.add(property10.getTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:233:24: ( NEWLINE property )* - loop5: - do { - int alt5=2; - int LA5_0 = input.LA(1); - - if ( (LA5_0==NEWLINE) ) { - alt5=1; - } - - - switch (alt5) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:233:25: NEWLINE property - { - NEWLINE11=(Token)match(input,NEWLINE,FOLLOW_NEWLINE_in_resourceDefinition1323); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_NEWLINE.add(NEWLINE11); - - pushFollow(FOLLOW_property_in_resourceDefinition1325); - property12=property(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_property.add(property12.getTree()); - - } - break; - - default : - break loop5; - } - } while (true); - - DEDENT13=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_resourceDefinition1329); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT13); - - - } - break; - - } - - - - // AST REWRITE - // elements: property, localProperty, resource - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 234:5: -> ^( RESOURCE resource ( localProperty )* ( property )* ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:234:8: ^( RESOURCE resource ( localProperty )* ( property )* ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RESOURCE, "RESOURCE"), root_1); - - adaptor.addChild(root_1, stream_resource.nextTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:234:28: ( localProperty )* - while ( stream_localProperty.hasNext() ) { - adaptor.addChild(root_1, stream_localProperty.nextTree()); - - } - stream_localProperty.reset(); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:234:43: ( property )* - while ( stream_property.hasNext() ) { - adaptor.addChild(root_1, stream_property.nextTree()); - - } - stream_property.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:235:7: template - { - pushFollow(FOLLOW_template_in_resourceDefinition1358); - template14=template(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_template.add(template14.getTree()); - - - // AST REWRITE - // elements: template, template - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 235:16: -> ^( RESOURCE ^( BLANK template ) template ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:235:19: ^( RESOURCE ^( BLANK template ) template ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RESOURCE, "RESOURCE"), root_1); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:235:30: ^( BLANK template ) - { - CommonTree root_2 = (CommonTree)adaptor.nil(); - root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(BLANK, "BLANK"), root_2); - - adaptor.addChild(root_2, stream_template.nextTree()); - - adaptor.addChild(root_1, root_2); - } - adaptor.addChild(root_1, stream_template.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "resourceDefinition" - - public static class localProperty_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "localProperty" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:238:1: localProperty : relation resource -> ^( PROPERTY relation ^( RESOURCE resource ) ) ; - public final GraphParser.localProperty_return localProperty() throws RecognitionException { - GraphParser.localProperty_return retval = new GraphParser.localProperty_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - GraphParser.relation_return relation15 = null; - - GraphParser.resource_return resource16 = null; - - - RewriteRuleSubtreeStream stream_relation=new RewriteRuleSubtreeStream(adaptor,"rule relation"); - RewriteRuleSubtreeStream stream_resource=new RewriteRuleSubtreeStream(adaptor,"rule resource"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:239:5: ( relation resource -> ^( PROPERTY relation ^( RESOURCE resource ) ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:239:7: relation resource - { - pushFollow(FOLLOW_relation_in_localProperty1393); - relation15=relation(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_relation.add(relation15.getTree()); - pushFollow(FOLLOW_resource_in_localProperty1395); - resource16=resource(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_resource.add(resource16.getTree()); - - - // AST REWRITE - // elements: resource, relation - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 240:5: -> ^( PROPERTY relation ^( RESOURCE resource ) ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:240:8: ^( PROPERTY relation ^( RESOURCE resource ) ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PROPERTY, "PROPERTY"), root_1); - - adaptor.addChild(root_1, stream_relation.nextTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:240:28: ^( RESOURCE resource ) - { - CommonTree root_2 = (CommonTree)adaptor.nil(); - root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RESOURCE, "RESOURCE"), root_2); - - adaptor.addChild(root_2, stream_resource.nextTree()); - - adaptor.addChild(root_1, root_2); - } - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "localProperty" - - public static class property_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "property" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:243:1: property : ( relation ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) ) | template ); - public final GraphParser.property_return property() throws RecognitionException { - GraphParser.property_return retval = new GraphParser.property_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token INDENT19=null; - Token DEDENT21=null; - GraphParser.relation_return relation17 = null; - - GraphParser.resourceDefinition_return resourceDefinition18 = null; - - GraphParser.resourceDefinitions_return resourceDefinitions20 = null; - - GraphParser.template_return template22 = null; - - - CommonTree INDENT19_tree=null; - CommonTree DEDENT21_tree=null; - RewriteRuleTokenStream stream_DEDENT=new RewriteRuleTokenStream(adaptor,"token DEDENT"); - RewriteRuleTokenStream stream_INDENT=new RewriteRuleTokenStream(adaptor,"token INDENT"); - RewriteRuleSubtreeStream stream_resourceDefinition=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinition"); - RewriteRuleSubtreeStream stream_relation=new RewriteRuleSubtreeStream(adaptor,"rule relation"); - RewriteRuleSubtreeStream stream_resourceDefinitions=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinitions"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:244:5: ( relation ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) ) | template ) - int alt9=2; - int LA9_0 = input.LA(1); - - if ( (LA9_0==ID||LA9_0==URI||(LA9_0>=67 && LA9_0<=75)) ) { - alt9=1; - } - else if ( (LA9_0==65) ) { - alt9=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 9, 0, input); - - throw nvae; - } - switch (alt9) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:244:7: relation ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) ) - { - pushFollow(FOLLOW_relation_in_property1434); - relation17=relation(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_relation.add(relation17.getTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:245:7: ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) ) - int alt8=2; - int LA8_0 = input.LA(1); - - if ( (LA8_0==ID||LA8_0==LPAREN||LA8_0==LBRACKET||LA8_0==LCURLY||LA8_0==INT||LA8_0==FLOAT||(LA8_0>=STRING && LA8_0<=URI)||LA8_0==65||(LA8_0>=75 && LA8_0<=76)||(LA8_0>=79 && LA8_0<=80)) ) { - alt8=1; - } - else if ( (LA8_0==INDENT) ) { - alt8=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 8, 0, input); - - throw nvae; - } - switch (alt8) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:245:9: resourceDefinition - { - pushFollow(FOLLOW_resourceDefinition_in_property1444); - resourceDefinition18=resourceDefinition(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_resourceDefinition.add(resourceDefinition18.getTree()); - - - // AST REWRITE - // elements: relation, resourceDefinition - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 245:28: -> ^( PROPERTY relation resourceDefinition ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:245:31: ^( PROPERTY relation resourceDefinition ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PROPERTY, "PROPERTY"), root_1); - - adaptor.addChild(root_1, stream_relation.nextTree()); - adaptor.addChild(root_1, stream_resourceDefinition.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:246:9: INDENT resourceDefinitions DEDENT - { - INDENT19=(Token)match(input,INDENT,FOLLOW_INDENT_in_property1464); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_INDENT.add(INDENT19); - - pushFollow(FOLLOW_resourceDefinitions_in_property1466); - resourceDefinitions20=resourceDefinitions(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions20.getTree()); - DEDENT21=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_property1468); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT21); - - - - // AST REWRITE - // elements: relation, resourceDefinitions - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 246:43: -> ^( PROPERTY relation resourceDefinitions ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:246:46: ^( PROPERTY relation resourceDefinitions ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PROPERTY, "PROPERTY"), root_1); - - adaptor.addChild(root_1, stream_relation.nextTree()); - adaptor.addChild(root_1, stream_resourceDefinitions.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - - } - - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:248:7: template - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_template_in_property1494); - template22=template(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, template22.getTree()); - - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "property" - - public static class template_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "template" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:251:1: template : '@' ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) ) ; - public final GraphParser.template_return template() throws RecognitionException { - GraphParser.template_return retval = new GraphParser.template_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token char_literal23=null; - Token ID24=null; - Token INDENT26=null; - Token DEDENT28=null; - Token INDENT30=null; - Token DEDENT32=null; - GraphParser.resource_return resource25 = null; - - GraphParser.resourceDefinitions_return resourceDefinitions27 = null; - - GraphParser.resource_return resource29 = null; - - GraphParser.resourceDefinitions_return resourceDefinitions31 = null; - - - CommonTree char_literal23_tree=null; - CommonTree ID24_tree=null; - CommonTree INDENT26_tree=null; - CommonTree DEDENT28_tree=null; - CommonTree INDENT30_tree=null; - CommonTree DEDENT32_tree=null; - RewriteRuleTokenStream stream_DEDENT=new RewriteRuleTokenStream(adaptor,"token DEDENT"); - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - RewriteRuleTokenStream stream_65=new RewriteRuleTokenStream(adaptor,"token 65"); - RewriteRuleTokenStream stream_INDENT=new RewriteRuleTokenStream(adaptor,"token INDENT"); - RewriteRuleSubtreeStream stream_resource=new RewriteRuleSubtreeStream(adaptor,"rule resource"); - RewriteRuleSubtreeStream stream_resourceDefinitions=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinitions"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:252:5: ( '@' ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:252:7: '@' ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) ) - { - char_literal23=(Token)match(input,65,FOLLOW_65_in_template1515); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_65.add(char_literal23); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:253:5: ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) ) - int alt13=2; - alt13 = dfa13.predict(input); - switch (alt13) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:253:7: {...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT - { - if ( !((input.LT(1).getText().equals("template"))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "template", "input.LT(1).getText().equals(\"template\")"); - } - ID24=(Token)match(input,ID,FOLLOW_ID_in_template1533); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID24); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:254:10: ( resource )+ - int cnt10=0; - loop10: - do { - int alt10=2; - int LA10_0 = input.LA(1); - - if ( (LA10_0==ID||LA10_0==LPAREN||LA10_0==LBRACKET||LA10_0==LCURLY||LA10_0==INT||LA10_0==FLOAT||(LA10_0>=STRING && LA10_0<=URI)||(LA10_0>=75 && LA10_0<=76)||(LA10_0>=79 && LA10_0<=80)) ) { - alt10=1; - } - - - switch (alt10) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:254:10: resource - { - pushFollow(FOLLOW_resource_in_template1535); - resource25=resource(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_resource.add(resource25.getTree()); - - } - break; - - default : - if ( cnt10 >= 1 ) break loop10; - if (state.backtracking>0) {state.failed=true; return retval;} - EarlyExitException eee = - new EarlyExitException(10, input); - throw eee; - } - cnt10++; - } while (true); - - INDENT26=(Token)match(input,INDENT,FOLLOW_INDENT_in_template1545); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_INDENT.add(INDENT26); - - pushFollow(FOLLOW_resourceDefinitions_in_template1547); - resourceDefinitions27=resourceDefinitions(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions27.getTree()); - DEDENT28=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_template1549); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT28); - - - - // AST REWRITE - // elements: resourceDefinitions, resource - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 256:7: -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:256:10: ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TEMPLATE_DEFINITION, "TEMPLATE_DEFINITION"), root_1); - - if ( !(stream_resource.hasNext()) ) { - throw new RewriteEarlyExitException(); - } - while ( stream_resource.hasNext() ) { - adaptor.addChild(root_1, stream_resource.nextTree()); - - } - stream_resource.reset(); - adaptor.addChild(root_1, stream_resourceDefinitions.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:257:7: ( resource )+ ( INDENT resourceDefinitions DEDENT )? - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:257:7: ( resource )+ - int cnt11=0; - loop11: - do { - int alt11=2; - int LA11_0 = input.LA(1); - - if ( (LA11_0==ID||LA11_0==LPAREN||LA11_0==LBRACKET||LA11_0==LCURLY||LA11_0==INT||LA11_0==FLOAT||(LA11_0>=STRING && LA11_0<=URI)||(LA11_0>=75 && LA11_0<=76)||(LA11_0>=79 && LA11_0<=80)) ) { - alt11=1; - } - - - switch (alt11) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:257:7: resource - { - pushFollow(FOLLOW_resource_in_template1574); - resource29=resource(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_resource.add(resource29.getTree()); - - } - break; - - default : - if ( cnt11 >= 1 ) break loop11; - if (state.backtracking>0) {state.failed=true; return retval;} - EarlyExitException eee = - new EarlyExitException(11, input); - throw eee; - } - cnt11++; - } while (true); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:258:7: ( INDENT resourceDefinitions DEDENT )? - int alt12=2; - int LA12_0 = input.LA(1); - - if ( (LA12_0==INDENT) ) { - alt12=1; - } - switch (alt12) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:258:8: INDENT resourceDefinitions DEDENT - { - INDENT30=(Token)match(input,INDENT,FOLLOW_INDENT_in_template1585); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_INDENT.add(INDENT30); - - pushFollow(FOLLOW_resourceDefinitions_in_template1587); - resourceDefinitions31=resourceDefinitions(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions31.getTree()); - DEDENT32=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_template1589); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT32); - - - } - break; - - } - - - - // AST REWRITE - // elements: resource, resourceDefinitions - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 259:7: -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:259:10: ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TEMPLATE_INSTANCE, "TEMPLATE_INSTANCE"), root_1); - - if ( !(stream_resource.hasNext()) ) { - throw new RewriteEarlyExitException(); - } - while ( stream_resource.hasNext() ) { - adaptor.addChild(root_1, stream_resource.nextTree()); - - } - stream_resource.reset(); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:259:40: ( resourceDefinitions )? - if ( stream_resourceDefinitions.hasNext() ) { - adaptor.addChild(root_1, stream_resourceDefinitions.nextTree()); - - } - stream_resourceDefinitions.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - - } - - - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "template" - - public static class relation_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "relation" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:267:1: relation : ( ( ID -> ID ) ( '.' ID -> ^( REF $relation ID ) )* | URI | ' INHERITS | ' SUBRELATION_OF | '<--' -> HAS_DOMAIN | '-->' -> HAS_RANGE | '==>' -> REQUIRES_VALUE_TYPE | '>--' -> DOMAIN_OF | ':' -> INSTANCE_OF | '=' -> EQUALS | '%' ID -> ^( VARIABLE ID ) ); - public final GraphParser.relation_return relation() throws RecognitionException { - GraphParser.relation_return retval = new GraphParser.relation_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token ID33=null; - Token char_literal34=null; - Token ID35=null; - Token URI36=null; - Token string_literal37=null; - Token string_literal38=null; - Token string_literal39=null; - Token string_literal40=null; - Token string_literal41=null; - Token string_literal42=null; - Token char_literal43=null; - Token char_literal44=null; - Token char_literal45=null; - Token ID46=null; - - CommonTree ID33_tree=null; - CommonTree char_literal34_tree=null; - CommonTree ID35_tree=null; - CommonTree URI36_tree=null; - CommonTree string_literal37_tree=null; - CommonTree string_literal38_tree=null; - CommonTree string_literal39_tree=null; - CommonTree string_literal40_tree=null; - CommonTree string_literal41_tree=null; - CommonTree string_literal42_tree=null; - CommonTree char_literal43_tree=null; - CommonTree char_literal44_tree=null; - CommonTree char_literal45_tree=null; - CommonTree ID46_tree=null; - RewriteRuleTokenStream stream_67=new RewriteRuleTokenStream(adaptor,"token 67"); - RewriteRuleTokenStream stream_66=new RewriteRuleTokenStream(adaptor,"token 66"); - RewriteRuleTokenStream stream_69=new RewriteRuleTokenStream(adaptor,"token 69"); - RewriteRuleTokenStream stream_68=new RewriteRuleTokenStream(adaptor,"token 68"); - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - RewriteRuleTokenStream stream_70=new RewriteRuleTokenStream(adaptor,"token 70"); - RewriteRuleTokenStream stream_71=new RewriteRuleTokenStream(adaptor,"token 71"); - RewriteRuleTokenStream stream_72=new RewriteRuleTokenStream(adaptor,"token 72"); - RewriteRuleTokenStream stream_73=new RewriteRuleTokenStream(adaptor,"token 73"); - RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74"); - RewriteRuleTokenStream stream_75=new RewriteRuleTokenStream(adaptor,"token 75"); - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:268:5: ( ( ID -> ID ) ( '.' ID -> ^( REF $relation ID ) )* | URI | ' INHERITS | ' SUBRELATION_OF | '<--' -> HAS_DOMAIN | '-->' -> HAS_RANGE | '==>' -> REQUIRES_VALUE_TYPE | '>--' -> DOMAIN_OF | ':' -> INSTANCE_OF | '=' -> EQUALS | '%' ID -> ^( VARIABLE ID ) ) - int alt15=11; - switch ( input.LA(1) ) { - case ID: - { - alt15=1; - } - break; - case URI: - { - alt15=2; - } - break; - case 67: - { - alt15=3; - } - break; - case 68: - { - alt15=4; - } - break; - case 69: - { - alt15=5; - } - break; - case 70: - { - alt15=6; - } - break; - case 71: - { - alt15=7; - } - break; - case 72: - { - alt15=8; - } - break; - case 73: - { - alt15=9; - } - break; - case 74: - { - alt15=10; - } - break; - case 75: - { - alt15=11; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 15, 0, input); - - throw nvae; - } - - switch (alt15) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:268:7: ( ID -> ID ) ( '.' ID -> ^( REF $relation ID ) )* - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:268:7: ( ID -> ID ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:268:9: ID - { - ID33=(Token)match(input,ID,FOLLOW_ID_in_relation1643); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID33); - - - - // AST REWRITE - // elements: ID - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 268:12: -> ID - { - adaptor.addChild(root_0, stream_ID.nextNode()); - - } - - retval.tree = root_0;} - } - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:269:7: ( '.' ID -> ^( REF $relation ID ) )* - loop14: - do { - int alt14=2; - int LA14_0 = input.LA(1); - - if ( (LA14_0==66) ) { - alt14=1; - } - - - switch (alt14) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:269:8: '.' ID - { - char_literal34=(Token)match(input,66,FOLLOW_66_in_relation1658); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_66.add(char_literal34); - - ID35=(Token)match(input,ID,FOLLOW_ID_in_relation1660); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID35); - - - - // AST REWRITE - // elements: ID, relation - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 269:15: -> ^( REF $relation ID ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:269:18: ^( REF $relation ID ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(REF, "REF"), root_1); - - adaptor.addChild(root_1, stream_retval.nextTree()); - adaptor.addChild(root_1, stream_ID.nextNode()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - - default : - break loop14; - } - } while (true); - - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:270:7: URI - { - root_0 = (CommonTree)adaptor.nil(); - - URI36=(Token)match(input,URI,FOLLOW_URI_in_relation1681); if (state.failed) return retval; - if ( state.backtracking==0 ) { - URI36_tree = (CommonTree)adaptor.create(URI36); - adaptor.addChild(root_0, URI36_tree); - } - - } - break; - case 3 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:271:7: ' INHERITS - { - adaptor.addChild(root_0, (CommonTree)adaptor.create(INHERITS, "INHERITS")); - - } - - retval.tree = root_0;} - } - break; - case 4 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:272:7: ' SUBRELATION_OF - { - adaptor.addChild(root_0, (CommonTree)adaptor.create(SUBRELATION_OF, "SUBRELATION_OF")); - - } - - retval.tree = root_0;} - } - break; - case 5 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:273:7: '<--' - { - string_literal39=(Token)match(input,69,FOLLOW_69_in_relation1713); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_69.add(string_literal39); - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 273:13: -> HAS_DOMAIN - { - adaptor.addChild(root_0, (CommonTree)adaptor.create(HAS_DOMAIN, "HAS_DOMAIN")); - - } - - retval.tree = root_0;} - } - break; - case 6 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:274:7: '-->' - { - string_literal40=(Token)match(input,70,FOLLOW_70_in_relation1725); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_70.add(string_literal40); - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 274:13: -> HAS_RANGE - { - adaptor.addChild(root_0, (CommonTree)adaptor.create(HAS_RANGE, "HAS_RANGE")); - - } - - retval.tree = root_0;} - } - break; - case 7 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:275:7: '==>' - { - string_literal41=(Token)match(input,71,FOLLOW_71_in_relation1737); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_71.add(string_literal41); - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 275:13: -> REQUIRES_VALUE_TYPE - { - adaptor.addChild(root_0, (CommonTree)adaptor.create(REQUIRES_VALUE_TYPE, "REQUIRES_VALUE_TYPE")); - - } - - retval.tree = root_0;} - } - break; - case 8 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:276:7: '>--' - { - string_literal42=(Token)match(input,72,FOLLOW_72_in_relation1749); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_72.add(string_literal42); - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 276:13: -> DOMAIN_OF - { - adaptor.addChild(root_0, (CommonTree)adaptor.create(DOMAIN_OF, "DOMAIN_OF")); - - } - - retval.tree = root_0;} - } - break; - case 9 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:277:7: ':' - { - char_literal43=(Token)match(input,73,FOLLOW_73_in_relation1765); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_73.add(char_literal43); - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 277:11: -> INSTANCE_OF - { - adaptor.addChild(root_0, (CommonTree)adaptor.create(INSTANCE_OF, "INSTANCE_OF")); - - } - - retval.tree = root_0;} - } - break; - case 10 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:278:7: '=' - { - char_literal44=(Token)match(input,74,FOLLOW_74_in_relation1777); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_74.add(char_literal44); - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 278:11: -> EQUALS - { - adaptor.addChild(root_0, (CommonTree)adaptor.create(EQUALS, "EQUALS")); - - } - - retval.tree = root_0;} - } - break; - case 11 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:279:7: '%' ID - { - char_literal45=(Token)match(input,75,FOLLOW_75_in_relation1789); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_75.add(char_literal45); - - ID46=(Token)match(input,ID,FOLLOW_ID_in_relation1791); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID46); - - - - // AST REWRITE - // elements: ID - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 279:14: -> ^( VARIABLE ID ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:279:17: ^( VARIABLE ID ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIABLE, "VARIABLE"), root_1); - - adaptor.addChild(root_1, stream_ID.nextNode()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "relation" - - public static class resource_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "resource" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:282:1: resource : ( ({...}? => ID -> ^( BLANK ID ) | ID -> ID ) ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )* | URI | simpleValue -> ^( EMBEDDED_VALUE simpleValue ) | '$' basicType -> ^( EMBEDDED_TYPE basicType ) | '%' ID -> ^( VARIABLE ID ) ); - public final GraphParser.resource_return resource() throws RecognitionException { - GraphParser.resource_return retval = new GraphParser.resource_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token ID47=null; - Token ID48=null; - Token char_literal49=null; - Token ID50=null; - Token STRING51=null; - Token URI52=null; - Token char_literal54=null; - Token char_literal56=null; - Token ID57=null; - GraphParser.simpleValue_return simpleValue53 = null; - - GraphParser.basicType_return basicType55 = null; - - - CommonTree ID47_tree=null; - CommonTree ID48_tree=null; - CommonTree char_literal49_tree=null; - CommonTree ID50_tree=null; - CommonTree STRING51_tree=null; - CommonTree URI52_tree=null; - CommonTree char_literal54_tree=null; - CommonTree char_literal56_tree=null; - CommonTree ID57_tree=null; - RewriteRuleTokenStream stream_66=new RewriteRuleTokenStream(adaptor,"token 66"); - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - RewriteRuleTokenStream stream_75=new RewriteRuleTokenStream(adaptor,"token 75"); - RewriteRuleTokenStream stream_STRING=new RewriteRuleTokenStream(adaptor,"token STRING"); - RewriteRuleTokenStream stream_76=new RewriteRuleTokenStream(adaptor,"token 76"); - RewriteRuleSubtreeStream stream_basicType=new RewriteRuleSubtreeStream(adaptor,"rule basicType"); - RewriteRuleSubtreeStream stream_simpleValue=new RewriteRuleSubtreeStream(adaptor,"rule simpleValue"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:283:5: ( ({...}? => ID -> ^( BLANK ID ) | ID -> ID ) ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )* | URI | simpleValue -> ^( EMBEDDED_VALUE simpleValue ) | '$' basicType -> ^( EMBEDDED_TYPE basicType ) | '%' ID -> ^( VARIABLE ID ) ) - int alt19=5; - switch ( input.LA(1) ) { - case ID: - { - alt19=1; - } - break; - case URI: - { - alt19=2; - } - break; - case LPAREN: - case LBRACKET: - case LCURLY: - case INT: - case FLOAT: - case STRING: - case 79: - case 80: - { - alt19=3; - } - break; - case 76: - { - alt19=4; - } - break; - case 75: - { - alt19=5; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 19, 0, input); - - throw nvae; - } - - switch (alt19) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:283:7: ({...}? => ID -> ^( BLANK ID ) | ID -> ID ) ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )* - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:283:7: ({...}? => ID -> ^( BLANK ID ) | ID -> ID ) - int alt16=2; - int LA16_0 = input.LA(1); - - if ( (LA16_0==ID) ) { - int LA16_1 = input.LA(2); - - if ( ((input.LT(1).getText().equals("_"))) ) { - alt16=1; - } - else if ( (true) ) { - alt16=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 16, 1, input); - - throw nvae; - } - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 16, 0, input); - - throw nvae; - } - switch (alt16) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:283:9: {...}? => ID - { - if ( !((input.LT(1).getText().equals("_"))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "resource", "input.LT(1).getText().equals(\"_\")"); - } - ID47=(Token)match(input,ID,FOLLOW_ID_in_resource1821); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID47); - - - - // AST REWRITE - // elements: ID - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 283:51: -> ^( BLANK ID ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:283:54: ^( BLANK ID ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(BLANK, "BLANK"), root_1); - - adaptor.addChild(root_1, stream_ID.nextNode()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:284:9: ID - { - ID48=(Token)match(input,ID,FOLLOW_ID_in_resource1840); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID48); - - - - // AST REWRITE - // elements: ID - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 284:12: -> ID - { - adaptor.addChild(root_0, stream_ID.nextNode()); - - } - - retval.tree = root_0;} - } - break; - - } - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:285:7: ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )* - loop18: - do { - int alt18=2; - int LA18_0 = input.LA(1); - - if ( (LA18_0==66) ) { - alt18=1; - } - - - switch (alt18) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:285:8: '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) - { - char_literal49=(Token)match(input,66,FOLLOW_66_in_resource1855); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_66.add(char_literal49); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:285:12: ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) - int alt17=2; - int LA17_0 = input.LA(1); - - if ( (LA17_0==ID) ) { - alt17=1; - } - else if ( (LA17_0==STRING) ) { - alt17=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 17, 0, input); - - throw nvae; - } - switch (alt17) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:285:13: ID - { - ID50=(Token)match(input,ID,FOLLOW_ID_in_resource1858); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID50); - - - - // AST REWRITE - // elements: ID, resource - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 285:16: -> ^( REF $resource ID ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:285:19: ^( REF $resource ID ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(REF, "REF"), root_1); - - adaptor.addChild(root_1, stream_retval.nextTree()); - adaptor.addChild(root_1, stream_ID.nextNode()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:286:13: STRING - { - STRING51=(Token)match(input,STRING,FOLLOW_STRING_in_resource1883); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_STRING.add(STRING51); - - - - // AST REWRITE - // elements: STRING, resource - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 286:20: -> ^( REF $resource STRING ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:286:23: ^( REF $resource STRING ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(REF, "REF"), root_1); - - adaptor.addChild(root_1, stream_retval.nextTree()); - adaptor.addChild(root_1, stream_STRING.nextNode()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - - } - - - } - break; - - default : - break loop18; - } - } while (true); - - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:289:7: URI - { - root_0 = (CommonTree)adaptor.nil(); - - URI52=(Token)match(input,URI,FOLLOW_URI_in_resource1924); if (state.failed) return retval; - if ( state.backtracking==0 ) { - URI52_tree = (CommonTree)adaptor.create(URI52); - adaptor.addChild(root_0, URI52_tree); - } - - } - break; - case 3 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:290:7: simpleValue - { - pushFollow(FOLLOW_simpleValue_in_resource1932); - simpleValue53=simpleValue(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_simpleValue.add(simpleValue53.getTree()); - - - // AST REWRITE - // elements: simpleValue - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 290:19: -> ^( EMBEDDED_VALUE simpleValue ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:290:22: ^( EMBEDDED_VALUE simpleValue ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(EMBEDDED_VALUE, "EMBEDDED_VALUE"), root_1); - - adaptor.addChild(root_1, stream_simpleValue.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - case 4 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:291:7: '$' basicType - { - char_literal54=(Token)match(input,76,FOLLOW_76_in_resource1948); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_76.add(char_literal54); - - pushFollow(FOLLOW_basicType_in_resource1950); - basicType55=basicType(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_basicType.add(basicType55.getTree()); - - - // AST REWRITE - // elements: basicType - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 291:21: -> ^( EMBEDDED_TYPE basicType ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:291:24: ^( EMBEDDED_TYPE basicType ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(EMBEDDED_TYPE, "EMBEDDED_TYPE"), root_1); - - adaptor.addChild(root_1, stream_basicType.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - case 5 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:292:7: '%' ID - { - char_literal56=(Token)match(input,75,FOLLOW_75_in_resource1966); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_75.add(char_literal56); - - ID57=(Token)match(input,ID,FOLLOW_ID_in_resource1968); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID57); - - - - // AST REWRITE - // elements: ID - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 292:14: -> ^( VARIABLE ID ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:292:17: ^( VARIABLE ID ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIABLE, "VARIABLE"), root_1); - - adaptor.addChild(root_1, stream_ID.nextNode()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "resource" - - public static class type_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "type" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:306:1: type : ( arrayType | unionType ); - public final GraphParser.type_return type() throws RecognitionException { - GraphParser.type_return retval = new GraphParser.type_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - GraphParser.arrayType_return arrayType58 = null; - - GraphParser.unionType_return unionType59 = null; - - - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:307:5: ( arrayType | unionType ) - int alt20=2; - int LA20_0 = input.LA(1); - - if ( (LA20_0==ID||LA20_0==LPAREN||LA20_0==LCURLY) ) { - alt20=1; - } - else if ( (LA20_0==77) ) { - alt20=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 20, 0, input); - - throw nvae; - } - switch (alt20) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:307:7: arrayType - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_arrayType_in_type2004); - arrayType58=arrayType(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, arrayType58.getTree()); - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:308:7: unionType - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_unionType_in_type2012); - unionType59=unionType(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, unionType59.getTree()); - - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "type" - - public static class unionType_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "unionType" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:311:1: unionType : ( '|' unionComponent )+ -> ^( UNION_TYPE ( unionComponent )+ ) ; - public final GraphParser.unionType_return unionType() throws RecognitionException { - GraphParser.unionType_return retval = new GraphParser.unionType_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token char_literal60=null; - GraphParser.unionComponent_return unionComponent61 = null; - - - CommonTree char_literal60_tree=null; - RewriteRuleTokenStream stream_77=new RewriteRuleTokenStream(adaptor,"token 77"); - RewriteRuleSubtreeStream stream_unionComponent=new RewriteRuleSubtreeStream(adaptor,"rule unionComponent"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:312:5: ( ( '|' unionComponent )+ -> ^( UNION_TYPE ( unionComponent )+ ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:313:6: ( '|' unionComponent )+ - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:313:6: ( '|' unionComponent )+ - int cnt21=0; - loop21: - do { - int alt21=2; - int LA21_0 = input.LA(1); - - if ( (LA21_0==77) ) { - alt21=1; - } - - - switch (alt21) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:313:7: '|' unionComponent - { - char_literal60=(Token)match(input,77,FOLLOW_77_in_unionType2041); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_77.add(char_literal60); - - pushFollow(FOLLOW_unionComponent_in_unionType2043); - unionComponent61=unionComponent(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_unionComponent.add(unionComponent61.getTree()); - - } - break; - - default : - if ( cnt21 >= 1 ) break loop21; - if (state.backtracking>0) {state.failed=true; return retval;} - EarlyExitException eee = - new EarlyExitException(21, input); - throw eee; - } - cnt21++; - } while (true); - - - - // AST REWRITE - // elements: unionComponent - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 314:5: -> ^( UNION_TYPE ( unionComponent )+ ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:314:8: ^( UNION_TYPE ( unionComponent )+ ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNION_TYPE, "UNION_TYPE"), root_1); - - if ( !(stream_unionComponent.hasNext()) ) { - throw new RewriteEarlyExitException(); - } - while ( stream_unionComponent.hasNext() ) { - adaptor.addChild(root_1, stream_unionComponent.nextTree()); - - } - stream_unionComponent.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "unionType" - - public static class unionComponent_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "unionComponent" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:1: unionComponent : ID ( ( arrayType )=> arrayType )? -> ^( TYPE_COMPONENT ID ( arrayType )? ) ; - public final GraphParser.unionComponent_return unionComponent() throws RecognitionException { - GraphParser.unionComponent_return retval = new GraphParser.unionComponent_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token ID62=null; - GraphParser.arrayType_return arrayType63 = null; - - - CommonTree ID62_tree=null; - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - RewriteRuleSubtreeStream stream_arrayType=new RewriteRuleSubtreeStream(adaptor,"rule arrayType"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:16: ( ID ( ( arrayType )=> arrayType )? -> ^( TYPE_COMPONENT ID ( arrayType )? ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:18: ID ( ( arrayType )=> arrayType )? - { - ID62=(Token)match(input,ID,FOLLOW_ID_in_unionComponent2071); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID62); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:21: ( ( arrayType )=> arrayType )? - int alt22=2; - alt22 = dfa22.predict(input); - switch (alt22) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:22: ( arrayType )=> arrayType - { - pushFollow(FOLLOW_arrayType_in_unionComponent2080); - arrayType63=arrayType(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_arrayType.add(arrayType63.getTree()); - - } - break; - - } - - - - // AST REWRITE - // elements: ID, arrayType - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 317:49: -> ^( TYPE_COMPONENT ID ( arrayType )? ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:52: ^( TYPE_COMPONENT ID ( arrayType )? ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_COMPONENT, "TYPE_COMPONENT"), root_1); - - adaptor.addChild(root_1, stream_ID.nextNode()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:72: ( arrayType )? - if ( stream_arrayType.hasNext() ) { - adaptor.addChild(root_1, stream_arrayType.nextTree()); - - } - stream_arrayType.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "unionComponent" - - public static class arrayType_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "arrayType" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:319:1: arrayType : ( basicType -> basicType ) ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )* ; - public final GraphParser.arrayType_return arrayType() throws RecognitionException { - GraphParser.arrayType_return retval = new GraphParser.arrayType_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token LBRACKET65=null; - Token RBRACKET67=null; - GraphParser.basicType_return basicType64 = null; - - GraphParser.arrayLength_return arrayLength66 = null; - - - CommonTree LBRACKET65_tree=null; - CommonTree RBRACKET67_tree=null; - RewriteRuleTokenStream stream_LBRACKET=new RewriteRuleTokenStream(adaptor,"token LBRACKET"); - RewriteRuleTokenStream stream_RBRACKET=new RewriteRuleTokenStream(adaptor,"token RBRACKET"); - RewriteRuleSubtreeStream stream_arrayLength=new RewriteRuleSubtreeStream(adaptor,"rule arrayLength"); - RewriteRuleSubtreeStream stream_basicType=new RewriteRuleSubtreeStream(adaptor,"rule basicType"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:320:5: ( ( basicType -> basicType ) ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )* ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:320:7: ( basicType -> basicType ) ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )* - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:320:7: ( basicType -> basicType ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:320:8: basicType - { - pushFollow(FOLLOW_basicType_in_arrayType2108); - basicType64=basicType(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_basicType.add(basicType64.getTree()); - - - // AST REWRITE - // elements: basicType - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 320:18: -> basicType - { - adaptor.addChild(root_0, stream_basicType.nextTree()); - - } - - retval.tree = root_0;} - } - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:7: ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )* - loop24: - do { - int alt24=2; - int LA24_0 = input.LA(1); - - if ( (LA24_0==LBRACKET) ) { - alt24=1; - } - - - switch (alt24) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:8: LBRACKET ( arrayLength )? RBRACKET - { - LBRACKET65=(Token)match(input,LBRACKET,FOLLOW_LBRACKET_in_arrayType2122); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_LBRACKET.add(LBRACKET65); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:17: ( arrayLength )? - int alt23=2; - int LA23_0 = input.LA(1); - - if ( ((LA23_0>=INT && LA23_0<=INT_RANGE)) ) { - alt23=1; - } - switch (alt23) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:17: arrayLength - { - pushFollow(FOLLOW_arrayLength_in_arrayType2124); - arrayLength66=arrayLength(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_arrayLength.add(arrayLength66.getTree()); - - } - break; - - } - - RBRACKET67=(Token)match(input,RBRACKET,FOLLOW_RBRACKET_in_arrayType2127); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_RBRACKET.add(RBRACKET67); - - - - // AST REWRITE - // elements: arrayType, arrayLength - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 321:39: -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:42: ^( ARRAY_TYPE $arrayType ( arrayLength )? ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ARRAY_TYPE, "ARRAY_TYPE"), root_1); - - adaptor.addChild(root_1, stream_retval.nextTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:321:66: ( arrayLength )? - if ( stream_arrayLength.hasNext() ) { - adaptor.addChild(root_1, stream_arrayLength.nextTree()); - - } - stream_arrayLength.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - - default : - break loop24; - } - } while (true); - - - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "arrayType" - - public static class arrayLength_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "arrayLength" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:323:1: arrayLength : ( INT | INT_RANGE ); - public final GraphParser.arrayLength_return arrayLength() throws RecognitionException { - GraphParser.arrayLength_return retval = new GraphParser.arrayLength_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token set68=null; - - CommonTree set68_tree=null; - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:324:5: ( INT | INT_RANGE ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g: - { - root_0 = (CommonTree)adaptor.nil(); - - set68=(Token)input.LT(1); - if ( (input.LA(1)>=INT && input.LA(1)<=INT_RANGE) ) { - input.consume(); - if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set68)); - state.errorRecovery=false;state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - - - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "arrayLength" - - public static class basicType_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "basicType" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:328:1: basicType : ( tupleType | recordType | typeReference ); - public final GraphParser.basicType_return basicType() throws RecognitionException { - GraphParser.basicType_return retval = new GraphParser.basicType_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - GraphParser.tupleType_return tupleType69 = null; - - GraphParser.recordType_return recordType70 = null; - - GraphParser.typeReference_return typeReference71 = null; - - - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:329:5: ( tupleType | recordType | typeReference ) - int alt25=3; - switch ( input.LA(1) ) { - case LPAREN: - { - alt25=1; - } - break; - case LCURLY: - { - alt25=2; - } - break; - case ID: - { - alt25=3; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 25, 0, input); - - throw nvae; - } - - switch (alt25) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:329:7: tupleType - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_tupleType_in_basicType2181); - tupleType69=tupleType(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, tupleType69.getTree()); - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:330:7: recordType - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_recordType_in_basicType2189); - recordType70=recordType(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, recordType70.getTree()); - - } - break; - case 3 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:331:7: typeReference - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_typeReference_in_basicType2197); - typeReference71=typeReference(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, typeReference71.getTree()); - - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "basicType" - - public static class tupleType_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "tupleType" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:334:1: tupleType : LPAREN ( type ( ',' type )* )? RPAREN -> ^( TUPLE_TYPE ( type )* ) ; - public final GraphParser.tupleType_return tupleType() throws RecognitionException { - GraphParser.tupleType_return retval = new GraphParser.tupleType_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token LPAREN72=null; - Token char_literal74=null; - Token RPAREN76=null; - GraphParser.type_return type73 = null; - - GraphParser.type_return type75 = null; - - - CommonTree LPAREN72_tree=null; - CommonTree char_literal74_tree=null; - CommonTree RPAREN76_tree=null; - RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78"); - RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN"); - RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN"); - RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:5: ( LPAREN ( type ( ',' type )* )? RPAREN -> ^( TUPLE_TYPE ( type )* ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:7: LPAREN ( type ( ',' type )* )? RPAREN - { - LPAREN72=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_tupleType2219); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN72); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:14: ( type ( ',' type )* )? - int alt27=2; - int LA27_0 = input.LA(1); - - if ( (LA27_0==ID||LA27_0==LPAREN||LA27_0==LCURLY||LA27_0==77) ) { - alt27=1; - } - switch (alt27) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:15: type ( ',' type )* - { - pushFollow(FOLLOW_type_in_tupleType2222); - type73=type(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_type.add(type73.getTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:20: ( ',' type )* - loop26: - do { - int alt26=2; - int LA26_0 = input.LA(1); - - if ( (LA26_0==78) ) { - alt26=1; - } - - - switch (alt26) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:335:21: ',' type - { - char_literal74=(Token)match(input,78,FOLLOW_78_in_tupleType2225); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_78.add(char_literal74); - - pushFollow(FOLLOW_type_in_tupleType2227); - type75=type(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_type.add(type75.getTree()); - - } - break; - - default : - break loop26; - } - } while (true); - - - } - break; - - } - - RPAREN76=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_tupleType2233); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN76); - - - - // AST REWRITE - // elements: type - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 336:5: -> ^( TUPLE_TYPE ( type )* ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:336:8: ^( TUPLE_TYPE ( type )* ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TUPLE_TYPE, "TUPLE_TYPE"), root_1); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:336:21: ( type )* - while ( stream_type.hasNext() ) { - adaptor.addChild(root_1, stream_type.nextTree()); - - } - stream_type.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "tupleType" - - public static class recordType_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "recordType" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:339:1: recordType : LCURLY ( component ( ',' component )* )? RCURLY -> ^( RECORD_TYPE ( component )* ) ; - public final GraphParser.recordType_return recordType() throws RecognitionException { - GraphParser.recordType_return retval = new GraphParser.recordType_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token LCURLY77=null; - Token char_literal79=null; - Token RCURLY81=null; - GraphParser.component_return component78 = null; - - GraphParser.component_return component80 = null; - - - CommonTree LCURLY77_tree=null; - CommonTree char_literal79_tree=null; - CommonTree RCURLY81_tree=null; - RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78"); - RewriteRuleTokenStream stream_LCURLY=new RewriteRuleTokenStream(adaptor,"token LCURLY"); - RewriteRuleTokenStream stream_RCURLY=new RewriteRuleTokenStream(adaptor,"token RCURLY"); - RewriteRuleSubtreeStream stream_component=new RewriteRuleSubtreeStream(adaptor,"rule component"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:5: ( LCURLY ( component ( ',' component )* )? RCURLY -> ^( RECORD_TYPE ( component )* ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:7: LCURLY ( component ( ',' component )* )? RCURLY - { - LCURLY77=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_recordType2266); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_LCURLY.add(LCURLY77); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:14: ( component ( ',' component )* )? - int alt29=2; - int LA29_0 = input.LA(1); - - if ( (LA29_0==ID) ) { - alt29=1; - } - switch (alt29) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:15: component ( ',' component )* - { - pushFollow(FOLLOW_component_in_recordType2269); - component78=component(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_component.add(component78.getTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:25: ( ',' component )* - loop28: - do { - int alt28=2; - int LA28_0 = input.LA(1); - - if ( (LA28_0==78) ) { - alt28=1; - } - - - switch (alt28) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:340:26: ',' component - { - char_literal79=(Token)match(input,78,FOLLOW_78_in_recordType2272); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_78.add(char_literal79); - - pushFollow(FOLLOW_component_in_recordType2274); - component80=component(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_component.add(component80.getTree()); - - } - break; - - default : - break loop28; - } - } while (true); - - - } - break; - - } - - RCURLY81=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_recordType2280); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_RCURLY.add(RCURLY81); - - - - // AST REWRITE - // elements: component - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 341:5: -> ^( RECORD_TYPE ( component )* ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:341:8: ^( RECORD_TYPE ( component )* ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RECORD_TYPE, "RECORD_TYPE"), root_1); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:341:22: ( component )* - while ( stream_component.hasNext() ) { - adaptor.addChild(root_1, stream_component.nextTree()); - - } - stream_component.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "recordType" - - public static class component_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "component" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:344:1: component : ID ':' type -> ^( TYPE_COMPONENT ID type ) ; - public final GraphParser.component_return component() throws RecognitionException { - GraphParser.component_return retval = new GraphParser.component_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token ID82=null; - Token char_literal83=null; - GraphParser.type_return type84 = null; - - - CommonTree ID82_tree=null; - CommonTree char_literal83_tree=null; - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - RewriteRuleTokenStream stream_73=new RewriteRuleTokenStream(adaptor,"token 73"); - RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:345:5: ( ID ':' type -> ^( TYPE_COMPONENT ID type ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:345:7: ID ':' type - { - ID82=(Token)match(input,ID,FOLLOW_ID_in_component2312); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID82); - - char_literal83=(Token)match(input,73,FOLLOW_73_in_component2314); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_73.add(char_literal83); - - pushFollow(FOLLOW_type_in_component2316); - type84=type(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_type.add(type84.getTree()); - - - // AST REWRITE - // elements: type, ID - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 346:5: -> ^( TYPE_COMPONENT ID type ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:346:8: ^( TYPE_COMPONENT ID type ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_COMPONENT, "TYPE_COMPONENT"), root_1); - - adaptor.addChild(root_1, stream_ID.nextNode()); - adaptor.addChild(root_1, stream_type.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "component" - - public static class typeReference_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "typeReference" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:349:1: typeReference : ID ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )? -> ^( TYPE_REFERENCE ID ( parameter )* ) ; - public final GraphParser.typeReference_return typeReference() throws RecognitionException { - GraphParser.typeReference_return retval = new GraphParser.typeReference_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token ID85=null; - Token LPAREN86=null; - Token char_literal88=null; - Token RPAREN90=null; - GraphParser.parameter_return parameter87 = null; - - GraphParser.parameter_return parameter89 = null; - - - CommonTree ID85_tree=null; - CommonTree LPAREN86_tree=null; - CommonTree char_literal88_tree=null; - CommonTree RPAREN90_tree=null; - RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78"); - RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN"); - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN"); - RewriteRuleSubtreeStream stream_parameter=new RewriteRuleSubtreeStream(adaptor,"rule parameter"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:5: ( ID ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )? -> ^( TYPE_REFERENCE ID ( parameter )* ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:7: ID ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )? - { - ID85=(Token)match(input,ID,FOLLOW_ID_in_typeReference2350); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID85); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:10: ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )? - int alt31=2; - alt31 = dfa31.predict(input); - switch (alt31) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:11: ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN - { - LPAREN86=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_typeReference2358); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN86); - - pushFollow(FOLLOW_parameter_in_typeReference2360); - parameter87=parameter(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_parameter.add(parameter87.getTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:39: ( ',' parameter )* - loop30: - do { - int alt30=2; - int LA30_0 = input.LA(1); - - if ( (LA30_0==78) ) { - alt30=1; - } - - - switch (alt30) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:40: ',' parameter - { - char_literal88=(Token)match(input,78,FOLLOW_78_in_typeReference2363); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_78.add(char_literal88); - - pushFollow(FOLLOW_parameter_in_typeReference2365); - parameter89=parameter(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_parameter.add(parameter89.getTree()); - - } - break; - - default : - break loop30; - } - } while (true); - - RPAREN90=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_typeReference2369); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN90); - - - } - break; - - } - - - - // AST REWRITE - // elements: ID, parameter - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 351:5: -> ^( TYPE_REFERENCE ID ( parameter )* ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:351:8: ^( TYPE_REFERENCE ID ( parameter )* ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_REFERENCE, "TYPE_REFERENCE"), root_1); - - adaptor.addChild(root_1, stream_ID.nextNode()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:351:28: ( parameter )* - while ( stream_parameter.hasNext() ) { - adaptor.addChild(root_1, stream_parameter.nextTree()); - - } - stream_parameter.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "typeReference" - - public static class parameter_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "parameter" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:354:1: parameter : ( ID '=' parameterValue -> ^( TYPE_ANNOTATION ID parameterValue ) | type ); - public final GraphParser.parameter_return parameter() throws RecognitionException { - GraphParser.parameter_return retval = new GraphParser.parameter_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token ID91=null; - Token char_literal92=null; - GraphParser.parameterValue_return parameterValue93 = null; - - GraphParser.type_return type94 = null; - - - CommonTree ID91_tree=null; - CommonTree char_literal92_tree=null; - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74"); - RewriteRuleSubtreeStream stream_parameterValue=new RewriteRuleSubtreeStream(adaptor,"rule parameterValue"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:355:5: ( ID '=' parameterValue -> ^( TYPE_ANNOTATION ID parameterValue ) | type ) - int alt32=2; - int LA32_0 = input.LA(1); - - if ( (LA32_0==ID) ) { - int LA32_1 = input.LA(2); - - if ( (LA32_1==74) ) { - alt32=1; - } - else if ( ((LA32_1>=LPAREN && LA32_1<=LBRACKET)||LA32_1==78) ) { - alt32=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 32, 1, input); - - throw nvae; - } - } - else if ( (LA32_0==LPAREN||LA32_0==LCURLY||LA32_0==77) ) { - alt32=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 32, 0, input); - - throw nvae; - } - switch (alt32) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:355:7: ID '=' parameterValue - { - ID91=(Token)match(input,ID,FOLLOW_ID_in_parameter2405); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID91); - - char_literal92=(Token)match(input,74,FOLLOW_74_in_parameter2407); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_74.add(char_literal92); - - pushFollow(FOLLOW_parameterValue_in_parameter2409); - parameterValue93=parameterValue(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_parameterValue.add(parameterValue93.getTree()); - - - // AST REWRITE - // elements: ID, parameterValue - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 355:29: -> ^( TYPE_ANNOTATION ID parameterValue ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:355:32: ^( TYPE_ANNOTATION ID parameterValue ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_ANNOTATION, "TYPE_ANNOTATION"), root_1); - - adaptor.addChild(root_1, stream_ID.nextNode()); - adaptor.addChild(root_1, stream_parameterValue.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:356:7: type - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_type_in_parameter2427); - type94=type(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, type94.getTree()); - - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "parameter" - - public static class parameterValue_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "parameterValue" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:359:1: parameterValue : ( string | boolean_ | number | rangePar -> ^( RANGE rangePar ) ); - public final GraphParser.parameterValue_return parameterValue() throws RecognitionException { - GraphParser.parameterValue_return retval = new GraphParser.parameterValue_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - GraphParser.string_return string95 = null; - - GraphParser.boolean__return boolean_96 = null; - - GraphParser.number_return number97 = null; - - GraphParser.rangePar_return rangePar98 = null; - - - RewriteRuleSubtreeStream stream_rangePar=new RewriteRuleSubtreeStream(adaptor,"rule rangePar"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:360:5: ( string | boolean_ | number | rangePar -> ^( RANGE rangePar ) ) - int alt33=4; - switch ( input.LA(1) ) { - case STRING: - { - alt33=1; - } - break; - case 79: - case 80: - { - alt33=2; - } - break; - case INT: - case FLOAT: - { - alt33=3; - } - break; - case LPAREN: - case LBRACKET: - { - alt33=4; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 33, 0, input); - - throw nvae; - } - - switch (alt33) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:360:7: string - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_string_in_parameterValue2446); - string95=string(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, string95.getTree()); - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:361:7: boolean_ - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_boolean__in_parameterValue2454); - boolean_96=boolean_(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, boolean_96.getTree()); - - } - break; - case 3 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:362:7: number - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_number_in_parameterValue2462); - number97=number(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, number97.getTree()); - - } - break; - case 4 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:363:7: rangePar - { - pushFollow(FOLLOW_rangePar_in_parameterValue2470); - rangePar98=rangePar(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_rangePar.add(rangePar98.getTree()); - - - // AST REWRITE - // elements: rangePar - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 363:16: -> ^( RANGE rangePar ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:363:19: ^( RANGE rangePar ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RANGE, "RANGE"), root_1); - - adaptor.addChild(root_1, stream_rangePar.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "parameterValue" - - public static class rangePar_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "rangePar" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:366:1: rangePar : ( LBRACKET | LPAREN ) range ( RBRACKET | RPAREN ) ; - public final GraphParser.rangePar_return rangePar() throws RecognitionException { - GraphParser.rangePar_return retval = new GraphParser.rangePar_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token set99=null; - Token set101=null; - GraphParser.range_return range100 = null; - - - CommonTree set99_tree=null; - CommonTree set101_tree=null; - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:366:10: ( ( LBRACKET | LPAREN ) range ( RBRACKET | RPAREN ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:366:12: ( LBRACKET | LPAREN ) range ( RBRACKET | RPAREN ) - { - root_0 = (CommonTree)adaptor.nil(); - - set99=(Token)input.LT(1); - if ( input.LA(1)==LPAREN||input.LA(1)==LBRACKET ) { - input.consume(); - if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set99)); - state.errorRecovery=false;state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - - pushFollow(FOLLOW_range_in_rangePar2507); - range100=range(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, range100.getTree()); - set101=(Token)input.LT(1); - if ( input.LA(1)==RPAREN||input.LA(1)==RBRACKET ) { - input.consume(); - if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set101)); - state.errorRecovery=false;state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - - - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "rangePar" - - public static class range_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "range" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:368:1: range : ( number | RANGE | INT_RANGE ); - public final GraphParser.range_return range() throws RecognitionException { - GraphParser.range_return retval = new GraphParser.range_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token RANGE103=null; - Token INT_RANGE104=null; - GraphParser.number_return number102 = null; - - - CommonTree RANGE103_tree=null; - CommonTree INT_RANGE104_tree=null; - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:369:5: ( number | RANGE | INT_RANGE ) - int alt34=3; - switch ( input.LA(1) ) { - case INT: - case FLOAT: - { - alt34=1; - } - break; - case RANGE: - { - alt34=2; - } - break; - case INT_RANGE: - { - alt34=3; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 34, 0, input); - - throw nvae; - } - - switch (alt34) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:369:7: number - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_number_in_range2536); - number102=number(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, number102.getTree()); - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:370:7: RANGE - { - root_0 = (CommonTree)adaptor.nil(); - - RANGE103=(Token)match(input,RANGE,FOLLOW_RANGE_in_range2544); if (state.failed) return retval; - if ( state.backtracking==0 ) { - RANGE103_tree = (CommonTree)adaptor.create(RANGE103); - adaptor.addChild(root_0, RANGE103_tree); - } - - } - break; - case 3 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:371:7: INT_RANGE - { - root_0 = (CommonTree)adaptor.nil(); - - INT_RANGE104=(Token)match(input,INT_RANGE,FOLLOW_INT_RANGE_in_range2552); if (state.failed) return retval; - if ( state.backtracking==0 ) { - INT_RANGE104_tree = (CommonTree)adaptor.create(INT_RANGE104); - adaptor.addChild(root_0, INT_RANGE104_tree); - } - - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "range" - - public static class number_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "number" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:374:1: number : ( INT | FLOAT ); - public final GraphParser.number_return number() throws RecognitionException { - GraphParser.number_return retval = new GraphParser.number_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token set105=null; - - CommonTree set105_tree=null; - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:375:5: ( INT | FLOAT ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g: - { - root_0 = (CommonTree)adaptor.nil(); - - set105=(Token)input.LT(1); - if ( input.LA(1)==INT||input.LA(1)==FLOAT ) { - input.consume(); - if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set105)); - state.errorRecovery=false;state.failed=false; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - MismatchedSetException mse = new MismatchedSetException(null,input); - throw mse; - } - - - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "number" - - public static class string_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "string" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:379:1: string : STRING ; - public final GraphParser.string_return string() throws RecognitionException { - GraphParser.string_return retval = new GraphParser.string_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token STRING106=null; - - CommonTree STRING106_tree=null; - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:380:5: ( STRING ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:380:7: STRING - { - root_0 = (CommonTree)adaptor.nil(); - - STRING106=(Token)match(input,STRING,FOLLOW_STRING_in_string2606); if (state.failed) return retval; - if ( state.backtracking==0 ) { - STRING106_tree = (CommonTree)adaptor.create(STRING106); - adaptor.addChild(root_0, STRING106_tree); - } - - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "string" - - public static class boolean__return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "boolean_" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:383:1: boolean_ : ( 'true' -> TRUE | 'false' -> FALSE ); - public final GraphParser.boolean__return boolean_() throws RecognitionException { - GraphParser.boolean__return retval = new GraphParser.boolean__return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token string_literal107=null; - Token string_literal108=null; - - CommonTree string_literal107_tree=null; - CommonTree string_literal108_tree=null; - RewriteRuleTokenStream stream_79=new RewriteRuleTokenStream(adaptor,"token 79"); - RewriteRuleTokenStream stream_80=new RewriteRuleTokenStream(adaptor,"token 80"); - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:384:5: ( 'true' -> TRUE | 'false' -> FALSE ) - int alt35=2; - int LA35_0 = input.LA(1); - - if ( (LA35_0==79) ) { - alt35=1; - } - else if ( (LA35_0==80) ) { - alt35=2; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 35, 0, input); - - throw nvae; - } - switch (alt35) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:384:7: 'true' - { - string_literal107=(Token)match(input,79,FOLLOW_79_in_boolean_2627); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_79.add(string_literal107); - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 384:14: -> TRUE - { - adaptor.addChild(root_0, (CommonTree)adaptor.create(TRUE, "TRUE")); - - } - - retval.tree = root_0;} - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:385:7: 'false' - { - string_literal108=(Token)match(input,80,FOLLOW_80_in_boolean_2639); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_80.add(string_literal108); - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 385:15: -> FALSE - { - adaptor.addChild(root_0, (CommonTree)adaptor.create(FALSE, "FALSE")); - - } - - retval.tree = root_0;} - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "boolean_" - - public static class valueDefinitions_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "valueDefinitions" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:1: valueDefinitions : ( valueDefinition )* -> ^( VALUE_DEFINITIONS ( valueDefinition )* ) ; - public final GraphParser.valueDefinitions_return valueDefinitions() throws RecognitionException { - GraphParser.valueDefinitions_return retval = new GraphParser.valueDefinitions_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - GraphParser.valueDefinition_return valueDefinition109 = null; - - - RewriteRuleSubtreeStream stream_valueDefinition=new RewriteRuleSubtreeStream(adaptor,"rule valueDefinition"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:18: ( ( valueDefinition )* -> ^( VALUE_DEFINITIONS ( valueDefinition )* ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:20: ( valueDefinition )* - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:20: ( valueDefinition )* - loop36: - do { - int alt36=2; - int LA36_0 = input.LA(1); - - if ( (LA36_0==ID) ) { - alt36=1; - } - - - switch (alt36) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:20: valueDefinition - { - pushFollow(FOLLOW_valueDefinition_in_valueDefinitions2660); - valueDefinition109=valueDefinition(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_valueDefinition.add(valueDefinition109.getTree()); - - } - break; - - default : - break loop36; - } - } while (true); - - - - // AST REWRITE - // elements: valueDefinition - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 392:37: -> ^( VALUE_DEFINITIONS ( valueDefinition )* ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:40: ^( VALUE_DEFINITIONS ( valueDefinition )* ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VALUE_DEFINITIONS, "VALUE_DEFINITIONS"), root_1); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:392:60: ( valueDefinition )* - while ( stream_valueDefinition.hasNext() ) { - adaptor.addChild(root_1, stream_valueDefinition.nextTree()); - - } - stream_valueDefinition.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "valueDefinitions" - - public static class valueDefinition_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "valueDefinition" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:394:1: valueDefinition : ID ':' type '=' value -> ^( VALUE_DEFINITION ID type value ) ; - public final GraphParser.valueDefinition_return valueDefinition() throws RecognitionException { - GraphParser.valueDefinition_return retval = new GraphParser.valueDefinition_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token ID110=null; - Token char_literal111=null; - Token char_literal113=null; - GraphParser.type_return type112 = null; - - GraphParser.value_return value114 = null; - - - CommonTree ID110_tree=null; - CommonTree char_literal111_tree=null; - CommonTree char_literal113_tree=null; - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - RewriteRuleTokenStream stream_73=new RewriteRuleTokenStream(adaptor,"token 73"); - RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74"); - RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value"); - RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:395:5: ( ID ':' type '=' value -> ^( VALUE_DEFINITION ID type value ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:395:7: ID ':' type '=' value - { - ID110=(Token)match(input,ID,FOLLOW_ID_in_valueDefinition2683); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID110); - - char_literal111=(Token)match(input,73,FOLLOW_73_in_valueDefinition2685); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_73.add(char_literal111); - - pushFollow(FOLLOW_type_in_valueDefinition2687); - type112=type(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_type.add(type112.getTree()); - char_literal113=(Token)match(input,74,FOLLOW_74_in_valueDefinition2689); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_74.add(char_literal113); - - pushFollow(FOLLOW_value_in_valueDefinition2691); - value114=value(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_value.add(value114.getTree()); - - - // AST REWRITE - // elements: value, type, ID - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 396:5: -> ^( VALUE_DEFINITION ID type value ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:396:8: ^( VALUE_DEFINITION ID type value ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VALUE_DEFINITION, "VALUE_DEFINITION"), root_1); - - adaptor.addChild(root_1, stream_ID.nextNode()); - adaptor.addChild(root_1, stream_type.nextTree()); - adaptor.addChild(root_1, stream_value.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "valueDefinition" - - public static class value_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "value" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:399:1: value : ( basicValue -> basicValue ) ( ':' type -> ^( VARIANT type $value) )* ; - public final GraphParser.value_return value() throws RecognitionException { - GraphParser.value_return retval = new GraphParser.value_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token char_literal116=null; - GraphParser.basicValue_return basicValue115 = null; - - GraphParser.type_return type117 = null; - - - CommonTree char_literal116_tree=null; - RewriteRuleTokenStream stream_73=new RewriteRuleTokenStream(adaptor,"token 73"); - RewriteRuleSubtreeStream stream_basicValue=new RewriteRuleSubtreeStream(adaptor,"rule basicValue"); - RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:400:5: ( ( basicValue -> basicValue ) ( ':' type -> ^( VARIANT type $value) )* ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:400:7: ( basicValue -> basicValue ) ( ':' type -> ^( VARIANT type $value) )* - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:400:7: ( basicValue -> basicValue ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:400:8: basicValue - { - pushFollow(FOLLOW_basicValue_in_value2727); - basicValue115=basicValue(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_basicValue.add(basicValue115.getTree()); - - - // AST REWRITE - // elements: basicValue - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 400:19: -> basicValue - { - adaptor.addChild(root_0, stream_basicValue.nextTree()); - - } - - retval.tree = root_0;} - } - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:401:7: ( ':' type -> ^( VARIANT type $value) )* - loop37: - do { - int alt37=2; - int LA37_0 = input.LA(1); - - if ( (LA37_0==73) ) { - alt37=1; - } - - - switch (alt37) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:401:8: ':' type - { - char_literal116=(Token)match(input,73,FOLLOW_73_in_value2741); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_73.add(char_literal116); - - pushFollow(FOLLOW_type_in_value2743); - type117=type(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_type.add(type117.getTree()); - - - // AST REWRITE - // elements: value, type - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 401:17: -> ^( VARIANT type $value) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:401:20: ^( VARIANT type $value) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIANT, "VARIANT"), root_1); - - adaptor.addChild(root_1, stream_type.nextTree()); - adaptor.addChild(root_1, stream_retval.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - break; - - default : - break loop37; - } - } while (true); - - - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "value" - - public static class basicValue_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "basicValue" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:404:1: basicValue : ( simpleValue | map | {...}? ID -> NO_VALUE | taggedValue ); - public final GraphParser.basicValue_return basicValue() throws RecognitionException { - GraphParser.basicValue_return retval = new GraphParser.basicValue_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token ID120=null; - GraphParser.simpleValue_return simpleValue118 = null; - - GraphParser.map_return map119 = null; - - GraphParser.taggedValue_return taggedValue121 = null; - - - CommonTree ID120_tree=null; - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:405:5: ( simpleValue | map | {...}? ID -> NO_VALUE | taggedValue ) - int alt38=4; - int LA38_0 = input.LA(1); - - if ( (LA38_0==LPAREN||LA38_0==LBRACKET||LA38_0==LCURLY||LA38_0==INT||LA38_0==FLOAT||LA38_0==STRING||(LA38_0>=79 && LA38_0<=80)) ) { - alt38=1; - } - else if ( (LA38_0==ID) ) { - int LA38_2 = input.LA(2); - - if ( (LA38_2==LCURLY) && ((input.LT(1).getText().equals("map")))) { - alt38=2; - } - else if ( ((input.LT(1).getText().equals("null"))) ) { - alt38=3; - } - else if ( (true) ) { - alt38=4; - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 38, 2, input); - - throw nvae; - } - } - else { - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 38, 0, input); - - throw nvae; - } - switch (alt38) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:405:7: simpleValue - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_simpleValue_in_basicValue2775); - simpleValue118=simpleValue(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, simpleValue118.getTree()); - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:406:7: map - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_map_in_basicValue2783); - map119=map(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, map119.getTree()); - - } - break; - case 3 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:407:7: {...}? ID - { - if ( !((input.LT(1).getText().equals("null"))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "basicValue", "input.LT(1).getText().equals(\"null\")"); - } - ID120=(Token)match(input,ID,FOLLOW_ID_in_basicValue2793); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID120); - - - - // AST REWRITE - // elements: - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 407:50: -> NO_VALUE - { - adaptor.addChild(root_0, (CommonTree)adaptor.create(NO_VALUE, "NO_VALUE")); - - } - - retval.tree = root_0;} - } - break; - case 4 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:408:7: taggedValue - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_taggedValue_in_basicValue2805); - taggedValue121=taggedValue(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, taggedValue121.getTree()); - - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "basicValue" - - public static class simpleValue_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "simpleValue" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:411:1: simpleValue : ( string | number | boolean_ | array | tuple | record ); - public final GraphParser.simpleValue_return simpleValue() throws RecognitionException { - GraphParser.simpleValue_return retval = new GraphParser.simpleValue_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - GraphParser.string_return string122 = null; - - GraphParser.number_return number123 = null; - - GraphParser.boolean__return boolean_124 = null; - - GraphParser.array_return array125 = null; - - GraphParser.tuple_return tuple126 = null; - - GraphParser.record_return record127 = null; - - - - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:412:5: ( string | number | boolean_ | array | tuple | record ) - int alt39=6; - switch ( input.LA(1) ) { - case STRING: - { - alt39=1; - } - break; - case INT: - case FLOAT: - { - alt39=2; - } - break; - case 79: - case 80: - { - alt39=3; - } - break; - case LBRACKET: - { - alt39=4; - } - break; - case LPAREN: - { - alt39=5; - } - break; - case LCURLY: - { - alt39=6; - } - break; - default: - if (state.backtracking>0) {state.failed=true; return retval;} - NoViableAltException nvae = - new NoViableAltException("", 39, 0, input); - - throw nvae; - } - - switch (alt39) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:412:7: string - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_string_in_simpleValue2830); - string122=string(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, string122.getTree()); - - } - break; - case 2 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:413:7: number - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_number_in_simpleValue2838); - number123=number(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, number123.getTree()); - - } - break; - case 3 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:414:7: boolean_ - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_boolean__in_simpleValue2846); - boolean_124=boolean_(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, boolean_124.getTree()); - - } - break; - case 4 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:415:7: array - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_array_in_simpleValue2854); - array125=array(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, array125.getTree()); - - } - break; - case 5 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:416:7: tuple - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_tuple_in_simpleValue2862); - tuple126=tuple(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, tuple126.getTree()); - - } - break; - case 6 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:417:7: record - { - root_0 = (CommonTree)adaptor.nil(); - - pushFollow(FOLLOW_record_in_simpleValue2870); - record127=record(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) adaptor.addChild(root_0, record127.getTree()); - - } - break; - - } - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "simpleValue" - - public static class array_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "array" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:420:1: array : LBRACKET ( value ( ',' value )* )? RBRACKET -> ^( ARRAY ( value )* ) ; - public final GraphParser.array_return array() throws RecognitionException { - GraphParser.array_return retval = new GraphParser.array_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token LBRACKET128=null; - Token char_literal130=null; - Token RBRACKET132=null; - GraphParser.value_return value129 = null; - - GraphParser.value_return value131 = null; - - - CommonTree LBRACKET128_tree=null; - CommonTree char_literal130_tree=null; - CommonTree RBRACKET132_tree=null; - RewriteRuleTokenStream stream_LBRACKET=new RewriteRuleTokenStream(adaptor,"token LBRACKET"); - RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78"); - RewriteRuleTokenStream stream_RBRACKET=new RewriteRuleTokenStream(adaptor,"token RBRACKET"); - RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:5: ( LBRACKET ( value ( ',' value )* )? RBRACKET -> ^( ARRAY ( value )* ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:7: LBRACKET ( value ( ',' value )* )? RBRACKET - { - LBRACKET128=(Token)match(input,LBRACKET,FOLLOW_LBRACKET_in_array2891); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_LBRACKET.add(LBRACKET128); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:16: ( value ( ',' value )* )? - int alt41=2; - int LA41_0 = input.LA(1); - - if ( (LA41_0==ID||LA41_0==LPAREN||LA41_0==LBRACKET||LA41_0==LCURLY||LA41_0==INT||LA41_0==FLOAT||LA41_0==STRING||(LA41_0>=79 && LA41_0<=80)) ) { - alt41=1; - } - switch (alt41) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:17: value ( ',' value )* - { - pushFollow(FOLLOW_value_in_array2894); - value129=value(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_value.add(value129.getTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:23: ( ',' value )* - loop40: - do { - int alt40=2; - int LA40_0 = input.LA(1); - - if ( (LA40_0==78) ) { - alt40=1; - } - - - switch (alt40) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:421:24: ',' value - { - char_literal130=(Token)match(input,78,FOLLOW_78_in_array2897); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_78.add(char_literal130); - - pushFollow(FOLLOW_value_in_array2899); - value131=value(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_value.add(value131.getTree()); - - } - break; - - default : - break loop40; - } - } while (true); - - - } - break; - - } - - RBRACKET132=(Token)match(input,RBRACKET,FOLLOW_RBRACKET_in_array2905); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_RBRACKET.add(RBRACKET132); - - - - // AST REWRITE - // elements: value - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 422:5: -> ^( ARRAY ( value )* ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:422:8: ^( ARRAY ( value )* ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ARRAY, "ARRAY"), root_1); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:422:16: ( value )* - while ( stream_value.hasNext() ) { - adaptor.addChild(root_1, stream_value.nextTree()); - - } - stream_value.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "array" - - public static class tuple_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "tuple" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:425:1: tuple : LPAREN ( value ( ',' value )* )? RPAREN -> ^( TUPLE ( value )* ) ; - public final GraphParser.tuple_return tuple() throws RecognitionException { - GraphParser.tuple_return retval = new GraphParser.tuple_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token LPAREN133=null; - Token char_literal135=null; - Token RPAREN137=null; - GraphParser.value_return value134 = null; - - GraphParser.value_return value136 = null; - - - CommonTree LPAREN133_tree=null; - CommonTree char_literal135_tree=null; - CommonTree RPAREN137_tree=null; - RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78"); - RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN"); - RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN"); - RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:5: ( LPAREN ( value ( ',' value )* )? RPAREN -> ^( TUPLE ( value )* ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:7: LPAREN ( value ( ',' value )* )? RPAREN - { - LPAREN133=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_tuple2937); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN133); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:14: ( value ( ',' value )* )? - int alt43=2; - int LA43_0 = input.LA(1); - - if ( (LA43_0==ID||LA43_0==LPAREN||LA43_0==LBRACKET||LA43_0==LCURLY||LA43_0==INT||LA43_0==FLOAT||LA43_0==STRING||(LA43_0>=79 && LA43_0<=80)) ) { - alt43=1; - } - switch (alt43) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:15: value ( ',' value )* - { - pushFollow(FOLLOW_value_in_tuple2940); - value134=value(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_value.add(value134.getTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:21: ( ',' value )* - loop42: - do { - int alt42=2; - int LA42_0 = input.LA(1); - - if ( (LA42_0==78) ) { - alt42=1; - } - - - switch (alt42) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:426:22: ',' value - { - char_literal135=(Token)match(input,78,FOLLOW_78_in_tuple2943); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_78.add(char_literal135); - - pushFollow(FOLLOW_value_in_tuple2945); - value136=value(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_value.add(value136.getTree()); - - } - break; - - default : - break loop42; - } - } while (true); - - - } - break; - - } - - RPAREN137=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_tuple2951); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN137); - - - - // AST REWRITE - // elements: value - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 427:5: -> ^( TUPLE ( value )* ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:427:8: ^( TUPLE ( value )* ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TUPLE, "TUPLE"), root_1); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:427:16: ( value )* - while ( stream_value.hasNext() ) { - adaptor.addChild(root_1, stream_value.nextTree()); - - } - stream_value.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "tuple" - - public static class taggedValue_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "taggedValue" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:430:1: taggedValue : ID ( simpleValue )? -> ^( TAGGED_VALUE ID ( simpleValue )? ) ; - public final GraphParser.taggedValue_return taggedValue() throws RecognitionException { - GraphParser.taggedValue_return retval = new GraphParser.taggedValue_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token ID138=null; - GraphParser.simpleValue_return simpleValue139 = null; - - - CommonTree ID138_tree=null; - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - RewriteRuleSubtreeStream stream_simpleValue=new RewriteRuleSubtreeStream(adaptor,"rule simpleValue"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:431:5: ( ID ( simpleValue )? -> ^( TAGGED_VALUE ID ( simpleValue )? ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:431:7: ID ( simpleValue )? - { - ID138=(Token)match(input,ID,FOLLOW_ID_in_taggedValue2983); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID138); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:431:10: ( simpleValue )? - int alt44=2; - int LA44_0 = input.LA(1); - - if ( (LA44_0==LPAREN||LA44_0==LBRACKET||LA44_0==LCURLY||LA44_0==INT||LA44_0==FLOAT||LA44_0==STRING||(LA44_0>=79 && LA44_0<=80)) ) { - alt44=1; - } - switch (alt44) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:431:10: simpleValue - { - pushFollow(FOLLOW_simpleValue_in_taggedValue2985); - simpleValue139=simpleValue(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_simpleValue.add(simpleValue139.getTree()); - - } - break; - - } - - - - // AST REWRITE - // elements: simpleValue, ID - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 432:5: -> ^( TAGGED_VALUE ID ( simpleValue )? ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:432:8: ^( TAGGED_VALUE ID ( simpleValue )? ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TAGGED_VALUE, "TAGGED_VALUE"), root_1); - - adaptor.addChild(root_1, stream_ID.nextNode()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:432:26: ( simpleValue )? - if ( stream_simpleValue.hasNext() ) { - adaptor.addChild(root_1, stream_simpleValue.nextTree()); - - } - stream_simpleValue.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "taggedValue" - - public static class record_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "record" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:435:1: record : LCURLY ( recordAssignment ( ',' recordAssignment )* )? RCURLY -> ^( RECORD ( recordAssignment )* ) ; - public final GraphParser.record_return record() throws RecognitionException { - GraphParser.record_return retval = new GraphParser.record_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token LCURLY140=null; - Token char_literal142=null; - Token RCURLY144=null; - GraphParser.recordAssignment_return recordAssignment141 = null; - - GraphParser.recordAssignment_return recordAssignment143 = null; - - - CommonTree LCURLY140_tree=null; - CommonTree char_literal142_tree=null; - CommonTree RCURLY144_tree=null; - RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78"); - RewriteRuleTokenStream stream_LCURLY=new RewriteRuleTokenStream(adaptor,"token LCURLY"); - RewriteRuleTokenStream stream_RCURLY=new RewriteRuleTokenStream(adaptor,"token RCURLY"); - RewriteRuleSubtreeStream stream_recordAssignment=new RewriteRuleSubtreeStream(adaptor,"rule recordAssignment"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:5: ( LCURLY ( recordAssignment ( ',' recordAssignment )* )? RCURLY -> ^( RECORD ( recordAssignment )* ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:7: LCURLY ( recordAssignment ( ',' recordAssignment )* )? RCURLY - { - LCURLY140=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_record3020); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_LCURLY.add(LCURLY140); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:14: ( recordAssignment ( ',' recordAssignment )* )? - int alt46=2; - int LA46_0 = input.LA(1); - - if ( (LA46_0==ID) ) { - alt46=1; - } - switch (alt46) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:15: recordAssignment ( ',' recordAssignment )* - { - pushFollow(FOLLOW_recordAssignment_in_record3023); - recordAssignment141=recordAssignment(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_recordAssignment.add(recordAssignment141.getTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:32: ( ',' recordAssignment )* - loop45: - do { - int alt45=2; - int LA45_0 = input.LA(1); - - if ( (LA45_0==78) ) { - alt45=1; - } - - - switch (alt45) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:436:33: ',' recordAssignment - { - char_literal142=(Token)match(input,78,FOLLOW_78_in_record3026); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_78.add(char_literal142); - - pushFollow(FOLLOW_recordAssignment_in_record3028); - recordAssignment143=recordAssignment(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_recordAssignment.add(recordAssignment143.getTree()); - - } - break; - - default : - break loop45; - } - } while (true); - - - } - break; - - } - - RCURLY144=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_record3034); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_RCURLY.add(RCURLY144); - - - - // AST REWRITE - // elements: recordAssignment - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 437:5: -> ^( RECORD ( recordAssignment )* ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:437:8: ^( RECORD ( recordAssignment )* ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RECORD, "RECORD"), root_1); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:437:17: ( recordAssignment )* - while ( stream_recordAssignment.hasNext() ) { - adaptor.addChild(root_1, stream_recordAssignment.nextTree()); - - } - stream_recordAssignment.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "record" - - public static class recordAssignment_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "recordAssignment" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:440:1: recordAssignment : ID '=' value -> ^( ASSIGNMENT ID value ) ; - public final GraphParser.recordAssignment_return recordAssignment() throws RecognitionException { - GraphParser.recordAssignment_return retval = new GraphParser.recordAssignment_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token ID145=null; - Token char_literal146=null; - GraphParser.value_return value147 = null; - - - CommonTree ID145_tree=null; - CommonTree char_literal146_tree=null; - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74"); - RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:441:5: ( ID '=' value -> ^( ASSIGNMENT ID value ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:441:7: ID '=' value - { - ID145=(Token)match(input,ID,FOLLOW_ID_in_recordAssignment3066); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID145); - - char_literal146=(Token)match(input,74,FOLLOW_74_in_recordAssignment3068); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_74.add(char_literal146); - - pushFollow(FOLLOW_value_in_recordAssignment3070); - value147=value(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_value.add(value147.getTree()); - - - // AST REWRITE - // elements: ID, value - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 442:5: -> ^( ASSIGNMENT ID value ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:442:8: ^( ASSIGNMENT ID value ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ASSIGNMENT, "ASSIGNMENT"), root_1); - - adaptor.addChild(root_1, stream_ID.nextNode()); - adaptor.addChild(root_1, stream_value.nextTree()); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "recordAssignment" - - public static class map_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "map" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:1: map : {...}? => ID LCURLY ( mapAssignment ( ',' mapAssignment )* )? RCURLY -> ^( MAP ( mapAssignment )* ) ; - public final GraphParser.map_return map() throws RecognitionException { - GraphParser.map_return retval = new GraphParser.map_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token ID148=null; - Token LCURLY149=null; - Token char_literal151=null; - Token RCURLY153=null; - GraphParser.mapAssignment_return mapAssignment150 = null; - - GraphParser.mapAssignment_return mapAssignment152 = null; - - - CommonTree ID148_tree=null; - CommonTree LCURLY149_tree=null; - CommonTree char_literal151_tree=null; - CommonTree RCURLY153_tree=null; - RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78"); - RewriteRuleTokenStream stream_LCURLY=new RewriteRuleTokenStream(adaptor,"token LCURLY"); - RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); - RewriteRuleTokenStream stream_RCURLY=new RewriteRuleTokenStream(adaptor,"token RCURLY"); - RewriteRuleSubtreeStream stream_mapAssignment=new RewriteRuleSubtreeStream(adaptor,"rule mapAssignment"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:5: ({...}? => ID LCURLY ( mapAssignment ( ',' mapAssignment )* )? RCURLY -> ^( MAP ( mapAssignment )* ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:7: {...}? => ID LCURLY ( mapAssignment ( ',' mapAssignment )* )? RCURLY - { - if ( !((input.LT(1).getText().equals("map"))) ) { - if (state.backtracking>0) {state.failed=true; return retval;} - throw new FailedPredicateException(input, "map", "input.LT(1).getText().equals(\"map\")"); - } - ID148=(Token)match(input,ID,FOLLOW_ID_in_map3100); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_ID.add(ID148); - - LCURLY149=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_map3102); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_LCURLY.add(LCURLY149); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:58: ( mapAssignment ( ',' mapAssignment )* )? - int alt48=2; - int LA48_0 = input.LA(1); - - if ( (LA48_0==ID||LA48_0==LPAREN||LA48_0==LBRACKET||LA48_0==LCURLY||LA48_0==INT||LA48_0==FLOAT||LA48_0==STRING||(LA48_0>=79 && LA48_0<=80)) ) { - alt48=1; - } - switch (alt48) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:59: mapAssignment ( ',' mapAssignment )* - { - pushFollow(FOLLOW_mapAssignment_in_map3105); - mapAssignment150=mapAssignment(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_mapAssignment.add(mapAssignment150.getTree()); - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:73: ( ',' mapAssignment )* - loop47: - do { - int alt47=2; - int LA47_0 = input.LA(1); - - if ( (LA47_0==78) ) { - alt47=1; - } - - - switch (alt47) { - case 1 : - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:445:74: ',' mapAssignment - { - char_literal151=(Token)match(input,78,FOLLOW_78_in_map3108); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_78.add(char_literal151); - - pushFollow(FOLLOW_mapAssignment_in_map3110); - mapAssignment152=mapAssignment(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_mapAssignment.add(mapAssignment152.getTree()); - - } - break; - - default : - break loop47; - } - } while (true); - - - } - break; - - } - - RCURLY153=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_map3116); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_RCURLY.add(RCURLY153); - - - - // AST REWRITE - // elements: mapAssignment - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 446:5: -> ^( MAP ( mapAssignment )* ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:446:8: ^( MAP ( mapAssignment )* ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(MAP, "MAP"), root_1); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:446:14: ( mapAssignment )* - while ( stream_mapAssignment.hasNext() ) { - adaptor.addChild(root_1, stream_mapAssignment.nextTree()); - - } - stream_mapAssignment.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "map" - - public static class mapAssignment_return extends ParserRuleReturnScope { - CommonTree tree; - public Object getTree() { return tree; } - }; - - // $ANTLR start "mapAssignment" - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:449:1: mapAssignment : value '=' value -> ^( ASSIGNMENT ( value )* ) ; - public final GraphParser.mapAssignment_return mapAssignment() throws RecognitionException { - GraphParser.mapAssignment_return retval = new GraphParser.mapAssignment_return(); - retval.start = input.LT(1); - - CommonTree root_0 = null; - - Token char_literal155=null; - GraphParser.value_return value154 = null; - - GraphParser.value_return value156 = null; - - - CommonTree char_literal155_tree=null; - RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74"); - RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value"); - try { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:450:5: ( value '=' value -> ^( ASSIGNMENT ( value )* ) ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:450:7: value '=' value - { - pushFollow(FOLLOW_value_in_mapAssignment3148); - value154=value(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_value.add(value154.getTree()); - char_literal155=(Token)match(input,74,FOLLOW_74_in_mapAssignment3150); if (state.failed) return retval; - if ( state.backtracking==0 ) stream_74.add(char_literal155); - - pushFollow(FOLLOW_value_in_mapAssignment3152); - value156=value(); - - state._fsp--; - if (state.failed) return retval; - if ( state.backtracking==0 ) stream_value.add(value156.getTree()); - - - // AST REWRITE - // elements: value - // token labels: - // rule labels: retval - // token list labels: - // rule list labels: - // wildcard labels: - if ( state.backtracking==0 ) { - retval.tree = root_0; - RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null); - - root_0 = (CommonTree)adaptor.nil(); - // 451:5: -> ^( ASSIGNMENT ( value )* ) - { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:451:8: ^( ASSIGNMENT ( value )* ) - { - CommonTree root_1 = (CommonTree)adaptor.nil(); - root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ASSIGNMENT, "ASSIGNMENT"), root_1); - - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:451:21: ( value )* - while ( stream_value.hasNext() ) { - adaptor.addChild(root_1, stream_value.nextTree()); - - } - stream_value.reset(); - - adaptor.addChild(root_0, root_1); - } - - } - - retval.tree = root_0;} - } - - retval.stop = input.LT(-1); - - if ( state.backtracking==0 ) { - - retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); - adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); - - } - finally { - } - return retval; - } - // $ANTLR end "mapAssignment" - - // $ANTLR start synpred1_Graph - public final void synpred1_Graph_fragment() throws RecognitionException { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:22: ( arrayType ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:317:23: arrayType - { - pushFollow(FOLLOW_arrayType_in_synpred1_Graph2075); - arrayType(); - - state._fsp--; - if (state.failed) return ; - - } - } - // $ANTLR end synpred1_Graph - - // $ANTLR start synpred2_Graph - public final void synpred2_Graph_fragment() throws RecognitionException { - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:11: ( LPAREN ) - // src\\org\\simantics\\graph\\compiler\\internal\\parsing\\Graph.g:350:12: LPAREN - { - match(input,LPAREN,FOLLOW_LPAREN_in_synpred2_Graph2354); if (state.failed) return ; - - } - } - // $ANTLR end synpred2_Graph - - // Delegated rules - - public final boolean synpred1_Graph() { - state.backtracking++; - int start = input.mark(); - try { - synpred1_Graph_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - public final boolean synpred2_Graph() { - state.backtracking++; - int start = input.mark(); - try { - synpred2_Graph_fragment(); // can never throw exception - } catch (RecognitionException re) { - System.err.println("impossible: "+re); - } - boolean success = !state.failed; - input.rewind(start); - state.backtracking--; - state.failed=false; - return success; - } - - - protected DFA13 dfa13 = new DFA13(this); - protected DFA22 dfa22 = new DFA22(this); - protected DFA31 dfa31 = new DFA31(this); - static final String DFA13_eotS = - "\15\uffff"; - static final String DFA13_eofS = - "\15\uffff"; - static final String DFA13_minS = - "\1\55\1\0\13\uffff"; - static final String DFA13_maxS = - "\1\120\1\0\13\uffff"; - static final String DFA13_acceptS = - "\2\uffff\1\2\11\uffff\1\1"; - static final String DFA13_specialS = - "\1\uffff\1\0\13\uffff}>"; - static final String[] DFA13_transitionS = { - "\1\1\2\uffff\1\2\1\uffff\1\2\1\uffff\1\2\1\uffff\1\2\1\uffff"+ - "\1\2\4\uffff\2\2\14\uffff\2\2\2\uffff\2\2", - "\1\uffff", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - }; - - static final short[] DFA13_eot = DFA.unpackEncodedString(DFA13_eotS); - static final short[] DFA13_eof = DFA.unpackEncodedString(DFA13_eofS); - static final char[] DFA13_min = DFA.unpackEncodedStringToUnsignedChars(DFA13_minS); - static final char[] DFA13_max = DFA.unpackEncodedStringToUnsignedChars(DFA13_maxS); - static final short[] DFA13_accept = DFA.unpackEncodedString(DFA13_acceptS); - static final short[] DFA13_special = DFA.unpackEncodedString(DFA13_specialS); - static final short[][] DFA13_transition; - - static { - int numStates = DFA13_transitionS.length; - DFA13_transition = new short[numStates][]; - for (int i=0; i ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) )"; - } - public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { - TokenStream input = (TokenStream)_input; - int _s = s; - switch ( s ) { - case 0 : - int LA13_1 = input.LA(1); - - - int index13_1 = input.index(); - input.rewind(); - s = -1; - if ( ((input.LT(1).getText().equals("template"))) ) {s = 12;} - - else if ( (true) ) {s = 2;} - - - input.seek(index13_1); - if ( s>=0 ) return s; - break; - } - if (state.backtracking>0) {state.failed=true; return -1;} - NoViableAltException nvae = - new NoViableAltException(getDescription(), 13, _s, input); - error(nvae); - throw nvae; - } - } - static final String DFA22_eotS = - "\14\uffff"; - static final String DFA22_eofS = - "\1\4\13\uffff"; - static final String DFA22_minS = - "\1\55\2\uffff\1\0\10\uffff"; - static final String DFA22_maxS = - "\1\116\2\uffff\1\0\10\uffff"; - static final String DFA22_acceptS = - "\1\uffff\2\1\1\uffff\1\2\7\uffff"; - static final String DFA22_specialS = - "\1\0\2\uffff\1\1\10\uffff}>"; - static final String[] DFA22_transitionS = { - "\1\3\2\uffff\1\1\1\4\1\uffff\1\4\1\2\1\4\23\uffff\2\4\2\uffff"+ - "\2\4", - "", - "", - "\1\uffff", - "", - "", - "", - "", - "", - "", - "", - "" - }; - - static final short[] DFA22_eot = DFA.unpackEncodedString(DFA22_eotS); - static final short[] DFA22_eof = DFA.unpackEncodedString(DFA22_eofS); - static final char[] DFA22_min = DFA.unpackEncodedStringToUnsignedChars(DFA22_minS); - static final char[] DFA22_max = DFA.unpackEncodedStringToUnsignedChars(DFA22_maxS); - static final short[] DFA22_accept = DFA.unpackEncodedString(DFA22_acceptS); - static final short[] DFA22_special = DFA.unpackEncodedString(DFA22_specialS); - static final short[][] DFA22_transition; - - static { - int numStates = DFA22_transitionS.length; - DFA22_transition = new short[numStates][]; - for (int i=0; i arrayType )?"; - } - public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { - TokenStream input = (TokenStream)_input; - int _s = s; - switch ( s ) { - case 0 : - int LA22_0 = input.LA(1); - - - int index22_0 = input.index(); - input.rewind(); - s = -1; - if ( (LA22_0==LPAREN) && (synpred1_Graph())) {s = 1;} - - else if ( (LA22_0==LCURLY) && (synpred1_Graph())) {s = 2;} - - else if ( (LA22_0==ID) ) {s = 3;} - - else if ( (LA22_0==EOF||LA22_0==RPAREN||LA22_0==RBRACKET||LA22_0==RCURLY||(LA22_0>=73 && LA22_0<=74)||(LA22_0>=77 && LA22_0<=78)) ) {s = 4;} - - - input.seek(index22_0); - if ( s>=0 ) return s; - break; - case 1 : - int LA22_3 = input.LA(1); - - - int index22_3 = input.index(); - input.rewind(); - s = -1; - if ( (synpred1_Graph()) ) {s = 2;} - - else if ( (true) ) {s = 4;} - - - input.seek(index22_3); - if ( s>=0 ) return s; - break; - } - if (state.backtracking>0) {state.failed=true; return -1;} - NoViableAltException nvae = - new NoViableAltException(getDescription(), 22, _s, input); - error(nvae); - throw nvae; - } - } - static final String DFA31_eotS = - "\36\uffff"; - static final String DFA31_eofS = - "\1\2\35\uffff"; - static final String DFA31_minS = - "\1\4\1\0\34\uffff"; - static final String DFA31_maxS = - "\1\120\1\0\34\uffff"; - static final String DFA31_acceptS = - "\2\uffff\1\2\32\uffff\1\1"; - static final String DFA31_specialS = - "\1\uffff\1\0\34\uffff}>"; - static final String[] DFA31_transitionS = { - "\2\2\47\uffff\1\2\2\uffff\1\1\6\2\1\uffff\1\2\1\uffff\1\2\2"+ - "\uffff\2\2\4\uffff\16\2", - "\1\uffff", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - }; - - static final short[] DFA31_eot = DFA.unpackEncodedString(DFA31_eotS); - static final short[] DFA31_eof = DFA.unpackEncodedString(DFA31_eofS); - static final char[] DFA31_min = DFA.unpackEncodedStringToUnsignedChars(DFA31_minS); - static final char[] DFA31_max = DFA.unpackEncodedStringToUnsignedChars(DFA31_maxS); - static final short[] DFA31_accept = DFA.unpackEncodedString(DFA31_acceptS); - static final short[] DFA31_special = DFA.unpackEncodedString(DFA31_specialS); - static final short[][] DFA31_transition; - - static { - int numStates = DFA31_transitionS.length; - DFA31_transition = new short[numStates][]; - for (int i=0; i LPAREN parameter ( ',' parameter )* RPAREN )?"; - } - public int specialStateTransition(int s, IntStream _input) throws NoViableAltException { - TokenStream input = (TokenStream)_input; - int _s = s; - switch ( s ) { - case 0 : - int LA31_1 = input.LA(1); - - - int index31_1 = input.index(); - input.rewind(); - s = -1; - if ( (synpred2_Graph()) ) {s = 29;} - - else if ( (true) ) {s = 2;} - - - input.seek(index31_1); - if ( s>=0 ) return s; - break; - } - if (state.backtracking>0) {state.failed=true; return -1;} - NoViableAltException nvae = - new NoViableAltException(getDescription(), 31, _s, input); - error(nvae); - throw nvae; - } - } - - - public static final BitSet FOLLOW_NEWLINE_in_file1230 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019802L}); - public static final BitSet FOLLOW_resourceDefinitions_in_file1233 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_file1236 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_resourceDefinition_in_resourceDefinitions1260 = new BitSet(new long[]{0x0400000000000002L}); - public static final BitSet FOLLOW_NEWLINE_in_resourceDefinitions1263 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019802L}); - public static final BitSet FOLLOW_resourceDefinition_in_resourceDefinitions1266 = new BitSet(new long[]{0x0400000000000002L}); - public static final BitSet FOLLOW_resource_in_resourceDefinition1300 = new BitSet(new long[]{0x4000200000000012L,0x0000000000000FF8L}); - public static final BitSet FOLLOW_localProperty_in_resourceDefinition1308 = new BitSet(new long[]{0x4000200000000012L,0x0000000000000FF8L}); - public static final BitSet FOLLOW_INDENT_in_resourceDefinition1318 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019FFAL}); - public static final BitSet FOLLOW_property_in_resourceDefinition1320 = new BitSet(new long[]{0x0400000000000020L}); - public static final BitSet FOLLOW_NEWLINE_in_resourceDefinition1323 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019FFAL}); - public static final BitSet FOLLOW_property_in_resourceDefinition1325 = new BitSet(new long[]{0x0400000000000020L}); - public static final BitSet FOLLOW_DEDENT_in_resourceDefinition1329 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_template_in_resourceDefinition1358 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_relation_in_localProperty1393 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019800L}); - public static final BitSet FOLLOW_resource_in_localProperty1395 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_relation_in_property1434 = new BitSet(new long[]{0x6155200000000010L,0x0000000000019802L}); - public static final BitSet FOLLOW_resourceDefinition_in_property1444 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_INDENT_in_property1464 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019802L}); - public static final BitSet FOLLOW_resourceDefinitions_in_property1466 = new BitSet(new long[]{0x0000000000000020L}); - public static final BitSet FOLLOW_DEDENT_in_property1468 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_template_in_property1494 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_65_in_template1515 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019800L}); - public static final BitSet FOLLOW_ID_in_template1533 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019800L}); - public static final BitSet FOLLOW_resource_in_template1535 = new BitSet(new long[]{0x6155200000000010L,0x0000000000019800L}); - public static final BitSet FOLLOW_INDENT_in_template1545 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019802L}); - public static final BitSet FOLLOW_resourceDefinitions_in_template1547 = new BitSet(new long[]{0x0000000000000020L}); - public static final BitSet FOLLOW_DEDENT_in_template1549 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_resource_in_template1574 = new BitSet(new long[]{0x6155200000000012L,0x0000000000019800L}); - public static final BitSet FOLLOW_INDENT_in_template1585 = new BitSet(new long[]{0x6155200000000000L,0x0000000000019802L}); - public static final BitSet FOLLOW_resourceDefinitions_in_template1587 = new BitSet(new long[]{0x0000000000000020L}); - public static final BitSet FOLLOW_DEDENT_in_template1589 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ID_in_relation1643 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L}); - public static final BitSet FOLLOW_66_in_relation1658 = new BitSet(new long[]{0x0000200000000000L}); - public static final BitSet FOLLOW_ID_in_relation1660 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L}); - public static final BitSet FOLLOW_URI_in_relation1681 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_67_in_relation1689 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_68_in_relation1701 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_69_in_relation1713 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_70_in_relation1725 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_71_in_relation1737 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_72_in_relation1749 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_73_in_relation1765 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_74_in_relation1777 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_75_in_relation1789 = new BitSet(new long[]{0x0000200000000000L}); - public static final BitSet FOLLOW_ID_in_relation1791 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ID_in_resource1821 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L}); - public static final BitSet FOLLOW_ID_in_resource1840 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L}); - public static final BitSet FOLLOW_66_in_resource1855 = new BitSet(new long[]{0x2000200000000000L}); - public static final BitSet FOLLOW_ID_in_resource1858 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L}); - public static final BitSet FOLLOW_STRING_in_resource1883 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000004L}); - public static final BitSet FOLLOW_URI_in_resource1924 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_simpleValue_in_resource1932 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_76_in_resource1948 = new BitSet(new long[]{0x0011200000000000L}); - public static final BitSet FOLLOW_basicType_in_resource1950 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_75_in_resource1966 = new BitSet(new long[]{0x0000200000000000L}); - public static final BitSet FOLLOW_ID_in_resource1968 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_arrayType_in_type2004 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_unionType_in_type2012 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_77_in_unionType2041 = new BitSet(new long[]{0x0000200000000000L}); - public static final BitSet FOLLOW_unionComponent_in_unionType2043 = new BitSet(new long[]{0x0000000000000002L,0x0000000000002000L}); - public static final BitSet FOLLOW_ID_in_unionComponent2071 = new BitSet(new long[]{0x0011200000000002L}); - public static final BitSet FOLLOW_arrayType_in_unionComponent2080 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_basicType_in_arrayType2108 = new BitSet(new long[]{0x0004000000000002L}); - public static final BitSet FOLLOW_LBRACKET_in_arrayType2122 = new BitSet(new long[]{0x00C8000000000000L}); - public static final BitSet FOLLOW_arrayLength_in_arrayType2124 = new BitSet(new long[]{0x0008000000000000L}); - public static final BitSet FOLLOW_RBRACKET_in_arrayType2127 = new BitSet(new long[]{0x0004000000000002L}); - public static final BitSet FOLLOW_set_in_arrayLength0 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_tupleType_in_basicType2181 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_recordType_in_basicType2189 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_typeReference_in_basicType2197 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_LPAREN_in_tupleType2219 = new BitSet(new long[]{0x0013200000000000L,0x0000000000002000L}); - public static final BitSet FOLLOW_type_in_tupleType2222 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_78_in_tupleType2225 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L}); - public static final BitSet FOLLOW_type_in_tupleType2227 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_RPAREN_in_tupleType2233 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_LCURLY_in_recordType2266 = new BitSet(new long[]{0x0020200000000000L}); - public static final BitSet FOLLOW_component_in_recordType2269 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_78_in_recordType2272 = new BitSet(new long[]{0x0000200000000000L}); - public static final BitSet FOLLOW_component_in_recordType2274 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_RCURLY_in_recordType2280 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ID_in_component2312 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000200L}); - public static final BitSet FOLLOW_73_in_component2314 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L}); - public static final BitSet FOLLOW_type_in_component2316 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ID_in_typeReference2350 = new BitSet(new long[]{0x0001000000000002L}); - public static final BitSet FOLLOW_LPAREN_in_typeReference2358 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L}); - public static final BitSet FOLLOW_parameter_in_typeReference2360 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_78_in_typeReference2363 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L}); - public static final BitSet FOLLOW_parameter_in_typeReference2365 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_RPAREN_in_typeReference2369 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ID_in_parameter2405 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L}); - public static final BitSet FOLLOW_74_in_parameter2407 = new BitSet(new long[]{0x2145000000000000L,0x0000000000018000L}); - public static final BitSet FOLLOW_parameterValue_in_parameter2409 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_type_in_parameter2427 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_string_in_parameterValue2446 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_boolean__in_parameterValue2454 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_number_in_parameterValue2462 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rangePar_in_parameterValue2470 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_set_in_rangePar2499 = new BitSet(new long[]{0x03C0000000000000L}); - public static final BitSet FOLLOW_range_in_rangePar2507 = new BitSet(new long[]{0x000A000000000000L}); - public static final BitSet FOLLOW_set_in_rangePar2509 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_number_in_range2536 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RANGE_in_range2544 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_INT_RANGE_in_range2552 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_set_in_number0 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_STRING_in_string2606 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_79_in_boolean_2627 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_80_in_boolean_2639 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_valueDefinition_in_valueDefinitions2660 = new BitSet(new long[]{0x0000200000000002L}); - public static final BitSet FOLLOW_ID_in_valueDefinition2683 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000200L}); - public static final BitSet FOLLOW_73_in_valueDefinition2685 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L}); - public static final BitSet FOLLOW_type_in_valueDefinition2687 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L}); - public static final BitSet FOLLOW_74_in_valueDefinition2689 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L}); - public static final BitSet FOLLOW_value_in_valueDefinition2691 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_basicValue_in_value2727 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000200L}); - public static final BitSet FOLLOW_73_in_value2741 = new BitSet(new long[]{0x0011200000000000L,0x0000000000002000L}); - public static final BitSet FOLLOW_type_in_value2743 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000200L}); - public static final BitSet FOLLOW_simpleValue_in_basicValue2775 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_map_in_basicValue2783 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ID_in_basicValue2793 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_taggedValue_in_basicValue2805 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_string_in_simpleValue2830 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_number_in_simpleValue2838 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_boolean__in_simpleValue2846 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_array_in_simpleValue2854 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_tuple_in_simpleValue2862 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_record_in_simpleValue2870 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_LBRACKET_in_array2891 = new BitSet(new long[]{0x215D200000000000L,0x0000000000018000L}); - public static final BitSet FOLLOW_value_in_array2894 = new BitSet(new long[]{0x0008000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_78_in_array2897 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L}); - public static final BitSet FOLLOW_value_in_array2899 = new BitSet(new long[]{0x0008000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_RBRACKET_in_array2905 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_LPAREN_in_tuple2937 = new BitSet(new long[]{0x2157200000000000L,0x0000000000018000L}); - public static final BitSet FOLLOW_value_in_tuple2940 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_78_in_tuple2943 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L}); - public static final BitSet FOLLOW_value_in_tuple2945 = new BitSet(new long[]{0x0002000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_RPAREN_in_tuple2951 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ID_in_taggedValue2983 = new BitSet(new long[]{0x2155000000000002L,0x0000000000018000L}); - public static final BitSet FOLLOW_simpleValue_in_taggedValue2985 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_LCURLY_in_record3020 = new BitSet(new long[]{0x0020200000000000L}); - public static final BitSet FOLLOW_recordAssignment_in_record3023 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_78_in_record3026 = new BitSet(new long[]{0x0000200000000000L}); - public static final BitSet FOLLOW_recordAssignment_in_record3028 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_RCURLY_in_record3034 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ID_in_recordAssignment3066 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L}); - public static final BitSet FOLLOW_74_in_recordAssignment3068 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L}); - public static final BitSet FOLLOW_value_in_recordAssignment3070 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ID_in_map3100 = new BitSet(new long[]{0x0010000000000000L}); - public static final BitSet FOLLOW_LCURLY_in_map3102 = new BitSet(new long[]{0x2175200000000000L,0x0000000000018000L}); - public static final BitSet FOLLOW_mapAssignment_in_map3105 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_78_in_map3108 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L}); - public static final BitSet FOLLOW_mapAssignment_in_map3110 = new BitSet(new long[]{0x0020000000000000L,0x0000000000004000L}); - public static final BitSet FOLLOW_RCURLY_in_map3116 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_value_in_mapAssignment3148 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L}); - public static final BitSet FOLLOW_74_in_mapAssignment3150 = new BitSet(new long[]{0x2155200000000000L,0x0000000000018000L}); - public static final BitSet FOLLOW_value_in_mapAssignment3152 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_arrayType_in_synpred1_Graph2075 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_LPAREN_in_synpred2_Graph2354 = new BitSet(new long[]{0x0000000000000002L}); - -} \ No newline at end of file +@SuppressWarnings("all") +public class GraphParser extends Parser { + public static final String[] tokenNames = new String[] { + "", "", "", "", "ARRAY", "ARRAY_TYPE", "ASSIGNMENT", + "BLANK", "COMMENT", "DEDENT", "DOMAIN_OF", "EMBEDDED_TYPE", "EMBEDDED_VALUE", + "EQUALS", "ESC_SEQ", "EXPONENT", "FALSE", "FILE", "FLOAT", "HAS_DOMAIN", + "HAS_RANGE", "HEX_DIGIT", "ID", "INDENT", "INHERITS", "INSTANCE_OF", "INT", + "INT_RANGE", "LBRACKET", "LCURLY", "LPAREN", "MAP", "NEWLINE", "NO_VALUE", + "PROPERTY", "RANGE", "RBRACKET", "RCURLY", "RECORD", "RECORD_TYPE", "REF", + "REQUIRES_VALUE_TYPE", "RESOURCE", "RPAREN", "STRING", "SUBRELATION_OF", + "TAGGED_VALUE", "TEMPLATE_DEFINITION", "TEMPLATE_INSTANCE", "TRUE", "TUPLE", + "TUPLE_TYPE", "TYPE_ANNOTATION", "TYPE_COMPONENT", "TYPE_DEFINITION", + "TYPE_DEFINITIONS", "TYPE_REFERENCE", "UNICODE_ESC", "UNION_TYPE", "URI", + "VALUE_DEFINITION", "VALUE_DEFINITIONS", "VARIABLE", "VARIANT", "WS", + "'$'", "'%'", "','", "'-->'", "'.'", "':'", "'<--'", "''", "'>--'", "'@'", "'false'", "'true'", "'|'" + }; + public static final int EOF=-1; + public static final int T__65=65; + public static final int T__66=66; + public static final int T__67=67; + public static final int T__68=68; + public static final int T__69=69; + public static final int T__70=70; + public static final int T__71=71; + public static final int T__72=72; + public static final int T__73=73; + public static final int T__74=74; + public static final int T__75=75; + public static final int T__76=76; + public static final int T__77=77; + public static final int T__78=78; + public static final int T__79=79; + public static final int T__80=80; + public static final int ARRAY=4; + public static final int ARRAY_TYPE=5; + public static final int ASSIGNMENT=6; + public static final int BLANK=7; + public static final int COMMENT=8; + public static final int DEDENT=9; + public static final int DOMAIN_OF=10; + public static final int EMBEDDED_TYPE=11; + public static final int EMBEDDED_VALUE=12; + public static final int EQUALS=13; + public static final int ESC_SEQ=14; + public static final int EXPONENT=15; + public static final int FALSE=16; + public static final int FILE=17; + public static final int FLOAT=18; + public static final int HAS_DOMAIN=19; + public static final int HAS_RANGE=20; + public static final int HEX_DIGIT=21; + public static final int ID=22; + public static final int INDENT=23; + public static final int INHERITS=24; + public static final int INSTANCE_OF=25; + public static final int INT=26; + public static final int INT_RANGE=27; + public static final int LBRACKET=28; + public static final int LCURLY=29; + public static final int LPAREN=30; + public static final int MAP=31; + public static final int NEWLINE=32; + public static final int NO_VALUE=33; + public static final int PROPERTY=34; + public static final int RANGE=35; + public static final int RBRACKET=36; + public static final int RCURLY=37; + public static final int RECORD=38; + public static final int RECORD_TYPE=39; + public static final int REF=40; + public static final int REQUIRES_VALUE_TYPE=41; + public static final int RESOURCE=42; + public static final int RPAREN=43; + public static final int STRING=44; + public static final int SUBRELATION_OF=45; + public static final int TAGGED_VALUE=46; + public static final int TEMPLATE_DEFINITION=47; + public static final int TEMPLATE_INSTANCE=48; + public static final int TRUE=49; + public static final int TUPLE=50; + public static final int TUPLE_TYPE=51; + public static final int TYPE_ANNOTATION=52; + public static final int TYPE_COMPONENT=53; + public static final int TYPE_DEFINITION=54; + public static final int TYPE_DEFINITIONS=55; + public static final int TYPE_REFERENCE=56; + public static final int UNICODE_ESC=57; + public static final int UNION_TYPE=58; + public static final int URI=59; + public static final int VALUE_DEFINITION=60; + public static final int VALUE_DEFINITIONS=61; + public static final int VARIABLE=62; + public static final int VARIANT=63; + public static final int WS=64; + + // delegates + public Parser[] getDelegates() { + return new Parser[] {}; + } + + // delegators + + + public GraphParser(TokenStream input) { + this(input, new RecognizerSharedState()); + } + public GraphParser(TokenStream input, RecognizerSharedState state) { + super(input, state); + } + + protected TreeAdaptor adaptor = new CommonTreeAdaptor(); + + public void setTreeAdaptor(TreeAdaptor adaptor) { + this.adaptor = adaptor; + } + public TreeAdaptor getTreeAdaptor() { + return adaptor; + } + @Override public String[] getTokenNames() { return GraphParser.tokenNames; } + @Override public String getGrammarFileName() { return "src/org/simantics/graph/compiler/internal/parsing/Graph.g"; } + + + public static class file_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "file" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:224:1: file : ( NEWLINE )? ( resourceDefinitions )? EOF -> ^( FILE ( resourceDefinitions )? ) ; + public final GraphParser.file_return file() throws RecognitionException { + GraphParser.file_return retval = new GraphParser.file_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token NEWLINE1=null; + Token EOF3=null; + ParserRuleReturnScope resourceDefinitions2 =null; + + CommonTree NEWLINE1_tree=null; + CommonTree EOF3_tree=null; + RewriteRuleTokenStream stream_NEWLINE=new RewriteRuleTokenStream(adaptor,"token NEWLINE"); + RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF"); + RewriteRuleSubtreeStream stream_resourceDefinitions=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinitions"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:224:6: ( ( NEWLINE )? ( resourceDefinitions )? EOF -> ^( FILE ( resourceDefinitions )? ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:224:8: ( NEWLINE )? ( resourceDefinitions )? EOF + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:224:8: ( NEWLINE )? + int alt1=2; + int LA1_0 = input.LA(1); + if ( (LA1_0==NEWLINE) ) { + alt1=1; + } + switch (alt1) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:224:8: NEWLINE + { + NEWLINE1=(Token)match(input,NEWLINE,FOLLOW_NEWLINE_in_file1230); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_NEWLINE.add(NEWLINE1); + + } + break; + + } + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:224:17: ( resourceDefinitions )? + int alt2=2; + int LA2_0 = input.LA(1); + if ( (LA2_0==FLOAT||LA2_0==ID||LA2_0==INT||(LA2_0 >= LBRACKET && LA2_0 <= LPAREN)||LA2_0==STRING||LA2_0==URI||(LA2_0 >= 65 && LA2_0 <= 66)||(LA2_0 >= 77 && LA2_0 <= 79)) ) { + alt2=1; + } + switch (alt2) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:224:17: resourceDefinitions + { + pushFollow(FOLLOW_resourceDefinitions_in_file1233); + resourceDefinitions2=resourceDefinitions(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions2.getTree()); + } + break; + + } + + EOF3=(Token)match(input,EOF,FOLLOW_EOF_in_file1236); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_EOF.add(EOF3); + + // AST REWRITE + // elements: resourceDefinitions + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 224:42: -> ^( FILE ( resourceDefinitions )? ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:224:45: ^( FILE ( resourceDefinitions )? ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(FILE, "FILE"), root_1); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:224:52: ( resourceDefinitions )? + if ( stream_resourceDefinitions.hasNext() ) { + adaptor.addChild(root_1, stream_resourceDefinitions.nextTree()); + } + stream_resourceDefinitions.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "file" + + + public static class resourceDefinitions_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "resourceDefinitions" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:226:1: resourceDefinitions : resourceDefinition ( NEWLINE ! resourceDefinition )* ; + public final GraphParser.resourceDefinitions_return resourceDefinitions() throws RecognitionException { + GraphParser.resourceDefinitions_return retval = new GraphParser.resourceDefinitions_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token NEWLINE5=null; + ParserRuleReturnScope resourceDefinition4 =null; + ParserRuleReturnScope resourceDefinition6 =null; + + CommonTree NEWLINE5_tree=null; + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:227:6: ( resourceDefinition ( NEWLINE ! resourceDefinition )* ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:227:8: resourceDefinition ( NEWLINE ! resourceDefinition )* + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_resourceDefinition_in_resourceDefinitions1260); + resourceDefinition4=resourceDefinition(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, resourceDefinition4.getTree()); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:227:27: ( NEWLINE ! resourceDefinition )* + loop3: + while (true) { + int alt3=2; + int LA3_0 = input.LA(1); + if ( (LA3_0==NEWLINE) ) { + alt3=1; + } + + switch (alt3) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:227:28: NEWLINE ! resourceDefinition + { + NEWLINE5=(Token)match(input,NEWLINE,FOLLOW_NEWLINE_in_resourceDefinitions1263); if (state.failed) return retval; + pushFollow(FOLLOW_resourceDefinition_in_resourceDefinitions1266); + resourceDefinition6=resourceDefinition(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, resourceDefinition6.getTree()); + + } + break; + + default : + break loop3; + } + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "resourceDefinitions" + + + public static class resourceDefinition_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "resourceDefinition" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:230:1: resourceDefinition : ( resource ( localProperty )* ( INDENT property ( NEWLINE property )* DEDENT )? -> ^( RESOURCE resource ( localProperty )* ( property )* ) | template -> ^( RESOURCE ^( BLANK template ) template ) ); + public final GraphParser.resourceDefinition_return resourceDefinition() throws RecognitionException { + GraphParser.resourceDefinition_return retval = new GraphParser.resourceDefinition_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token INDENT9=null; + Token NEWLINE11=null; + Token DEDENT13=null; + ParserRuleReturnScope resource7 =null; + ParserRuleReturnScope localProperty8 =null; + ParserRuleReturnScope property10 =null; + ParserRuleReturnScope property12 =null; + ParserRuleReturnScope template14 =null; + + CommonTree INDENT9_tree=null; + CommonTree NEWLINE11_tree=null; + CommonTree DEDENT13_tree=null; + RewriteRuleTokenStream stream_INDENT=new RewriteRuleTokenStream(adaptor,"token INDENT"); + RewriteRuleTokenStream stream_NEWLINE=new RewriteRuleTokenStream(adaptor,"token NEWLINE"); + RewriteRuleTokenStream stream_DEDENT=new RewriteRuleTokenStream(adaptor,"token DEDENT"); + RewriteRuleSubtreeStream stream_template=new RewriteRuleSubtreeStream(adaptor,"rule template"); + RewriteRuleSubtreeStream stream_resource=new RewriteRuleSubtreeStream(adaptor,"rule resource"); + RewriteRuleSubtreeStream stream_property=new RewriteRuleSubtreeStream(adaptor,"rule property"); + RewriteRuleSubtreeStream stream_localProperty=new RewriteRuleSubtreeStream(adaptor,"rule localProperty"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:231:5: ( resource ( localProperty )* ( INDENT property ( NEWLINE property )* DEDENT )? -> ^( RESOURCE resource ( localProperty )* ( property )* ) | template -> ^( RESOURCE ^( BLANK template ) template ) ) + int alt7=2; + int LA7_0 = input.LA(1); + if ( (LA7_0==FLOAT||LA7_0==ID||LA7_0==INT||(LA7_0 >= LBRACKET && LA7_0 <= LPAREN)||LA7_0==STRING||LA7_0==URI||(LA7_0 >= 65 && LA7_0 <= 66)||(LA7_0 >= 78 && LA7_0 <= 79)) ) { + alt7=1; + } + else if ( (LA7_0==77) ) { + alt7=2; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 7, 0, input); + throw nvae; + } + + switch (alt7) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:231:7: resource ( localProperty )* ( INDENT property ( NEWLINE property )* DEDENT )? + { + pushFollow(FOLLOW_resource_in_resourceDefinition1300); + resource7=resource(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_resource.add(resource7.getTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:232:7: ( localProperty )* + loop4: + while (true) { + int alt4=2; + int LA4_0 = input.LA(1); + if ( (LA4_0==ID||LA4_0==URI||LA4_0==66||LA4_0==68||(LA4_0 >= 70 && LA4_0 <= 76)) ) { + alt4=1; + } + + switch (alt4) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:232:7: localProperty + { + pushFollow(FOLLOW_localProperty_in_resourceDefinition1308); + localProperty8=localProperty(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_localProperty.add(localProperty8.getTree()); + } + break; + + default : + break loop4; + } + } + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:233:7: ( INDENT property ( NEWLINE property )* DEDENT )? + int alt6=2; + int LA6_0 = input.LA(1); + if ( (LA6_0==INDENT) ) { + alt6=1; + } + switch (alt6) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:233:8: INDENT property ( NEWLINE property )* DEDENT + { + INDENT9=(Token)match(input,INDENT,FOLLOW_INDENT_in_resourceDefinition1318); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_INDENT.add(INDENT9); + + pushFollow(FOLLOW_property_in_resourceDefinition1320); + property10=property(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_property.add(property10.getTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:233:24: ( NEWLINE property )* + loop5: + while (true) { + int alt5=2; + int LA5_0 = input.LA(1); + if ( (LA5_0==NEWLINE) ) { + alt5=1; + } + + switch (alt5) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:233:25: NEWLINE property + { + NEWLINE11=(Token)match(input,NEWLINE,FOLLOW_NEWLINE_in_resourceDefinition1323); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_NEWLINE.add(NEWLINE11); + + pushFollow(FOLLOW_property_in_resourceDefinition1325); + property12=property(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_property.add(property12.getTree()); + } + break; + + default : + break loop5; + } + } + + DEDENT13=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_resourceDefinition1329); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT13); + + } + break; + + } + + // AST REWRITE + // elements: localProperty, resource, property + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 234:5: -> ^( RESOURCE resource ( localProperty )* ( property )* ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:234:8: ^( RESOURCE resource ( localProperty )* ( property )* ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RESOURCE, "RESOURCE"), root_1); + adaptor.addChild(root_1, stream_resource.nextTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:234:28: ( localProperty )* + while ( stream_localProperty.hasNext() ) { + adaptor.addChild(root_1, stream_localProperty.nextTree()); + } + stream_localProperty.reset(); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:234:43: ( property )* + while ( stream_property.hasNext() ) { + adaptor.addChild(root_1, stream_property.nextTree()); + } + stream_property.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:235:7: template + { + pushFollow(FOLLOW_template_in_resourceDefinition1358); + template14=template(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_template.add(template14.getTree()); + // AST REWRITE + // elements: template, template + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 235:16: -> ^( RESOURCE ^( BLANK template ) template ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:235:19: ^( RESOURCE ^( BLANK template ) template ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RESOURCE, "RESOURCE"), root_1); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:235:30: ^( BLANK template ) + { + CommonTree root_2 = (CommonTree)adaptor.nil(); + root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(BLANK, "BLANK"), root_2); + adaptor.addChild(root_2, stream_template.nextTree()); + adaptor.addChild(root_1, root_2); + } + + adaptor.addChild(root_1, stream_template.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "resourceDefinition" + + + public static class localProperty_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "localProperty" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:238:1: localProperty : relation resource -> ^( PROPERTY relation ^( RESOURCE resource ) ) ; + public final GraphParser.localProperty_return localProperty() throws RecognitionException { + GraphParser.localProperty_return retval = new GraphParser.localProperty_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + ParserRuleReturnScope relation15 =null; + ParserRuleReturnScope resource16 =null; + + RewriteRuleSubtreeStream stream_resource=new RewriteRuleSubtreeStream(adaptor,"rule resource"); + RewriteRuleSubtreeStream stream_relation=new RewriteRuleSubtreeStream(adaptor,"rule relation"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:239:5: ( relation resource -> ^( PROPERTY relation ^( RESOURCE resource ) ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:239:7: relation resource + { + pushFollow(FOLLOW_relation_in_localProperty1393); + relation15=relation(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_relation.add(relation15.getTree()); + pushFollow(FOLLOW_resource_in_localProperty1395); + resource16=resource(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_resource.add(resource16.getTree()); + // AST REWRITE + // elements: relation, resource + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 240:5: -> ^( PROPERTY relation ^( RESOURCE resource ) ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:240:8: ^( PROPERTY relation ^( RESOURCE resource ) ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PROPERTY, "PROPERTY"), root_1); + adaptor.addChild(root_1, stream_relation.nextTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:240:28: ^( RESOURCE resource ) + { + CommonTree root_2 = (CommonTree)adaptor.nil(); + root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RESOURCE, "RESOURCE"), root_2); + adaptor.addChild(root_2, stream_resource.nextTree()); + adaptor.addChild(root_1, root_2); + } + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "localProperty" + + + public static class property_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "property" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:243:1: property : ( relation ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) ) | template ); + public final GraphParser.property_return property() throws RecognitionException { + GraphParser.property_return retval = new GraphParser.property_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token INDENT19=null; + Token DEDENT21=null; + ParserRuleReturnScope relation17 =null; + ParserRuleReturnScope resourceDefinition18 =null; + ParserRuleReturnScope resourceDefinitions20 =null; + ParserRuleReturnScope template22 =null; + + CommonTree INDENT19_tree=null; + CommonTree DEDENT21_tree=null; + RewriteRuleTokenStream stream_INDENT=new RewriteRuleTokenStream(adaptor,"token INDENT"); + RewriteRuleTokenStream stream_DEDENT=new RewriteRuleTokenStream(adaptor,"token DEDENT"); + RewriteRuleSubtreeStream stream_resourceDefinition=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinition"); + RewriteRuleSubtreeStream stream_resourceDefinitions=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinitions"); + RewriteRuleSubtreeStream stream_relation=new RewriteRuleSubtreeStream(adaptor,"rule relation"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:244:5: ( relation ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) ) | template ) + int alt9=2; + int LA9_0 = input.LA(1); + if ( (LA9_0==ID||LA9_0==URI||LA9_0==66||LA9_0==68||(LA9_0 >= 70 && LA9_0 <= 76)) ) { + alt9=1; + } + else if ( (LA9_0==77) ) { + alt9=2; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 9, 0, input); + throw nvae; + } + + switch (alt9) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:244:7: relation ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) ) + { + pushFollow(FOLLOW_relation_in_property1434); + relation17=relation(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_relation.add(relation17.getTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:245:7: ( resourceDefinition -> ^( PROPERTY relation resourceDefinition ) | INDENT resourceDefinitions DEDENT -> ^( PROPERTY relation resourceDefinitions ) ) + int alt8=2; + int LA8_0 = input.LA(1); + if ( (LA8_0==FLOAT||LA8_0==ID||LA8_0==INT||(LA8_0 >= LBRACKET && LA8_0 <= LPAREN)||LA8_0==STRING||LA8_0==URI||(LA8_0 >= 65 && LA8_0 <= 66)||(LA8_0 >= 77 && LA8_0 <= 79)) ) { + alt8=1; + } + else if ( (LA8_0==INDENT) ) { + alt8=2; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 8, 0, input); + throw nvae; + } + + switch (alt8) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:245:9: resourceDefinition + { + pushFollow(FOLLOW_resourceDefinition_in_property1444); + resourceDefinition18=resourceDefinition(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_resourceDefinition.add(resourceDefinition18.getTree()); + // AST REWRITE + // elements: relation, resourceDefinition + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 245:28: -> ^( PROPERTY relation resourceDefinition ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:245:31: ^( PROPERTY relation resourceDefinition ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PROPERTY, "PROPERTY"), root_1); + adaptor.addChild(root_1, stream_relation.nextTree()); + adaptor.addChild(root_1, stream_resourceDefinition.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:246:9: INDENT resourceDefinitions DEDENT + { + INDENT19=(Token)match(input,INDENT,FOLLOW_INDENT_in_property1464); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_INDENT.add(INDENT19); + + pushFollow(FOLLOW_resourceDefinitions_in_property1466); + resourceDefinitions20=resourceDefinitions(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions20.getTree()); + DEDENT21=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_property1468); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT21); + + // AST REWRITE + // elements: relation, resourceDefinitions + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 246:43: -> ^( PROPERTY relation resourceDefinitions ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:246:46: ^( PROPERTY relation resourceDefinitions ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(PROPERTY, "PROPERTY"), root_1); + adaptor.addChild(root_1, stream_relation.nextTree()); + adaptor.addChild(root_1, stream_resourceDefinitions.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:248:7: template + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_template_in_property1494); + template22=template(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, template22.getTree()); + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "property" + + + public static class template_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "template" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:251:1: template : '@' ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) ) ; + public final GraphParser.template_return template() throws RecognitionException { + GraphParser.template_return retval = new GraphParser.template_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token char_literal23=null; + Token ID24=null; + Token INDENT26=null; + Token DEDENT28=null; + Token INDENT30=null; + Token DEDENT32=null; + ParserRuleReturnScope resource25 =null; + ParserRuleReturnScope resourceDefinitions27 =null; + ParserRuleReturnScope resource29 =null; + ParserRuleReturnScope resourceDefinitions31 =null; + + CommonTree char_literal23_tree=null; + CommonTree ID24_tree=null; + CommonTree INDENT26_tree=null; + CommonTree DEDENT28_tree=null; + CommonTree INDENT30_tree=null; + CommonTree DEDENT32_tree=null; + RewriteRuleTokenStream stream_INDENT=new RewriteRuleTokenStream(adaptor,"token INDENT"); + RewriteRuleTokenStream stream_77=new RewriteRuleTokenStream(adaptor,"token 77"); + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + RewriteRuleTokenStream stream_DEDENT=new RewriteRuleTokenStream(adaptor,"token DEDENT"); + RewriteRuleSubtreeStream stream_resource=new RewriteRuleSubtreeStream(adaptor,"rule resource"); + RewriteRuleSubtreeStream stream_resourceDefinitions=new RewriteRuleSubtreeStream(adaptor,"rule resourceDefinitions"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:252:5: ( '@' ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:252:7: '@' ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) ) + { + char_literal23=(Token)match(input,77,FOLLOW_77_in_template1515); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_77.add(char_literal23); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:253:5: ({...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) | ( resource )+ ( INDENT resourceDefinitions DEDENT )? -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) ) + int alt13=2; + int LA13_0 = input.LA(1); + if ( (LA13_0==ID) ) { + int LA13_1 = input.LA(2); + if ( ((input.LT(1).getText().equals("template"))) ) { + alt13=1; + } + else if ( (true) ) { + alt13=2; + } + + } + else if ( (LA13_0==FLOAT||LA13_0==INT||(LA13_0 >= LBRACKET && LA13_0 <= LPAREN)||LA13_0==STRING||LA13_0==URI||(LA13_0 >= 65 && LA13_0 <= 66)||(LA13_0 >= 78 && LA13_0 <= 79)) ) { + alt13=2; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 13, 0, input); + throw nvae; + } + + switch (alt13) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:253:7: {...}? => ID ( resource )+ INDENT resourceDefinitions DEDENT + { + if ( !((input.LT(1).getText().equals("template"))) ) { + if (state.backtracking>0) {state.failed=true; return retval;} + throw new FailedPredicateException(input, "template", "input.LT(1).getText().equals(\"template\")"); + } + ID24=(Token)match(input,ID,FOLLOW_ID_in_template1533); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID24); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:254:10: ( resource )+ + int cnt10=0; + loop10: + while (true) { + int alt10=2; + int LA10_0 = input.LA(1); + if ( (LA10_0==FLOAT||LA10_0==ID||LA10_0==INT||(LA10_0 >= LBRACKET && LA10_0 <= LPAREN)||LA10_0==STRING||LA10_0==URI||(LA10_0 >= 65 && LA10_0 <= 66)||(LA10_0 >= 78 && LA10_0 <= 79)) ) { + alt10=1; + } + + switch (alt10) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:254:10: resource + { + pushFollow(FOLLOW_resource_in_template1535); + resource25=resource(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_resource.add(resource25.getTree()); + } + break; + + default : + if ( cnt10 >= 1 ) break loop10; + if (state.backtracking>0) {state.failed=true; return retval;} + EarlyExitException eee = new EarlyExitException(10, input); + throw eee; + } + cnt10++; + } + + INDENT26=(Token)match(input,INDENT,FOLLOW_INDENT_in_template1545); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_INDENT.add(INDENT26); + + pushFollow(FOLLOW_resourceDefinitions_in_template1547); + resourceDefinitions27=resourceDefinitions(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions27.getTree()); + DEDENT28=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_template1549); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT28); + + // AST REWRITE + // elements: resourceDefinitions, resource + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 256:7: -> ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:256:10: ^( TEMPLATE_DEFINITION ( resource )+ resourceDefinitions ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TEMPLATE_DEFINITION, "TEMPLATE_DEFINITION"), root_1); + if ( !(stream_resource.hasNext()) ) { + throw new RewriteEarlyExitException(); + } + while ( stream_resource.hasNext() ) { + adaptor.addChild(root_1, stream_resource.nextTree()); + } + stream_resource.reset(); + + adaptor.addChild(root_1, stream_resourceDefinitions.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:257:7: ( resource )+ ( INDENT resourceDefinitions DEDENT )? + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:257:7: ( resource )+ + int cnt11=0; + loop11: + while (true) { + int alt11=2; + int LA11_0 = input.LA(1); + if ( (LA11_0==FLOAT||LA11_0==ID||LA11_0==INT||(LA11_0 >= LBRACKET && LA11_0 <= LPAREN)||LA11_0==STRING||LA11_0==URI||(LA11_0 >= 65 && LA11_0 <= 66)||(LA11_0 >= 78 && LA11_0 <= 79)) ) { + alt11=1; + } + + switch (alt11) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:257:7: resource + { + pushFollow(FOLLOW_resource_in_template1574); + resource29=resource(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_resource.add(resource29.getTree()); + } + break; + + default : + if ( cnt11 >= 1 ) break loop11; + if (state.backtracking>0) {state.failed=true; return retval;} + EarlyExitException eee = new EarlyExitException(11, input); + throw eee; + } + cnt11++; + } + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:258:7: ( INDENT resourceDefinitions DEDENT )? + int alt12=2; + int LA12_0 = input.LA(1); + if ( (LA12_0==INDENT) ) { + alt12=1; + } + switch (alt12) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:258:8: INDENT resourceDefinitions DEDENT + { + INDENT30=(Token)match(input,INDENT,FOLLOW_INDENT_in_template1585); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_INDENT.add(INDENT30); + + pushFollow(FOLLOW_resourceDefinitions_in_template1587); + resourceDefinitions31=resourceDefinitions(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_resourceDefinitions.add(resourceDefinitions31.getTree()); + DEDENT32=(Token)match(input,DEDENT,FOLLOW_DEDENT_in_template1589); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_DEDENT.add(DEDENT32); + + } + break; + + } + + // AST REWRITE + // elements: resource, resourceDefinitions + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 259:7: -> ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:259:10: ^( TEMPLATE_INSTANCE ( resource )+ ( resourceDefinitions )? ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TEMPLATE_INSTANCE, "TEMPLATE_INSTANCE"), root_1); + if ( !(stream_resource.hasNext()) ) { + throw new RewriteEarlyExitException(); + } + while ( stream_resource.hasNext() ) { + adaptor.addChild(root_1, stream_resource.nextTree()); + } + stream_resource.reset(); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:259:40: ( resourceDefinitions )? + if ( stream_resourceDefinitions.hasNext() ) { + adaptor.addChild(root_1, stream_resourceDefinitions.nextTree()); + } + stream_resourceDefinitions.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "template" + + + public static class relation_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "relation" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:267:1: relation : ( ( ID -> ID ) ( '.' ID -> ^( REF $relation ID ) )* | URI | ' INHERITS | ' SUBRELATION_OF | '<--' -> HAS_DOMAIN | '-->' -> HAS_RANGE | '==>' -> REQUIRES_VALUE_TYPE | '>--' -> DOMAIN_OF | ':' -> INSTANCE_OF | '=' -> EQUALS | '%' ID -> ^( VARIABLE ID ) ); + public final GraphParser.relation_return relation() throws RecognitionException { + GraphParser.relation_return retval = new GraphParser.relation_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token ID33=null; + Token char_literal34=null; + Token ID35=null; + Token URI36=null; + Token string_literal37=null; + Token string_literal38=null; + Token string_literal39=null; + Token string_literal40=null; + Token string_literal41=null; + Token string_literal42=null; + Token char_literal43=null; + Token char_literal44=null; + Token char_literal45=null; + Token ID46=null; + + CommonTree ID33_tree=null; + CommonTree char_literal34_tree=null; + CommonTree ID35_tree=null; + CommonTree URI36_tree=null; + CommonTree string_literal37_tree=null; + CommonTree string_literal38_tree=null; + CommonTree string_literal39_tree=null; + CommonTree string_literal40_tree=null; + CommonTree string_literal41_tree=null; + CommonTree string_literal42_tree=null; + CommonTree char_literal43_tree=null; + CommonTree char_literal44_tree=null; + CommonTree char_literal45_tree=null; + CommonTree ID46_tree=null; + RewriteRuleTokenStream stream_66=new RewriteRuleTokenStream(adaptor,"token 66"); + RewriteRuleTokenStream stream_68=new RewriteRuleTokenStream(adaptor,"token 68"); + RewriteRuleTokenStream stream_69=new RewriteRuleTokenStream(adaptor,"token 69"); + RewriteRuleTokenStream stream_70=new RewriteRuleTokenStream(adaptor,"token 70"); + RewriteRuleTokenStream stream_71=new RewriteRuleTokenStream(adaptor,"token 71"); + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + RewriteRuleTokenStream stream_72=new RewriteRuleTokenStream(adaptor,"token 72"); + RewriteRuleTokenStream stream_73=new RewriteRuleTokenStream(adaptor,"token 73"); + RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74"); + RewriteRuleTokenStream stream_75=new RewriteRuleTokenStream(adaptor,"token 75"); + RewriteRuleTokenStream stream_76=new RewriteRuleTokenStream(adaptor,"token 76"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:268:5: ( ( ID -> ID ) ( '.' ID -> ^( REF $relation ID ) )* | URI | ' INHERITS | ' SUBRELATION_OF | '<--' -> HAS_DOMAIN | '-->' -> HAS_RANGE | '==>' -> REQUIRES_VALUE_TYPE | '>--' -> DOMAIN_OF | ':' -> INSTANCE_OF | '=' -> EQUALS | '%' ID -> ^( VARIABLE ID ) ) + int alt15=11; + switch ( input.LA(1) ) { + case ID: + { + alt15=1; + } + break; + case URI: + { + alt15=2; + } + break; + case 73: + { + alt15=3; + } + break; + case 72: + { + alt15=4; + } + break; + case 71: + { + alt15=5; + } + break; + case 68: + { + alt15=6; + } + break; + case 75: + { + alt15=7; + } + break; + case 76: + { + alt15=8; + } + break; + case 70: + { + alt15=9; + } + break; + case 74: + { + alt15=10; + } + break; + case 66: + { + alt15=11; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 15, 0, input); + throw nvae; + } + switch (alt15) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:268:7: ( ID -> ID ) ( '.' ID -> ^( REF $relation ID ) )* + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:268:7: ( ID -> ID ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:268:9: ID + { + ID33=(Token)match(input,ID,FOLLOW_ID_in_relation1643); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID33); + + // AST REWRITE + // elements: ID + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 268:12: -> ID + { + adaptor.addChild(root_0, stream_ID.nextNode()); + } + + + retval.tree = root_0; + } + + } + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:269:7: ( '.' ID -> ^( REF $relation ID ) )* + loop14: + while (true) { + int alt14=2; + int LA14_0 = input.LA(1); + if ( (LA14_0==69) ) { + alt14=1; + } + + switch (alt14) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:269:8: '.' ID + { + char_literal34=(Token)match(input,69,FOLLOW_69_in_relation1658); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_69.add(char_literal34); + + ID35=(Token)match(input,ID,FOLLOW_ID_in_relation1660); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID35); + + // AST REWRITE + // elements: relation, ID + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 269:15: -> ^( REF $relation ID ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:269:18: ^( REF $relation ID ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(REF, "REF"), root_1); + adaptor.addChild(root_1, stream_retval.nextTree()); + adaptor.addChild(root_1, stream_ID.nextNode()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + + default : + break loop14; + } + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:270:7: URI + { + root_0 = (CommonTree)adaptor.nil(); + + + URI36=(Token)match(input,URI,FOLLOW_URI_in_relation1681); if (state.failed) return retval; + if ( state.backtracking==0 ) { + URI36_tree = (CommonTree)adaptor.create(URI36); + adaptor.addChild(root_0, URI36_tree); + } + + } + break; + case 3 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:271:7: ' INHERITS + { + adaptor.addChild(root_0, (CommonTree)adaptor.create(INHERITS, "INHERITS")); + } + + + retval.tree = root_0; + } + + } + break; + case 4 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:272:7: ' SUBRELATION_OF + { + adaptor.addChild(root_0, (CommonTree)adaptor.create(SUBRELATION_OF, "SUBRELATION_OF")); + } + + + retval.tree = root_0; + } + + } + break; + case 5 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:273:7: '<--' + { + string_literal39=(Token)match(input,71,FOLLOW_71_in_relation1713); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_71.add(string_literal39); + + // AST REWRITE + // elements: + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 273:13: -> HAS_DOMAIN + { + adaptor.addChild(root_0, (CommonTree)adaptor.create(HAS_DOMAIN, "HAS_DOMAIN")); + } + + + retval.tree = root_0; + } + + } + break; + case 6 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:274:7: '-->' + { + string_literal40=(Token)match(input,68,FOLLOW_68_in_relation1725); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_68.add(string_literal40); + + // AST REWRITE + // elements: + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 274:13: -> HAS_RANGE + { + adaptor.addChild(root_0, (CommonTree)adaptor.create(HAS_RANGE, "HAS_RANGE")); + } + + + retval.tree = root_0; + } + + } + break; + case 7 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:275:7: '==>' + { + string_literal41=(Token)match(input,75,FOLLOW_75_in_relation1737); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_75.add(string_literal41); + + // AST REWRITE + // elements: + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 275:13: -> REQUIRES_VALUE_TYPE + { + adaptor.addChild(root_0, (CommonTree)adaptor.create(REQUIRES_VALUE_TYPE, "REQUIRES_VALUE_TYPE")); + } + + + retval.tree = root_0; + } + + } + break; + case 8 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:276:7: '>--' + { + string_literal42=(Token)match(input,76,FOLLOW_76_in_relation1749); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_76.add(string_literal42); + + // AST REWRITE + // elements: + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 276:13: -> DOMAIN_OF + { + adaptor.addChild(root_0, (CommonTree)adaptor.create(DOMAIN_OF, "DOMAIN_OF")); + } + + + retval.tree = root_0; + } + + } + break; + case 9 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:277:7: ':' + { + char_literal43=(Token)match(input,70,FOLLOW_70_in_relation1765); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_70.add(char_literal43); + + // AST REWRITE + // elements: + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 277:11: -> INSTANCE_OF + { + adaptor.addChild(root_0, (CommonTree)adaptor.create(INSTANCE_OF, "INSTANCE_OF")); + } + + + retval.tree = root_0; + } + + } + break; + case 10 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:278:7: '=' + { + char_literal44=(Token)match(input,74,FOLLOW_74_in_relation1777); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_74.add(char_literal44); + + // AST REWRITE + // elements: + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 278:11: -> EQUALS + { + adaptor.addChild(root_0, (CommonTree)adaptor.create(EQUALS, "EQUALS")); + } + + + retval.tree = root_0; + } + + } + break; + case 11 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:279:7: '%' ID + { + char_literal45=(Token)match(input,66,FOLLOW_66_in_relation1789); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_66.add(char_literal45); + + ID46=(Token)match(input,ID,FOLLOW_ID_in_relation1791); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID46); + + // AST REWRITE + // elements: ID + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 279:14: -> ^( VARIABLE ID ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:279:17: ^( VARIABLE ID ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIABLE, "VARIABLE"), root_1); + adaptor.addChild(root_1, stream_ID.nextNode()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "relation" + + + public static class resource_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "resource" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:282:1: resource : ( ({...}? => ID -> ^( BLANK ID ) | ID -> ID ) ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )* | URI | simpleValue -> ^( EMBEDDED_VALUE simpleValue ) | '$' basicType -> ^( EMBEDDED_TYPE basicType ) | '%' ID -> ^( VARIABLE ID ) ); + public final GraphParser.resource_return resource() throws RecognitionException { + GraphParser.resource_return retval = new GraphParser.resource_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token ID47=null; + Token ID48=null; + Token char_literal49=null; + Token ID50=null; + Token STRING51=null; + Token URI52=null; + Token char_literal54=null; + Token char_literal56=null; + Token ID57=null; + ParserRuleReturnScope simpleValue53 =null; + ParserRuleReturnScope basicType55 =null; + + CommonTree ID47_tree=null; + CommonTree ID48_tree=null; + CommonTree char_literal49_tree=null; + CommonTree ID50_tree=null; + CommonTree STRING51_tree=null; + CommonTree URI52_tree=null; + CommonTree char_literal54_tree=null; + CommonTree char_literal56_tree=null; + CommonTree ID57_tree=null; + RewriteRuleTokenStream stream_66=new RewriteRuleTokenStream(adaptor,"token 66"); + RewriteRuleTokenStream stream_69=new RewriteRuleTokenStream(adaptor,"token 69"); + RewriteRuleTokenStream stream_STRING=new RewriteRuleTokenStream(adaptor,"token STRING"); + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + RewriteRuleTokenStream stream_65=new RewriteRuleTokenStream(adaptor,"token 65"); + RewriteRuleSubtreeStream stream_basicType=new RewriteRuleSubtreeStream(adaptor,"rule basicType"); + RewriteRuleSubtreeStream stream_simpleValue=new RewriteRuleSubtreeStream(adaptor,"rule simpleValue"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:283:5: ( ({...}? => ID -> ^( BLANK ID ) | ID -> ID ) ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )* | URI | simpleValue -> ^( EMBEDDED_VALUE simpleValue ) | '$' basicType -> ^( EMBEDDED_TYPE basicType ) | '%' ID -> ^( VARIABLE ID ) ) + int alt19=5; + switch ( input.LA(1) ) { + case ID: + { + alt19=1; + } + break; + case URI: + { + alt19=2; + } + break; + case FLOAT: + case INT: + case LBRACKET: + case LCURLY: + case LPAREN: + case STRING: + case 78: + case 79: + { + alt19=3; + } + break; + case 65: + { + alt19=4; + } + break; + case 66: + { + alt19=5; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 19, 0, input); + throw nvae; + } + switch (alt19) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:283:7: ({...}? => ID -> ^( BLANK ID ) | ID -> ID ) ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )* + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:283:7: ({...}? => ID -> ^( BLANK ID ) | ID -> ID ) + int alt16=2; + int LA16_0 = input.LA(1); + if ( (LA16_0==ID) ) { + int LA16_1 = input.LA(2); + if ( ((input.LT(1).getText().equals("_"))) ) { + alt16=1; + } + else if ( (true) ) { + alt16=2; + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 16, 0, input); + throw nvae; + } + + switch (alt16) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:283:9: {...}? => ID + { + if ( !((input.LT(1).getText().equals("_"))) ) { + if (state.backtracking>0) {state.failed=true; return retval;} + throw new FailedPredicateException(input, "resource", "input.LT(1).getText().equals(\"_\")"); + } + ID47=(Token)match(input,ID,FOLLOW_ID_in_resource1821); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID47); + + // AST REWRITE + // elements: ID + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 283:51: -> ^( BLANK ID ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:283:54: ^( BLANK ID ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(BLANK, "BLANK"), root_1); + adaptor.addChild(root_1, stream_ID.nextNode()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:284:9: ID + { + ID48=(Token)match(input,ID,FOLLOW_ID_in_resource1840); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID48); + + // AST REWRITE + // elements: ID + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 284:12: -> ID + { + adaptor.addChild(root_0, stream_ID.nextNode()); + } + + + retval.tree = root_0; + } + + } + break; + + } + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:285:7: ( '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) )* + loop18: + while (true) { + int alt18=2; + int LA18_0 = input.LA(1); + if ( (LA18_0==69) ) { + alt18=1; + } + + switch (alt18) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:285:8: '.' ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) + { + char_literal49=(Token)match(input,69,FOLLOW_69_in_resource1855); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_69.add(char_literal49); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:285:12: ( ID -> ^( REF $resource ID ) | STRING -> ^( REF $resource STRING ) ) + int alt17=2; + int LA17_0 = input.LA(1); + if ( (LA17_0==ID) ) { + alt17=1; + } + else if ( (LA17_0==STRING) ) { + alt17=2; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 17, 0, input); + throw nvae; + } + + switch (alt17) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:285:13: ID + { + ID50=(Token)match(input,ID,FOLLOW_ID_in_resource1858); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID50); + + // AST REWRITE + // elements: ID, resource + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 285:16: -> ^( REF $resource ID ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:285:19: ^( REF $resource ID ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(REF, "REF"), root_1); + adaptor.addChild(root_1, stream_retval.nextTree()); + adaptor.addChild(root_1, stream_ID.nextNode()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:286:13: STRING + { + STRING51=(Token)match(input,STRING,FOLLOW_STRING_in_resource1883); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_STRING.add(STRING51); + + // AST REWRITE + // elements: STRING, resource + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 286:20: -> ^( REF $resource STRING ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:286:23: ^( REF $resource STRING ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(REF, "REF"), root_1); + adaptor.addChild(root_1, stream_retval.nextTree()); + adaptor.addChild(root_1, stream_STRING.nextNode()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + + } + + } + break; + + default : + break loop18; + } + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:289:7: URI + { + root_0 = (CommonTree)adaptor.nil(); + + + URI52=(Token)match(input,URI,FOLLOW_URI_in_resource1924); if (state.failed) return retval; + if ( state.backtracking==0 ) { + URI52_tree = (CommonTree)adaptor.create(URI52); + adaptor.addChild(root_0, URI52_tree); + } + + } + break; + case 3 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:290:7: simpleValue + { + pushFollow(FOLLOW_simpleValue_in_resource1932); + simpleValue53=simpleValue(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_simpleValue.add(simpleValue53.getTree()); + // AST REWRITE + // elements: simpleValue + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 290:19: -> ^( EMBEDDED_VALUE simpleValue ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:290:22: ^( EMBEDDED_VALUE simpleValue ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(EMBEDDED_VALUE, "EMBEDDED_VALUE"), root_1); + adaptor.addChild(root_1, stream_simpleValue.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + case 4 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:291:7: '$' basicType + { + char_literal54=(Token)match(input,65,FOLLOW_65_in_resource1948); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_65.add(char_literal54); + + pushFollow(FOLLOW_basicType_in_resource1950); + basicType55=basicType(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_basicType.add(basicType55.getTree()); + // AST REWRITE + // elements: basicType + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 291:21: -> ^( EMBEDDED_TYPE basicType ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:291:24: ^( EMBEDDED_TYPE basicType ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(EMBEDDED_TYPE, "EMBEDDED_TYPE"), root_1); + adaptor.addChild(root_1, stream_basicType.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + case 5 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:292:7: '%' ID + { + char_literal56=(Token)match(input,66,FOLLOW_66_in_resource1966); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_66.add(char_literal56); + + ID57=(Token)match(input,ID,FOLLOW_ID_in_resource1968); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID57); + + // AST REWRITE + // elements: ID + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 292:14: -> ^( VARIABLE ID ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:292:17: ^( VARIABLE ID ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIABLE, "VARIABLE"), root_1); + adaptor.addChild(root_1, stream_ID.nextNode()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "resource" + + + public static class type_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "type" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:306:1: type : ( arrayType | unionType ); + public final GraphParser.type_return type() throws RecognitionException { + GraphParser.type_return retval = new GraphParser.type_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + ParserRuleReturnScope arrayType58 =null; + ParserRuleReturnScope unionType59 =null; + + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:307:5: ( arrayType | unionType ) + int alt20=2; + int LA20_0 = input.LA(1); + if ( (LA20_0==ID||(LA20_0 >= LCURLY && LA20_0 <= LPAREN)) ) { + alt20=1; + } + else if ( (LA20_0==80) ) { + alt20=2; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 20, 0, input); + throw nvae; + } + + switch (alt20) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:307:7: arrayType + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_arrayType_in_type2004); + arrayType58=arrayType(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, arrayType58.getTree()); + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:308:7: unionType + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_unionType_in_type2012); + unionType59=unionType(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, unionType59.getTree()); + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "type" + + + public static class unionType_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "unionType" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:311:1: unionType : ( '|' unionComponent )+ -> ^( UNION_TYPE ( unionComponent )+ ) ; + public final GraphParser.unionType_return unionType() throws RecognitionException { + GraphParser.unionType_return retval = new GraphParser.unionType_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token char_literal60=null; + ParserRuleReturnScope unionComponent61 =null; + + CommonTree char_literal60_tree=null; + RewriteRuleTokenStream stream_80=new RewriteRuleTokenStream(adaptor,"token 80"); + RewriteRuleSubtreeStream stream_unionComponent=new RewriteRuleSubtreeStream(adaptor,"rule unionComponent"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:312:5: ( ( '|' unionComponent )+ -> ^( UNION_TYPE ( unionComponent )+ ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:313:6: ( '|' unionComponent )+ + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:313:6: ( '|' unionComponent )+ + int cnt21=0; + loop21: + while (true) { + int alt21=2; + int LA21_0 = input.LA(1); + if ( (LA21_0==80) ) { + alt21=1; + } + + switch (alt21) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:313:7: '|' unionComponent + { + char_literal60=(Token)match(input,80,FOLLOW_80_in_unionType2041); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_80.add(char_literal60); + + pushFollow(FOLLOW_unionComponent_in_unionType2043); + unionComponent61=unionComponent(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_unionComponent.add(unionComponent61.getTree()); + } + break; + + default : + if ( cnt21 >= 1 ) break loop21; + if (state.backtracking>0) {state.failed=true; return retval;} + EarlyExitException eee = new EarlyExitException(21, input); + throw eee; + } + cnt21++; + } + + // AST REWRITE + // elements: unionComponent + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 314:5: -> ^( UNION_TYPE ( unionComponent )+ ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:314:8: ^( UNION_TYPE ( unionComponent )+ ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(UNION_TYPE, "UNION_TYPE"), root_1); + if ( !(stream_unionComponent.hasNext()) ) { + throw new RewriteEarlyExitException(); + } + while ( stream_unionComponent.hasNext() ) { + adaptor.addChild(root_1, stream_unionComponent.nextTree()); + } + stream_unionComponent.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "unionType" + + + public static class unionComponent_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "unionComponent" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:317:1: unionComponent : ID ( ( arrayType )=> arrayType )? -> ^( TYPE_COMPONENT ID ( arrayType )? ) ; + public final GraphParser.unionComponent_return unionComponent() throws RecognitionException { + GraphParser.unionComponent_return retval = new GraphParser.unionComponent_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token ID62=null; + ParserRuleReturnScope arrayType63 =null; + + CommonTree ID62_tree=null; + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + RewriteRuleSubtreeStream stream_arrayType=new RewriteRuleSubtreeStream(adaptor,"rule arrayType"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:317:16: ( ID ( ( arrayType )=> arrayType )? -> ^( TYPE_COMPONENT ID ( arrayType )? ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:317:18: ID ( ( arrayType )=> arrayType )? + { + ID62=(Token)match(input,ID,FOLLOW_ID_in_unionComponent2071); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID62); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:317:21: ( ( arrayType )=> arrayType )? + int alt22=2; + int LA22_0 = input.LA(1); + if ( (LA22_0==LPAREN) && (synpred1_Graph())) { + alt22=1; + } + else if ( (LA22_0==LCURLY) && (synpred1_Graph())) { + alt22=1; + } + else if ( (LA22_0==ID) ) { + int LA22_3 = input.LA(2); + if ( (synpred1_Graph()) ) { + alt22=1; + } + } + switch (alt22) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:317:22: ( arrayType )=> arrayType + { + pushFollow(FOLLOW_arrayType_in_unionComponent2080); + arrayType63=arrayType(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_arrayType.add(arrayType63.getTree()); + } + break; + + } + + // AST REWRITE + // elements: ID, arrayType + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 317:49: -> ^( TYPE_COMPONENT ID ( arrayType )? ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:317:52: ^( TYPE_COMPONENT ID ( arrayType )? ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_COMPONENT, "TYPE_COMPONENT"), root_1); + adaptor.addChild(root_1, stream_ID.nextNode()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:317:72: ( arrayType )? + if ( stream_arrayType.hasNext() ) { + adaptor.addChild(root_1, stream_arrayType.nextTree()); + } + stream_arrayType.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "unionComponent" + + + public static class arrayType_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "arrayType" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:319:1: arrayType : ( basicType -> basicType ) ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )* ; + public final GraphParser.arrayType_return arrayType() throws RecognitionException { + GraphParser.arrayType_return retval = new GraphParser.arrayType_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token LBRACKET65=null; + Token RBRACKET67=null; + ParserRuleReturnScope basicType64 =null; + ParserRuleReturnScope arrayLength66 =null; + + CommonTree LBRACKET65_tree=null; + CommonTree RBRACKET67_tree=null; + RewriteRuleTokenStream stream_LBRACKET=new RewriteRuleTokenStream(adaptor,"token LBRACKET"); + RewriteRuleTokenStream stream_RBRACKET=new RewriteRuleTokenStream(adaptor,"token RBRACKET"); + RewriteRuleSubtreeStream stream_basicType=new RewriteRuleSubtreeStream(adaptor,"rule basicType"); + RewriteRuleSubtreeStream stream_arrayLength=new RewriteRuleSubtreeStream(adaptor,"rule arrayLength"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:320:5: ( ( basicType -> basicType ) ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )* ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:320:7: ( basicType -> basicType ) ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )* + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:320:7: ( basicType -> basicType ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:320:8: basicType + { + pushFollow(FOLLOW_basicType_in_arrayType2108); + basicType64=basicType(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_basicType.add(basicType64.getTree()); + // AST REWRITE + // elements: basicType + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 320:18: -> basicType + { + adaptor.addChild(root_0, stream_basicType.nextTree()); + } + + + retval.tree = root_0; + } + + } + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:321:7: ( LBRACKET ( arrayLength )? RBRACKET -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) )* + loop24: + while (true) { + int alt24=2; + int LA24_0 = input.LA(1); + if ( (LA24_0==LBRACKET) ) { + alt24=1; + } + + switch (alt24) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:321:8: LBRACKET ( arrayLength )? RBRACKET + { + LBRACKET65=(Token)match(input,LBRACKET,FOLLOW_LBRACKET_in_arrayType2122); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_LBRACKET.add(LBRACKET65); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:321:17: ( arrayLength )? + int alt23=2; + int LA23_0 = input.LA(1); + if ( ((LA23_0 >= INT && LA23_0 <= INT_RANGE)) ) { + alt23=1; + } + switch (alt23) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:321:17: arrayLength + { + pushFollow(FOLLOW_arrayLength_in_arrayType2124); + arrayLength66=arrayLength(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_arrayLength.add(arrayLength66.getTree()); + } + break; + + } + + RBRACKET67=(Token)match(input,RBRACKET,FOLLOW_RBRACKET_in_arrayType2127); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_RBRACKET.add(RBRACKET67); + + // AST REWRITE + // elements: arrayLength, arrayType + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 321:39: -> ^( ARRAY_TYPE $arrayType ( arrayLength )? ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:321:42: ^( ARRAY_TYPE $arrayType ( arrayLength )? ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ARRAY_TYPE, "ARRAY_TYPE"), root_1); + adaptor.addChild(root_1, stream_retval.nextTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:321:66: ( arrayLength )? + if ( stream_arrayLength.hasNext() ) { + adaptor.addChild(root_1, stream_arrayLength.nextTree()); + } + stream_arrayLength.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + + default : + break loop24; + } + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "arrayType" + + + public static class arrayLength_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "arrayLength" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:323:1: arrayLength : ( INT | INT_RANGE ); + public final GraphParser.arrayLength_return arrayLength() throws RecognitionException { + GraphParser.arrayLength_return retval = new GraphParser.arrayLength_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token set68=null; + + CommonTree set68_tree=null; + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:324:5: ( INT | INT_RANGE ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + root_0 = (CommonTree)adaptor.nil(); + + + set68=input.LT(1); + if ( (input.LA(1) >= INT && input.LA(1) <= INT_RANGE) ) { + input.consume(); + if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set68)); + state.errorRecovery=false; + state.failed=false; + } + else { + if (state.backtracking>0) {state.failed=true; return retval;} + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "arrayLength" + + + public static class basicType_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "basicType" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:328:1: basicType : ( tupleType | recordType | typeReference ); + public final GraphParser.basicType_return basicType() throws RecognitionException { + GraphParser.basicType_return retval = new GraphParser.basicType_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + ParserRuleReturnScope tupleType69 =null; + ParserRuleReturnScope recordType70 =null; + ParserRuleReturnScope typeReference71 =null; + + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:329:5: ( tupleType | recordType | typeReference ) + int alt25=3; + switch ( input.LA(1) ) { + case LPAREN: + { + alt25=1; + } + break; + case LCURLY: + { + alt25=2; + } + break; + case ID: + { + alt25=3; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 25, 0, input); + throw nvae; + } + switch (alt25) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:329:7: tupleType + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_tupleType_in_basicType2181); + tupleType69=tupleType(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, tupleType69.getTree()); + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:330:7: recordType + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_recordType_in_basicType2189); + recordType70=recordType(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, recordType70.getTree()); + + } + break; + case 3 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:331:7: typeReference + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_typeReference_in_basicType2197); + typeReference71=typeReference(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, typeReference71.getTree()); + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "basicType" + + + public static class tupleType_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "tupleType" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:334:1: tupleType : LPAREN ( type ( ',' type )* )? RPAREN -> ^( TUPLE_TYPE ( type )* ) ; + public final GraphParser.tupleType_return tupleType() throws RecognitionException { + GraphParser.tupleType_return retval = new GraphParser.tupleType_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token LPAREN72=null; + Token char_literal74=null; + Token RPAREN76=null; + ParserRuleReturnScope type73 =null; + ParserRuleReturnScope type75 =null; + + CommonTree LPAREN72_tree=null; + CommonTree char_literal74_tree=null; + CommonTree RPAREN76_tree=null; + RewriteRuleTokenStream stream_67=new RewriteRuleTokenStream(adaptor,"token 67"); + RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN"); + RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN"); + RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:335:5: ( LPAREN ( type ( ',' type )* )? RPAREN -> ^( TUPLE_TYPE ( type )* ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:335:7: LPAREN ( type ( ',' type )* )? RPAREN + { + LPAREN72=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_tupleType2219); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN72); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:335:14: ( type ( ',' type )* )? + int alt27=2; + int LA27_0 = input.LA(1); + if ( (LA27_0==ID||(LA27_0 >= LCURLY && LA27_0 <= LPAREN)||LA27_0==80) ) { + alt27=1; + } + switch (alt27) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:335:15: type ( ',' type )* + { + pushFollow(FOLLOW_type_in_tupleType2222); + type73=type(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_type.add(type73.getTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:335:20: ( ',' type )* + loop26: + while (true) { + int alt26=2; + int LA26_0 = input.LA(1); + if ( (LA26_0==67) ) { + alt26=1; + } + + switch (alt26) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:335:21: ',' type + { + char_literal74=(Token)match(input,67,FOLLOW_67_in_tupleType2225); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_67.add(char_literal74); + + pushFollow(FOLLOW_type_in_tupleType2227); + type75=type(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_type.add(type75.getTree()); + } + break; + + default : + break loop26; + } + } + + } + break; + + } + + RPAREN76=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_tupleType2233); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN76); + + // AST REWRITE + // elements: type + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 336:5: -> ^( TUPLE_TYPE ( type )* ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:336:8: ^( TUPLE_TYPE ( type )* ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TUPLE_TYPE, "TUPLE_TYPE"), root_1); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:336:21: ( type )* + while ( stream_type.hasNext() ) { + adaptor.addChild(root_1, stream_type.nextTree()); + } + stream_type.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "tupleType" + + + public static class recordType_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "recordType" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:339:1: recordType : LCURLY ( component ( ',' component )* )? RCURLY -> ^( RECORD_TYPE ( component )* ) ; + public final GraphParser.recordType_return recordType() throws RecognitionException { + GraphParser.recordType_return retval = new GraphParser.recordType_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token LCURLY77=null; + Token char_literal79=null; + Token RCURLY81=null; + ParserRuleReturnScope component78 =null; + ParserRuleReturnScope component80 =null; + + CommonTree LCURLY77_tree=null; + CommonTree char_literal79_tree=null; + CommonTree RCURLY81_tree=null; + RewriteRuleTokenStream stream_67=new RewriteRuleTokenStream(adaptor,"token 67"); + RewriteRuleTokenStream stream_LCURLY=new RewriteRuleTokenStream(adaptor,"token LCURLY"); + RewriteRuleTokenStream stream_RCURLY=new RewriteRuleTokenStream(adaptor,"token RCURLY"); + RewriteRuleSubtreeStream stream_component=new RewriteRuleSubtreeStream(adaptor,"rule component"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:340:5: ( LCURLY ( component ( ',' component )* )? RCURLY -> ^( RECORD_TYPE ( component )* ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:340:7: LCURLY ( component ( ',' component )* )? RCURLY + { + LCURLY77=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_recordType2266); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_LCURLY.add(LCURLY77); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:340:14: ( component ( ',' component )* )? + int alt29=2; + int LA29_0 = input.LA(1); + if ( (LA29_0==ID) ) { + alt29=1; + } + switch (alt29) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:340:15: component ( ',' component )* + { + pushFollow(FOLLOW_component_in_recordType2269); + component78=component(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_component.add(component78.getTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:340:25: ( ',' component )* + loop28: + while (true) { + int alt28=2; + int LA28_0 = input.LA(1); + if ( (LA28_0==67) ) { + alt28=1; + } + + switch (alt28) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:340:26: ',' component + { + char_literal79=(Token)match(input,67,FOLLOW_67_in_recordType2272); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_67.add(char_literal79); + + pushFollow(FOLLOW_component_in_recordType2274); + component80=component(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_component.add(component80.getTree()); + } + break; + + default : + break loop28; + } + } + + } + break; + + } + + RCURLY81=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_recordType2280); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_RCURLY.add(RCURLY81); + + // AST REWRITE + // elements: component + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 341:5: -> ^( RECORD_TYPE ( component )* ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:341:8: ^( RECORD_TYPE ( component )* ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RECORD_TYPE, "RECORD_TYPE"), root_1); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:341:22: ( component )* + while ( stream_component.hasNext() ) { + adaptor.addChild(root_1, stream_component.nextTree()); + } + stream_component.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "recordType" + + + public static class component_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "component" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:344:1: component : ID ':' type -> ^( TYPE_COMPONENT ID type ) ; + public final GraphParser.component_return component() throws RecognitionException { + GraphParser.component_return retval = new GraphParser.component_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token ID82=null; + Token char_literal83=null; + ParserRuleReturnScope type84 =null; + + CommonTree ID82_tree=null; + CommonTree char_literal83_tree=null; + RewriteRuleTokenStream stream_70=new RewriteRuleTokenStream(adaptor,"token 70"); + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:345:5: ( ID ':' type -> ^( TYPE_COMPONENT ID type ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:345:7: ID ':' type + { + ID82=(Token)match(input,ID,FOLLOW_ID_in_component2312); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID82); + + char_literal83=(Token)match(input,70,FOLLOW_70_in_component2314); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_70.add(char_literal83); + + pushFollow(FOLLOW_type_in_component2316); + type84=type(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_type.add(type84.getTree()); + // AST REWRITE + // elements: type, ID + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 346:5: -> ^( TYPE_COMPONENT ID type ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:346:8: ^( TYPE_COMPONENT ID type ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_COMPONENT, "TYPE_COMPONENT"), root_1); + adaptor.addChild(root_1, stream_ID.nextNode()); + adaptor.addChild(root_1, stream_type.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "component" + + + public static class typeReference_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "typeReference" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:349:1: typeReference : ID ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )? -> ^( TYPE_REFERENCE ID ( parameter )* ) ; + public final GraphParser.typeReference_return typeReference() throws RecognitionException { + GraphParser.typeReference_return retval = new GraphParser.typeReference_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token ID85=null; + Token LPAREN86=null; + Token char_literal88=null; + Token RPAREN90=null; + ParserRuleReturnScope parameter87 =null; + ParserRuleReturnScope parameter89 =null; + + CommonTree ID85_tree=null; + CommonTree LPAREN86_tree=null; + CommonTree char_literal88_tree=null; + CommonTree RPAREN90_tree=null; + RewriteRuleTokenStream stream_67=new RewriteRuleTokenStream(adaptor,"token 67"); + RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN"); + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN"); + RewriteRuleSubtreeStream stream_parameter=new RewriteRuleSubtreeStream(adaptor,"rule parameter"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:350:5: ( ID ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )? -> ^( TYPE_REFERENCE ID ( parameter )* ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:350:7: ID ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )? + { + ID85=(Token)match(input,ID,FOLLOW_ID_in_typeReference2350); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID85); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:350:10: ( ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN )? + int alt31=2; + int LA31_0 = input.LA(1); + if ( (LA31_0==LPAREN) ) { + int LA31_1 = input.LA(2); + if ( (synpred2_Graph()) ) { + alt31=1; + } + } + switch (alt31) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:350:11: ( LPAREN )=> LPAREN parameter ( ',' parameter )* RPAREN + { + LPAREN86=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_typeReference2358); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN86); + + pushFollow(FOLLOW_parameter_in_typeReference2360); + parameter87=parameter(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_parameter.add(parameter87.getTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:350:39: ( ',' parameter )* + loop30: + while (true) { + int alt30=2; + int LA30_0 = input.LA(1); + if ( (LA30_0==67) ) { + alt30=1; + } + + switch (alt30) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:350:40: ',' parameter + { + char_literal88=(Token)match(input,67,FOLLOW_67_in_typeReference2363); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_67.add(char_literal88); + + pushFollow(FOLLOW_parameter_in_typeReference2365); + parameter89=parameter(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_parameter.add(parameter89.getTree()); + } + break; + + default : + break loop30; + } + } + + RPAREN90=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_typeReference2369); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN90); + + } + break; + + } + + // AST REWRITE + // elements: parameter, ID + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 351:5: -> ^( TYPE_REFERENCE ID ( parameter )* ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:351:8: ^( TYPE_REFERENCE ID ( parameter )* ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_REFERENCE, "TYPE_REFERENCE"), root_1); + adaptor.addChild(root_1, stream_ID.nextNode()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:351:28: ( parameter )* + while ( stream_parameter.hasNext() ) { + adaptor.addChild(root_1, stream_parameter.nextTree()); + } + stream_parameter.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "typeReference" + + + public static class parameter_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "parameter" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:354:1: parameter : ( ID '=' parameterValue -> ^( TYPE_ANNOTATION ID parameterValue ) | type ); + public final GraphParser.parameter_return parameter() throws RecognitionException { + GraphParser.parameter_return retval = new GraphParser.parameter_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token ID91=null; + Token char_literal92=null; + ParserRuleReturnScope parameterValue93 =null; + ParserRuleReturnScope type94 =null; + + CommonTree ID91_tree=null; + CommonTree char_literal92_tree=null; + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74"); + RewriteRuleSubtreeStream stream_parameterValue=new RewriteRuleSubtreeStream(adaptor,"rule parameterValue"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:355:5: ( ID '=' parameterValue -> ^( TYPE_ANNOTATION ID parameterValue ) | type ) + int alt32=2; + int LA32_0 = input.LA(1); + if ( (LA32_0==ID) ) { + int LA32_1 = input.LA(2); + if ( (LA32_1==74) ) { + alt32=1; + } + else if ( (LA32_1==LBRACKET||LA32_1==LPAREN||LA32_1==RPAREN||LA32_1==67) ) { + alt32=2; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + int nvaeMark = input.mark(); + try { + input.consume(); + NoViableAltException nvae = + new NoViableAltException("", 32, 1, input); + throw nvae; + } finally { + input.rewind(nvaeMark); + } + } + + } + else if ( ((LA32_0 >= LCURLY && LA32_0 <= LPAREN)||LA32_0==80) ) { + alt32=2; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 32, 0, input); + throw nvae; + } + + switch (alt32) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:355:7: ID '=' parameterValue + { + ID91=(Token)match(input,ID,FOLLOW_ID_in_parameter2405); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID91); + + char_literal92=(Token)match(input,74,FOLLOW_74_in_parameter2407); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_74.add(char_literal92); + + pushFollow(FOLLOW_parameterValue_in_parameter2409); + parameterValue93=parameterValue(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_parameterValue.add(parameterValue93.getTree()); + // AST REWRITE + // elements: parameterValue, ID + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 355:29: -> ^( TYPE_ANNOTATION ID parameterValue ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:355:32: ^( TYPE_ANNOTATION ID parameterValue ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TYPE_ANNOTATION, "TYPE_ANNOTATION"), root_1); + adaptor.addChild(root_1, stream_ID.nextNode()); + adaptor.addChild(root_1, stream_parameterValue.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:356:7: type + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_type_in_parameter2427); + type94=type(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, type94.getTree()); + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "parameter" + + + public static class parameterValue_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "parameterValue" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:359:1: parameterValue : ( string | boolean_ | number | rangePar -> ^( RANGE rangePar ) ); + public final GraphParser.parameterValue_return parameterValue() throws RecognitionException { + GraphParser.parameterValue_return retval = new GraphParser.parameterValue_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + ParserRuleReturnScope string95 =null; + ParserRuleReturnScope boolean_96 =null; + ParserRuleReturnScope number97 =null; + ParserRuleReturnScope rangePar98 =null; + + RewriteRuleSubtreeStream stream_rangePar=new RewriteRuleSubtreeStream(adaptor,"rule rangePar"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:360:5: ( string | boolean_ | number | rangePar -> ^( RANGE rangePar ) ) + int alt33=4; + switch ( input.LA(1) ) { + case STRING: + { + alt33=1; + } + break; + case 78: + case 79: + { + alt33=2; + } + break; + case FLOAT: + case INT: + { + alt33=3; + } + break; + case LBRACKET: + case LPAREN: + { + alt33=4; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 33, 0, input); + throw nvae; + } + switch (alt33) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:360:7: string + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_string_in_parameterValue2446); + string95=string(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, string95.getTree()); + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:361:7: boolean_ + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_boolean__in_parameterValue2454); + boolean_96=boolean_(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, boolean_96.getTree()); + + } + break; + case 3 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:362:7: number + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_number_in_parameterValue2462); + number97=number(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, number97.getTree()); + + } + break; + case 4 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:363:7: rangePar + { + pushFollow(FOLLOW_rangePar_in_parameterValue2470); + rangePar98=rangePar(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_rangePar.add(rangePar98.getTree()); + // AST REWRITE + // elements: rangePar + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 363:16: -> ^( RANGE rangePar ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:363:19: ^( RANGE rangePar ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RANGE, "RANGE"), root_1); + adaptor.addChild(root_1, stream_rangePar.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "parameterValue" + + + public static class rangePar_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "rangePar" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:366:1: rangePar : ( LBRACKET | LPAREN ) range ( RBRACKET | RPAREN ) ; + public final GraphParser.rangePar_return rangePar() throws RecognitionException { + GraphParser.rangePar_return retval = new GraphParser.rangePar_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token set99=null; + Token set101=null; + ParserRuleReturnScope range100 =null; + + CommonTree set99_tree=null; + CommonTree set101_tree=null; + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:366:10: ( ( LBRACKET | LPAREN ) range ( RBRACKET | RPAREN ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:366:12: ( LBRACKET | LPAREN ) range ( RBRACKET | RPAREN ) + { + root_0 = (CommonTree)adaptor.nil(); + + + set99=input.LT(1); + if ( input.LA(1)==LBRACKET||input.LA(1)==LPAREN ) { + input.consume(); + if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set99)); + state.errorRecovery=false; + state.failed=false; + } + else { + if (state.backtracking>0) {state.failed=true; return retval;} + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + pushFollow(FOLLOW_range_in_rangePar2507); + range100=range(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, range100.getTree()); + + set101=input.LT(1); + if ( input.LA(1)==RBRACKET||input.LA(1)==RPAREN ) { + input.consume(); + if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set101)); + state.errorRecovery=false; + state.failed=false; + } + else { + if (state.backtracking>0) {state.failed=true; return retval;} + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "rangePar" + + + public static class range_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "range" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:368:1: range : ( number | RANGE | INT_RANGE ); + public final GraphParser.range_return range() throws RecognitionException { + GraphParser.range_return retval = new GraphParser.range_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token RANGE103=null; + Token INT_RANGE104=null; + ParserRuleReturnScope number102 =null; + + CommonTree RANGE103_tree=null; + CommonTree INT_RANGE104_tree=null; + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:369:5: ( number | RANGE | INT_RANGE ) + int alt34=3; + switch ( input.LA(1) ) { + case FLOAT: + case INT: + { + alt34=1; + } + break; + case RANGE: + { + alt34=2; + } + break; + case INT_RANGE: + { + alt34=3; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 34, 0, input); + throw nvae; + } + switch (alt34) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:369:7: number + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_number_in_range2536); + number102=number(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, number102.getTree()); + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:370:7: RANGE + { + root_0 = (CommonTree)adaptor.nil(); + + + RANGE103=(Token)match(input,RANGE,FOLLOW_RANGE_in_range2544); if (state.failed) return retval; + if ( state.backtracking==0 ) { + RANGE103_tree = (CommonTree)adaptor.create(RANGE103); + adaptor.addChild(root_0, RANGE103_tree); + } + + } + break; + case 3 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:371:7: INT_RANGE + { + root_0 = (CommonTree)adaptor.nil(); + + + INT_RANGE104=(Token)match(input,INT_RANGE,FOLLOW_INT_RANGE_in_range2552); if (state.failed) return retval; + if ( state.backtracking==0 ) { + INT_RANGE104_tree = (CommonTree)adaptor.create(INT_RANGE104); + adaptor.addChild(root_0, INT_RANGE104_tree); + } + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "range" + + + public static class number_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "number" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:374:1: number : ( INT | FLOAT ); + public final GraphParser.number_return number() throws RecognitionException { + GraphParser.number_return retval = new GraphParser.number_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token set105=null; + + CommonTree set105_tree=null; + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:375:5: ( INT | FLOAT ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g: + { + root_0 = (CommonTree)adaptor.nil(); + + + set105=input.LT(1); + if ( input.LA(1)==FLOAT||input.LA(1)==INT ) { + input.consume(); + if ( state.backtracking==0 ) adaptor.addChild(root_0, (CommonTree)adaptor.create(set105)); + state.errorRecovery=false; + state.failed=false; + } + else { + if (state.backtracking>0) {state.failed=true; return retval;} + MismatchedSetException mse = new MismatchedSetException(null,input); + throw mse; + } + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "number" + + + public static class string_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "string" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:379:1: string : STRING ; + public final GraphParser.string_return string() throws RecognitionException { + GraphParser.string_return retval = new GraphParser.string_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token STRING106=null; + + CommonTree STRING106_tree=null; + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:380:5: ( STRING ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:380:7: STRING + { + root_0 = (CommonTree)adaptor.nil(); + + + STRING106=(Token)match(input,STRING,FOLLOW_STRING_in_string2606); if (state.failed) return retval; + if ( state.backtracking==0 ) { + STRING106_tree = (CommonTree)adaptor.create(STRING106); + adaptor.addChild(root_0, STRING106_tree); + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "string" + + + public static class boolean__return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "boolean_" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:383:1: boolean_ : ( 'true' -> TRUE | 'false' -> FALSE ); + public final GraphParser.boolean__return boolean_() throws RecognitionException { + GraphParser.boolean__return retval = new GraphParser.boolean__return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token string_literal107=null; + Token string_literal108=null; + + CommonTree string_literal107_tree=null; + CommonTree string_literal108_tree=null; + RewriteRuleTokenStream stream_78=new RewriteRuleTokenStream(adaptor,"token 78"); + RewriteRuleTokenStream stream_79=new RewriteRuleTokenStream(adaptor,"token 79"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:384:5: ( 'true' -> TRUE | 'false' -> FALSE ) + int alt35=2; + int LA35_0 = input.LA(1); + if ( (LA35_0==79) ) { + alt35=1; + } + else if ( (LA35_0==78) ) { + alt35=2; + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 35, 0, input); + throw nvae; + } + + switch (alt35) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:384:7: 'true' + { + string_literal107=(Token)match(input,79,FOLLOW_79_in_boolean_2627); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_79.add(string_literal107); + + // AST REWRITE + // elements: + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 384:14: -> TRUE + { + adaptor.addChild(root_0, (CommonTree)adaptor.create(TRUE, "TRUE")); + } + + + retval.tree = root_0; + } + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:385:7: 'false' + { + string_literal108=(Token)match(input,78,FOLLOW_78_in_boolean_2639); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_78.add(string_literal108); + + // AST REWRITE + // elements: + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 385:15: -> FALSE + { + adaptor.addChild(root_0, (CommonTree)adaptor.create(FALSE, "FALSE")); + } + + + retval.tree = root_0; + } + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "boolean_" + + + public static class valueDefinitions_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "valueDefinitions" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:392:1: valueDefinitions : ( valueDefinition )* -> ^( VALUE_DEFINITIONS ( valueDefinition )* ) ; + public final GraphParser.valueDefinitions_return valueDefinitions() throws RecognitionException { + GraphParser.valueDefinitions_return retval = new GraphParser.valueDefinitions_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + ParserRuleReturnScope valueDefinition109 =null; + + RewriteRuleSubtreeStream stream_valueDefinition=new RewriteRuleSubtreeStream(adaptor,"rule valueDefinition"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:392:18: ( ( valueDefinition )* -> ^( VALUE_DEFINITIONS ( valueDefinition )* ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:392:20: ( valueDefinition )* + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:392:20: ( valueDefinition )* + loop36: + while (true) { + int alt36=2; + int LA36_0 = input.LA(1); + if ( (LA36_0==ID) ) { + alt36=1; + } + + switch (alt36) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:392:20: valueDefinition + { + pushFollow(FOLLOW_valueDefinition_in_valueDefinitions2660); + valueDefinition109=valueDefinition(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_valueDefinition.add(valueDefinition109.getTree()); + } + break; + + default : + break loop36; + } + } + + // AST REWRITE + // elements: valueDefinition + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 392:37: -> ^( VALUE_DEFINITIONS ( valueDefinition )* ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:392:40: ^( VALUE_DEFINITIONS ( valueDefinition )* ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VALUE_DEFINITIONS, "VALUE_DEFINITIONS"), root_1); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:392:60: ( valueDefinition )* + while ( stream_valueDefinition.hasNext() ) { + adaptor.addChild(root_1, stream_valueDefinition.nextTree()); + } + stream_valueDefinition.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "valueDefinitions" + + + public static class valueDefinition_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "valueDefinition" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:394:1: valueDefinition : ID ':' type '=' value -> ^( VALUE_DEFINITION ID type value ) ; + public final GraphParser.valueDefinition_return valueDefinition() throws RecognitionException { + GraphParser.valueDefinition_return retval = new GraphParser.valueDefinition_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token ID110=null; + Token char_literal111=null; + Token char_literal113=null; + ParserRuleReturnScope type112 =null; + ParserRuleReturnScope value114 =null; + + CommonTree ID110_tree=null; + CommonTree char_literal111_tree=null; + CommonTree char_literal113_tree=null; + RewriteRuleTokenStream stream_70=new RewriteRuleTokenStream(adaptor,"token 70"); + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74"); + RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type"); + RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:395:5: ( ID ':' type '=' value -> ^( VALUE_DEFINITION ID type value ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:395:7: ID ':' type '=' value + { + ID110=(Token)match(input,ID,FOLLOW_ID_in_valueDefinition2683); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID110); + + char_literal111=(Token)match(input,70,FOLLOW_70_in_valueDefinition2685); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_70.add(char_literal111); + + pushFollow(FOLLOW_type_in_valueDefinition2687); + type112=type(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_type.add(type112.getTree()); + char_literal113=(Token)match(input,74,FOLLOW_74_in_valueDefinition2689); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_74.add(char_literal113); + + pushFollow(FOLLOW_value_in_valueDefinition2691); + value114=value(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_value.add(value114.getTree()); + // AST REWRITE + // elements: ID, value, type + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 396:5: -> ^( VALUE_DEFINITION ID type value ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:396:8: ^( VALUE_DEFINITION ID type value ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VALUE_DEFINITION, "VALUE_DEFINITION"), root_1); + adaptor.addChild(root_1, stream_ID.nextNode()); + adaptor.addChild(root_1, stream_type.nextTree()); + adaptor.addChild(root_1, stream_value.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "valueDefinition" + + + public static class value_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "value" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:399:1: value : ( basicValue -> basicValue ) ( ':' type -> ^( VARIANT type $value) )* ; + public final GraphParser.value_return value() throws RecognitionException { + GraphParser.value_return retval = new GraphParser.value_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token char_literal116=null; + ParserRuleReturnScope basicValue115 =null; + ParserRuleReturnScope type117 =null; + + CommonTree char_literal116_tree=null; + RewriteRuleTokenStream stream_70=new RewriteRuleTokenStream(adaptor,"token 70"); + RewriteRuleSubtreeStream stream_basicValue=new RewriteRuleSubtreeStream(adaptor,"rule basicValue"); + RewriteRuleSubtreeStream stream_type=new RewriteRuleSubtreeStream(adaptor,"rule type"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:400:5: ( ( basicValue -> basicValue ) ( ':' type -> ^( VARIANT type $value) )* ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:400:7: ( basicValue -> basicValue ) ( ':' type -> ^( VARIANT type $value) )* + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:400:7: ( basicValue -> basicValue ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:400:8: basicValue + { + pushFollow(FOLLOW_basicValue_in_value2727); + basicValue115=basicValue(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_basicValue.add(basicValue115.getTree()); + // AST REWRITE + // elements: basicValue + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 400:19: -> basicValue + { + adaptor.addChild(root_0, stream_basicValue.nextTree()); + } + + + retval.tree = root_0; + } + + } + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:401:7: ( ':' type -> ^( VARIANT type $value) )* + loop37: + while (true) { + int alt37=2; + int LA37_0 = input.LA(1); + if ( (LA37_0==70) ) { + alt37=1; + } + + switch (alt37) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:401:8: ':' type + { + char_literal116=(Token)match(input,70,FOLLOW_70_in_value2741); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_70.add(char_literal116); + + pushFollow(FOLLOW_type_in_value2743); + type117=type(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_type.add(type117.getTree()); + // AST REWRITE + // elements: type, value + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 401:17: -> ^( VARIANT type $value) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:401:20: ^( VARIANT type $value) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(VARIANT, "VARIANT"), root_1); + adaptor.addChild(root_1, stream_type.nextTree()); + adaptor.addChild(root_1, stream_retval.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + break; + + default : + break loop37; + } + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "value" + + + public static class basicValue_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "basicValue" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:404:1: basicValue : ( simpleValue | map |{...}? ID -> NO_VALUE | taggedValue ); + public final GraphParser.basicValue_return basicValue() throws RecognitionException { + GraphParser.basicValue_return retval = new GraphParser.basicValue_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token ID120=null; + ParserRuleReturnScope simpleValue118 =null; + ParserRuleReturnScope map119 =null; + ParserRuleReturnScope taggedValue121 =null; + + CommonTree ID120_tree=null; + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:405:5: ( simpleValue | map |{...}? ID -> NO_VALUE | taggedValue ) + int alt38=4; + int LA38_0 = input.LA(1); + if ( (LA38_0==FLOAT||LA38_0==INT||(LA38_0 >= LBRACKET && LA38_0 <= LPAREN)||LA38_0==STRING||(LA38_0 >= 78 && LA38_0 <= 79)) ) { + alt38=1; + } + else if ( (LA38_0==ID) ) { + int LA38_2 = input.LA(2); + if ( (LA38_2==LCURLY) && ((input.LT(1).getText().equals("map")))) { + alt38=2; + } + else if ( ((input.LT(1).getText().equals("null"))) ) { + alt38=3; + } + else if ( (true) ) { + alt38=4; + } + + } + + else { + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 38, 0, input); + throw nvae; + } + + switch (alt38) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:405:7: simpleValue + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_simpleValue_in_basicValue2775); + simpleValue118=simpleValue(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, simpleValue118.getTree()); + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:406:7: map + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_map_in_basicValue2783); + map119=map(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, map119.getTree()); + + } + break; + case 3 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:407:7: {...}? ID + { + if ( !((input.LT(1).getText().equals("null"))) ) { + if (state.backtracking>0) {state.failed=true; return retval;} + throw new FailedPredicateException(input, "basicValue", "input.LT(1).getText().equals(\"null\")"); + } + ID120=(Token)match(input,ID,FOLLOW_ID_in_basicValue2793); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID120); + + // AST REWRITE + // elements: + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 407:50: -> NO_VALUE + { + adaptor.addChild(root_0, (CommonTree)adaptor.create(NO_VALUE, "NO_VALUE")); + } + + + retval.tree = root_0; + } + + } + break; + case 4 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:408:7: taggedValue + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_taggedValue_in_basicValue2805); + taggedValue121=taggedValue(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, taggedValue121.getTree()); + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "basicValue" + + + public static class simpleValue_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "simpleValue" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:411:1: simpleValue : ( string | number | boolean_ | array | tuple | record ); + public final GraphParser.simpleValue_return simpleValue() throws RecognitionException { + GraphParser.simpleValue_return retval = new GraphParser.simpleValue_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + ParserRuleReturnScope string122 =null; + ParserRuleReturnScope number123 =null; + ParserRuleReturnScope boolean_124 =null; + ParserRuleReturnScope array125 =null; + ParserRuleReturnScope tuple126 =null; + ParserRuleReturnScope record127 =null; + + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:412:5: ( string | number | boolean_ | array | tuple | record ) + int alt39=6; + switch ( input.LA(1) ) { + case STRING: + { + alt39=1; + } + break; + case FLOAT: + case INT: + { + alt39=2; + } + break; + case 78: + case 79: + { + alt39=3; + } + break; + case LBRACKET: + { + alt39=4; + } + break; + case LPAREN: + { + alt39=5; + } + break; + case LCURLY: + { + alt39=6; + } + break; + default: + if (state.backtracking>0) {state.failed=true; return retval;} + NoViableAltException nvae = + new NoViableAltException("", 39, 0, input); + throw nvae; + } + switch (alt39) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:412:7: string + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_string_in_simpleValue2830); + string122=string(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, string122.getTree()); + + } + break; + case 2 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:413:7: number + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_number_in_simpleValue2838); + number123=number(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, number123.getTree()); + + } + break; + case 3 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:414:7: boolean_ + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_boolean__in_simpleValue2846); + boolean_124=boolean_(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, boolean_124.getTree()); + + } + break; + case 4 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:415:7: array + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_array_in_simpleValue2854); + array125=array(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, array125.getTree()); + + } + break; + case 5 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:416:7: tuple + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_tuple_in_simpleValue2862); + tuple126=tuple(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, tuple126.getTree()); + + } + break; + case 6 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:417:7: record + { + root_0 = (CommonTree)adaptor.nil(); + + + pushFollow(FOLLOW_record_in_simpleValue2870); + record127=record(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) adaptor.addChild(root_0, record127.getTree()); + + } + break; + + } + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "simpleValue" + + + public static class array_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "array" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:420:1: array : LBRACKET ( value ( ',' value )* )? RBRACKET -> ^( ARRAY ( value )* ) ; + public final GraphParser.array_return array() throws RecognitionException { + GraphParser.array_return retval = new GraphParser.array_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token LBRACKET128=null; + Token char_literal130=null; + Token RBRACKET132=null; + ParserRuleReturnScope value129 =null; + ParserRuleReturnScope value131 =null; + + CommonTree LBRACKET128_tree=null; + CommonTree char_literal130_tree=null; + CommonTree RBRACKET132_tree=null; + RewriteRuleTokenStream stream_67=new RewriteRuleTokenStream(adaptor,"token 67"); + RewriteRuleTokenStream stream_LBRACKET=new RewriteRuleTokenStream(adaptor,"token LBRACKET"); + RewriteRuleTokenStream stream_RBRACKET=new RewriteRuleTokenStream(adaptor,"token RBRACKET"); + RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:421:5: ( LBRACKET ( value ( ',' value )* )? RBRACKET -> ^( ARRAY ( value )* ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:421:7: LBRACKET ( value ( ',' value )* )? RBRACKET + { + LBRACKET128=(Token)match(input,LBRACKET,FOLLOW_LBRACKET_in_array2891); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_LBRACKET.add(LBRACKET128); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:421:16: ( value ( ',' value )* )? + int alt41=2; + int LA41_0 = input.LA(1); + if ( (LA41_0==FLOAT||LA41_0==ID||LA41_0==INT||(LA41_0 >= LBRACKET && LA41_0 <= LPAREN)||LA41_0==STRING||(LA41_0 >= 78 && LA41_0 <= 79)) ) { + alt41=1; + } + switch (alt41) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:421:17: value ( ',' value )* + { + pushFollow(FOLLOW_value_in_array2894); + value129=value(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_value.add(value129.getTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:421:23: ( ',' value )* + loop40: + while (true) { + int alt40=2; + int LA40_0 = input.LA(1); + if ( (LA40_0==67) ) { + alt40=1; + } + + switch (alt40) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:421:24: ',' value + { + char_literal130=(Token)match(input,67,FOLLOW_67_in_array2897); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_67.add(char_literal130); + + pushFollow(FOLLOW_value_in_array2899); + value131=value(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_value.add(value131.getTree()); + } + break; + + default : + break loop40; + } + } + + } + break; + + } + + RBRACKET132=(Token)match(input,RBRACKET,FOLLOW_RBRACKET_in_array2905); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_RBRACKET.add(RBRACKET132); + + // AST REWRITE + // elements: value + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 422:5: -> ^( ARRAY ( value )* ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:422:8: ^( ARRAY ( value )* ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ARRAY, "ARRAY"), root_1); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:422:16: ( value )* + while ( stream_value.hasNext() ) { + adaptor.addChild(root_1, stream_value.nextTree()); + } + stream_value.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "array" + + + public static class tuple_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "tuple" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:425:1: tuple : LPAREN ( value ( ',' value )* )? RPAREN -> ^( TUPLE ( value )* ) ; + public final GraphParser.tuple_return tuple() throws RecognitionException { + GraphParser.tuple_return retval = new GraphParser.tuple_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token LPAREN133=null; + Token char_literal135=null; + Token RPAREN137=null; + ParserRuleReturnScope value134 =null; + ParserRuleReturnScope value136 =null; + + CommonTree LPAREN133_tree=null; + CommonTree char_literal135_tree=null; + CommonTree RPAREN137_tree=null; + RewriteRuleTokenStream stream_67=new RewriteRuleTokenStream(adaptor,"token 67"); + RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN"); + RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN"); + RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:426:5: ( LPAREN ( value ( ',' value )* )? RPAREN -> ^( TUPLE ( value )* ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:426:7: LPAREN ( value ( ',' value )* )? RPAREN + { + LPAREN133=(Token)match(input,LPAREN,FOLLOW_LPAREN_in_tuple2937); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_LPAREN.add(LPAREN133); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:426:14: ( value ( ',' value )* )? + int alt43=2; + int LA43_0 = input.LA(1); + if ( (LA43_0==FLOAT||LA43_0==ID||LA43_0==INT||(LA43_0 >= LBRACKET && LA43_0 <= LPAREN)||LA43_0==STRING||(LA43_0 >= 78 && LA43_0 <= 79)) ) { + alt43=1; + } + switch (alt43) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:426:15: value ( ',' value )* + { + pushFollow(FOLLOW_value_in_tuple2940); + value134=value(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_value.add(value134.getTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:426:21: ( ',' value )* + loop42: + while (true) { + int alt42=2; + int LA42_0 = input.LA(1); + if ( (LA42_0==67) ) { + alt42=1; + } + + switch (alt42) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:426:22: ',' value + { + char_literal135=(Token)match(input,67,FOLLOW_67_in_tuple2943); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_67.add(char_literal135); + + pushFollow(FOLLOW_value_in_tuple2945); + value136=value(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_value.add(value136.getTree()); + } + break; + + default : + break loop42; + } + } + + } + break; + + } + + RPAREN137=(Token)match(input,RPAREN,FOLLOW_RPAREN_in_tuple2951); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_RPAREN.add(RPAREN137); + + // AST REWRITE + // elements: value + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 427:5: -> ^( TUPLE ( value )* ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:427:8: ^( TUPLE ( value )* ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TUPLE, "TUPLE"), root_1); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:427:16: ( value )* + while ( stream_value.hasNext() ) { + adaptor.addChild(root_1, stream_value.nextTree()); + } + stream_value.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "tuple" + + + public static class taggedValue_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "taggedValue" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:430:1: taggedValue : ID ( simpleValue )? -> ^( TAGGED_VALUE ID ( simpleValue )? ) ; + public final GraphParser.taggedValue_return taggedValue() throws RecognitionException { + GraphParser.taggedValue_return retval = new GraphParser.taggedValue_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token ID138=null; + ParserRuleReturnScope simpleValue139 =null; + + CommonTree ID138_tree=null; + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + RewriteRuleSubtreeStream stream_simpleValue=new RewriteRuleSubtreeStream(adaptor,"rule simpleValue"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:431:5: ( ID ( simpleValue )? -> ^( TAGGED_VALUE ID ( simpleValue )? ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:431:7: ID ( simpleValue )? + { + ID138=(Token)match(input,ID,FOLLOW_ID_in_taggedValue2983); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID138); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:431:10: ( simpleValue )? + int alt44=2; + int LA44_0 = input.LA(1); + if ( (LA44_0==FLOAT||LA44_0==INT||(LA44_0 >= LBRACKET && LA44_0 <= LPAREN)||LA44_0==STRING||(LA44_0 >= 78 && LA44_0 <= 79)) ) { + alt44=1; + } + switch (alt44) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:431:10: simpleValue + { + pushFollow(FOLLOW_simpleValue_in_taggedValue2985); + simpleValue139=simpleValue(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_simpleValue.add(simpleValue139.getTree()); + } + break; + + } + + // AST REWRITE + // elements: ID, simpleValue + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 432:5: -> ^( TAGGED_VALUE ID ( simpleValue )? ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:432:8: ^( TAGGED_VALUE ID ( simpleValue )? ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(TAGGED_VALUE, "TAGGED_VALUE"), root_1); + adaptor.addChild(root_1, stream_ID.nextNode()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:432:26: ( simpleValue )? + if ( stream_simpleValue.hasNext() ) { + adaptor.addChild(root_1, stream_simpleValue.nextTree()); + } + stream_simpleValue.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "taggedValue" + + + public static class record_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "record" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:435:1: record : LCURLY ( recordAssignment ( ',' recordAssignment )* )? RCURLY -> ^( RECORD ( recordAssignment )* ) ; + public final GraphParser.record_return record() throws RecognitionException { + GraphParser.record_return retval = new GraphParser.record_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token LCURLY140=null; + Token char_literal142=null; + Token RCURLY144=null; + ParserRuleReturnScope recordAssignment141 =null; + ParserRuleReturnScope recordAssignment143 =null; + + CommonTree LCURLY140_tree=null; + CommonTree char_literal142_tree=null; + CommonTree RCURLY144_tree=null; + RewriteRuleTokenStream stream_67=new RewriteRuleTokenStream(adaptor,"token 67"); + RewriteRuleTokenStream stream_LCURLY=new RewriteRuleTokenStream(adaptor,"token LCURLY"); + RewriteRuleTokenStream stream_RCURLY=new RewriteRuleTokenStream(adaptor,"token RCURLY"); + RewriteRuleSubtreeStream stream_recordAssignment=new RewriteRuleSubtreeStream(adaptor,"rule recordAssignment"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:436:5: ( LCURLY ( recordAssignment ( ',' recordAssignment )* )? RCURLY -> ^( RECORD ( recordAssignment )* ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:436:7: LCURLY ( recordAssignment ( ',' recordAssignment )* )? RCURLY + { + LCURLY140=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_record3020); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_LCURLY.add(LCURLY140); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:436:14: ( recordAssignment ( ',' recordAssignment )* )? + int alt46=2; + int LA46_0 = input.LA(1); + if ( (LA46_0==ID) ) { + alt46=1; + } + switch (alt46) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:436:15: recordAssignment ( ',' recordAssignment )* + { + pushFollow(FOLLOW_recordAssignment_in_record3023); + recordAssignment141=recordAssignment(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_recordAssignment.add(recordAssignment141.getTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:436:32: ( ',' recordAssignment )* + loop45: + while (true) { + int alt45=2; + int LA45_0 = input.LA(1); + if ( (LA45_0==67) ) { + alt45=1; + } + + switch (alt45) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:436:33: ',' recordAssignment + { + char_literal142=(Token)match(input,67,FOLLOW_67_in_record3026); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_67.add(char_literal142); + + pushFollow(FOLLOW_recordAssignment_in_record3028); + recordAssignment143=recordAssignment(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_recordAssignment.add(recordAssignment143.getTree()); + } + break; + + default : + break loop45; + } + } + + } + break; + + } + + RCURLY144=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_record3034); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_RCURLY.add(RCURLY144); + + // AST REWRITE + // elements: recordAssignment + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 437:5: -> ^( RECORD ( recordAssignment )* ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:437:8: ^( RECORD ( recordAssignment )* ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(RECORD, "RECORD"), root_1); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:437:17: ( recordAssignment )* + while ( stream_recordAssignment.hasNext() ) { + adaptor.addChild(root_1, stream_recordAssignment.nextTree()); + } + stream_recordAssignment.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "record" + + + public static class recordAssignment_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "recordAssignment" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:440:1: recordAssignment : ID '=' value -> ^( ASSIGNMENT ID value ) ; + public final GraphParser.recordAssignment_return recordAssignment() throws RecognitionException { + GraphParser.recordAssignment_return retval = new GraphParser.recordAssignment_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token ID145=null; + Token char_literal146=null; + ParserRuleReturnScope value147 =null; + + CommonTree ID145_tree=null; + CommonTree char_literal146_tree=null; + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74"); + RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:441:5: ( ID '=' value -> ^( ASSIGNMENT ID value ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:441:7: ID '=' value + { + ID145=(Token)match(input,ID,FOLLOW_ID_in_recordAssignment3066); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID145); + + char_literal146=(Token)match(input,74,FOLLOW_74_in_recordAssignment3068); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_74.add(char_literal146); + + pushFollow(FOLLOW_value_in_recordAssignment3070); + value147=value(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_value.add(value147.getTree()); + // AST REWRITE + // elements: ID, value + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 442:5: -> ^( ASSIGNMENT ID value ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:442:8: ^( ASSIGNMENT ID value ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ASSIGNMENT, "ASSIGNMENT"), root_1); + adaptor.addChild(root_1, stream_ID.nextNode()); + adaptor.addChild(root_1, stream_value.nextTree()); + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "recordAssignment" + + + public static class map_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "map" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:445:1: map :{...}? => ID LCURLY ( mapAssignment ( ',' mapAssignment )* )? RCURLY -> ^( MAP ( mapAssignment )* ) ; + public final GraphParser.map_return map() throws RecognitionException { + GraphParser.map_return retval = new GraphParser.map_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token ID148=null; + Token LCURLY149=null; + Token char_literal151=null; + Token RCURLY153=null; + ParserRuleReturnScope mapAssignment150 =null; + ParserRuleReturnScope mapAssignment152 =null; + + CommonTree ID148_tree=null; + CommonTree LCURLY149_tree=null; + CommonTree char_literal151_tree=null; + CommonTree RCURLY153_tree=null; + RewriteRuleTokenStream stream_67=new RewriteRuleTokenStream(adaptor,"token 67"); + RewriteRuleTokenStream stream_LCURLY=new RewriteRuleTokenStream(adaptor,"token LCURLY"); + RewriteRuleTokenStream stream_ID=new RewriteRuleTokenStream(adaptor,"token ID"); + RewriteRuleTokenStream stream_RCURLY=new RewriteRuleTokenStream(adaptor,"token RCURLY"); + RewriteRuleSubtreeStream stream_mapAssignment=new RewriteRuleSubtreeStream(adaptor,"rule mapAssignment"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:445:5: ({...}? => ID LCURLY ( mapAssignment ( ',' mapAssignment )* )? RCURLY -> ^( MAP ( mapAssignment )* ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:445:7: {...}? => ID LCURLY ( mapAssignment ( ',' mapAssignment )* )? RCURLY + { + if ( !((input.LT(1).getText().equals("map"))) ) { + if (state.backtracking>0) {state.failed=true; return retval;} + throw new FailedPredicateException(input, "map", "input.LT(1).getText().equals(\"map\")"); + } + ID148=(Token)match(input,ID,FOLLOW_ID_in_map3100); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_ID.add(ID148); + + LCURLY149=(Token)match(input,LCURLY,FOLLOW_LCURLY_in_map3102); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_LCURLY.add(LCURLY149); + + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:445:58: ( mapAssignment ( ',' mapAssignment )* )? + int alt48=2; + int LA48_0 = input.LA(1); + if ( (LA48_0==FLOAT||LA48_0==ID||LA48_0==INT||(LA48_0 >= LBRACKET && LA48_0 <= LPAREN)||LA48_0==STRING||(LA48_0 >= 78 && LA48_0 <= 79)) ) { + alt48=1; + } + switch (alt48) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:445:59: mapAssignment ( ',' mapAssignment )* + { + pushFollow(FOLLOW_mapAssignment_in_map3105); + mapAssignment150=mapAssignment(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_mapAssignment.add(mapAssignment150.getTree()); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:445:73: ( ',' mapAssignment )* + loop47: + while (true) { + int alt47=2; + int LA47_0 = input.LA(1); + if ( (LA47_0==67) ) { + alt47=1; + } + + switch (alt47) { + case 1 : + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:445:74: ',' mapAssignment + { + char_literal151=(Token)match(input,67,FOLLOW_67_in_map3108); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_67.add(char_literal151); + + pushFollow(FOLLOW_mapAssignment_in_map3110); + mapAssignment152=mapAssignment(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_mapAssignment.add(mapAssignment152.getTree()); + } + break; + + default : + break loop47; + } + } + + } + break; + + } + + RCURLY153=(Token)match(input,RCURLY,FOLLOW_RCURLY_in_map3116); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_RCURLY.add(RCURLY153); + + // AST REWRITE + // elements: mapAssignment + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 446:5: -> ^( MAP ( mapAssignment )* ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:446:8: ^( MAP ( mapAssignment )* ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(MAP, "MAP"), root_1); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:446:14: ( mapAssignment )* + while ( stream_mapAssignment.hasNext() ) { + adaptor.addChild(root_1, stream_mapAssignment.nextTree()); + } + stream_mapAssignment.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "map" + + + public static class mapAssignment_return extends ParserRuleReturnScope { + CommonTree tree; + @Override + public CommonTree getTree() { return tree; } + }; + + + // $ANTLR start "mapAssignment" + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:449:1: mapAssignment : value '=' value -> ^( ASSIGNMENT ( value )* ) ; + public final GraphParser.mapAssignment_return mapAssignment() throws RecognitionException { + GraphParser.mapAssignment_return retval = new GraphParser.mapAssignment_return(); + retval.start = input.LT(1); + + CommonTree root_0 = null; + + Token char_literal155=null; + ParserRuleReturnScope value154 =null; + ParserRuleReturnScope value156 =null; + + CommonTree char_literal155_tree=null; + RewriteRuleTokenStream stream_74=new RewriteRuleTokenStream(adaptor,"token 74"); + RewriteRuleSubtreeStream stream_value=new RewriteRuleSubtreeStream(adaptor,"rule value"); + + try { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:450:5: ( value '=' value -> ^( ASSIGNMENT ( value )* ) ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:450:7: value '=' value + { + pushFollow(FOLLOW_value_in_mapAssignment3148); + value154=value(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_value.add(value154.getTree()); + char_literal155=(Token)match(input,74,FOLLOW_74_in_mapAssignment3150); if (state.failed) return retval; + if ( state.backtracking==0 ) stream_74.add(char_literal155); + + pushFollow(FOLLOW_value_in_mapAssignment3152); + value156=value(); + state._fsp--; + if (state.failed) return retval; + if ( state.backtracking==0 ) stream_value.add(value156.getTree()); + // AST REWRITE + // elements: value + // token labels: + // rule labels: retval + // token list labels: + // rule list labels: + // wildcard labels: + if ( state.backtracking==0 ) { + retval.tree = root_0; + RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null); + + root_0 = (CommonTree)adaptor.nil(); + // 451:5: -> ^( ASSIGNMENT ( value )* ) + { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:451:8: ^( ASSIGNMENT ( value )* ) + { + CommonTree root_1 = (CommonTree)adaptor.nil(); + root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ASSIGNMENT, "ASSIGNMENT"), root_1); + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:451:21: ( value )* + while ( stream_value.hasNext() ) { + adaptor.addChild(root_1, stream_value.nextTree()); + } + stream_value.reset(); + + adaptor.addChild(root_0, root_1); + } + + } + + + retval.tree = root_0; + } + + } + + retval.stop = input.LT(-1); + + if ( state.backtracking==0 ) { + retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); + adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); + } + } + catch (RecognitionException re) { + reportError(re); + recover(input,re); + retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); + } + finally { + // do for sure before leaving + } + return retval; + } + // $ANTLR end "mapAssignment" + + // $ANTLR start synpred1_Graph + public final void synpred1_Graph_fragment() throws RecognitionException { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:317:22: ( arrayType ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:317:23: arrayType + { + pushFollow(FOLLOW_arrayType_in_synpred1_Graph2075); + arrayType(); + state._fsp--; + if (state.failed) return; + + } + + } + // $ANTLR end synpred1_Graph + + // $ANTLR start synpred2_Graph + public final void synpred2_Graph_fragment() throws RecognitionException { + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:350:11: ( LPAREN ) + // src/org/simantics/graph/compiler/internal/parsing/Graph.g:350:12: LPAREN + { + match(input,LPAREN,FOLLOW_LPAREN_in_synpred2_Graph2354); if (state.failed) return; + + } + + } + // $ANTLR end synpred2_Graph + + // Delegated rules + + public final boolean synpred2_Graph() { + state.backtracking++; + int start = input.mark(); + try { + synpred2_Graph_fragment(); // can never throw exception + } catch (RecognitionException re) { + System.err.println("impossible: "+re); + } + boolean success = !state.failed; + input.rewind(start); + state.backtracking--; + state.failed=false; + return success; + } + public final boolean synpred1_Graph() { + state.backtracking++; + int start = input.mark(); + try { + synpred1_Graph_fragment(); // can never throw exception + } catch (RecognitionException re) { + System.err.println("impossible: "+re); + } + boolean success = !state.failed; + input.rewind(start); + state.backtracking--; + state.failed=false; + return success; + } + + + + public static final BitSet FOLLOW_NEWLINE_in_file1230 = new BitSet(new long[]{0x0800100074440000L,0x000000000000E006L}); + public static final BitSet FOLLOW_resourceDefinitions_in_file1233 = new BitSet(new long[]{0x0000000000000000L}); + public static final BitSet FOLLOW_EOF_in_file1236 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_resourceDefinition_in_resourceDefinitions1260 = new BitSet(new long[]{0x0000000100000002L}); + public static final BitSet FOLLOW_NEWLINE_in_resourceDefinitions1263 = new BitSet(new long[]{0x0800100074440000L,0x000000000000E006L}); + public static final BitSet FOLLOW_resourceDefinition_in_resourceDefinitions1266 = new BitSet(new long[]{0x0000000100000002L}); + public static final BitSet FOLLOW_resource_in_resourceDefinition1300 = new BitSet(new long[]{0x0800000000C00002L,0x0000000000001FD4L}); + public static final BitSet FOLLOW_localProperty_in_resourceDefinition1308 = new BitSet(new long[]{0x0800000000C00002L,0x0000000000001FD4L}); + public static final BitSet FOLLOW_INDENT_in_resourceDefinition1318 = new BitSet(new long[]{0x0800000000400000L,0x0000000000003FD4L}); + public static final BitSet FOLLOW_property_in_resourceDefinition1320 = new BitSet(new long[]{0x0000000100000200L}); + public static final BitSet FOLLOW_NEWLINE_in_resourceDefinition1323 = new BitSet(new long[]{0x0800000000400000L,0x0000000000003FD4L}); + public static final BitSet FOLLOW_property_in_resourceDefinition1325 = new BitSet(new long[]{0x0000000100000200L}); + public static final BitSet FOLLOW_DEDENT_in_resourceDefinition1329 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_template_in_resourceDefinition1358 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_relation_in_localProperty1393 = new BitSet(new long[]{0x0800100074440000L,0x000000000000C006L}); + public static final BitSet FOLLOW_resource_in_localProperty1395 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_relation_in_property1434 = new BitSet(new long[]{0x0800100074C40000L,0x000000000000E006L}); + public static final BitSet FOLLOW_resourceDefinition_in_property1444 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_INDENT_in_property1464 = new BitSet(new long[]{0x0800100074440000L,0x000000000000E006L}); + public static final BitSet FOLLOW_resourceDefinitions_in_property1466 = new BitSet(new long[]{0x0000000000000200L}); + public static final BitSet FOLLOW_DEDENT_in_property1468 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_template_in_property1494 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_77_in_template1515 = new BitSet(new long[]{0x0800100074440000L,0x000000000000C006L}); + public static final BitSet FOLLOW_ID_in_template1533 = new BitSet(new long[]{0x0800100074440000L,0x000000000000C006L}); + public static final BitSet FOLLOW_resource_in_template1535 = new BitSet(new long[]{0x0800100074C40000L,0x000000000000C006L}); + public static final BitSet FOLLOW_INDENT_in_template1545 = new BitSet(new long[]{0x0800100074440000L,0x000000000000E006L}); + public static final BitSet FOLLOW_resourceDefinitions_in_template1547 = new BitSet(new long[]{0x0000000000000200L}); + public static final BitSet FOLLOW_DEDENT_in_template1549 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_resource_in_template1574 = new BitSet(new long[]{0x0800100074C40002L,0x000000000000C006L}); + public static final BitSet FOLLOW_INDENT_in_template1585 = new BitSet(new long[]{0x0800100074440000L,0x000000000000E006L}); + public static final BitSet FOLLOW_resourceDefinitions_in_template1587 = new BitSet(new long[]{0x0000000000000200L}); + public static final BitSet FOLLOW_DEDENT_in_template1589 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ID_in_relation1643 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000020L}); + public static final BitSet FOLLOW_69_in_relation1658 = new BitSet(new long[]{0x0000000000400000L}); + public static final BitSet FOLLOW_ID_in_relation1660 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000020L}); + public static final BitSet FOLLOW_URI_in_relation1681 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_73_in_relation1689 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_72_in_relation1701 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_71_in_relation1713 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_68_in_relation1725 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_75_in_relation1737 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_76_in_relation1749 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_70_in_relation1765 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_74_in_relation1777 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_66_in_relation1789 = new BitSet(new long[]{0x0000000000400000L}); + public static final BitSet FOLLOW_ID_in_relation1791 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ID_in_resource1821 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000020L}); + public static final BitSet FOLLOW_ID_in_resource1840 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000020L}); + public static final BitSet FOLLOW_69_in_resource1855 = new BitSet(new long[]{0x0000100000400000L}); + public static final BitSet FOLLOW_ID_in_resource1858 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000020L}); + public static final BitSet FOLLOW_STRING_in_resource1883 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000020L}); + public static final BitSet FOLLOW_URI_in_resource1924 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_simpleValue_in_resource1932 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_65_in_resource1948 = new BitSet(new long[]{0x0000000060400000L}); + public static final BitSet FOLLOW_basicType_in_resource1950 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_66_in_resource1966 = new BitSet(new long[]{0x0000000000400000L}); + public static final BitSet FOLLOW_ID_in_resource1968 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_arrayType_in_type2004 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_unionType_in_type2012 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_80_in_unionType2041 = new BitSet(new long[]{0x0000000000400000L}); + public static final BitSet FOLLOW_unionComponent_in_unionType2043 = new BitSet(new long[]{0x0000000000000002L,0x0000000000010000L}); + public static final BitSet FOLLOW_ID_in_unionComponent2071 = new BitSet(new long[]{0x0000000060400002L}); + public static final BitSet FOLLOW_arrayType_in_unionComponent2080 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_basicType_in_arrayType2108 = new BitSet(new long[]{0x0000000010000002L}); + public static final BitSet FOLLOW_LBRACKET_in_arrayType2122 = new BitSet(new long[]{0x000000100C000000L}); + public static final BitSet FOLLOW_arrayLength_in_arrayType2124 = new BitSet(new long[]{0x0000001000000000L}); + public static final BitSet FOLLOW_RBRACKET_in_arrayType2127 = new BitSet(new long[]{0x0000000010000002L}); + public static final BitSet FOLLOW_tupleType_in_basicType2181 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_recordType_in_basicType2189 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_typeReference_in_basicType2197 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_LPAREN_in_tupleType2219 = new BitSet(new long[]{0x0000080060400000L,0x0000000000010000L}); + public static final BitSet FOLLOW_type_in_tupleType2222 = new BitSet(new long[]{0x0000080000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_67_in_tupleType2225 = new BitSet(new long[]{0x0000000060400000L,0x0000000000010000L}); + public static final BitSet FOLLOW_type_in_tupleType2227 = new BitSet(new long[]{0x0000080000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_RPAREN_in_tupleType2233 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_LCURLY_in_recordType2266 = new BitSet(new long[]{0x0000002000400000L}); + public static final BitSet FOLLOW_component_in_recordType2269 = new BitSet(new long[]{0x0000002000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_67_in_recordType2272 = new BitSet(new long[]{0x0000000000400000L}); + public static final BitSet FOLLOW_component_in_recordType2274 = new BitSet(new long[]{0x0000002000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_RCURLY_in_recordType2280 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ID_in_component2312 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000040L}); + public static final BitSet FOLLOW_70_in_component2314 = new BitSet(new long[]{0x0000000060400000L,0x0000000000010000L}); + public static final BitSet FOLLOW_type_in_component2316 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ID_in_typeReference2350 = new BitSet(new long[]{0x0000000040000002L}); + public static final BitSet FOLLOW_LPAREN_in_typeReference2358 = new BitSet(new long[]{0x0000000060400000L,0x0000000000010000L}); + public static final BitSet FOLLOW_parameter_in_typeReference2360 = new BitSet(new long[]{0x0000080000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_67_in_typeReference2363 = new BitSet(new long[]{0x0000000060400000L,0x0000000000010000L}); + public static final BitSet FOLLOW_parameter_in_typeReference2365 = new BitSet(new long[]{0x0000080000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_RPAREN_in_typeReference2369 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ID_in_parameter2405 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L}); + public static final BitSet FOLLOW_74_in_parameter2407 = new BitSet(new long[]{0x0000100054040000L,0x000000000000C000L}); + public static final BitSet FOLLOW_parameterValue_in_parameter2409 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_type_in_parameter2427 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_string_in_parameterValue2446 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_boolean__in_parameterValue2454 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_number_in_parameterValue2462 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_rangePar_in_parameterValue2470 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_set_in_rangePar2499 = new BitSet(new long[]{0x000000080C040000L}); + public static final BitSet FOLLOW_range_in_rangePar2507 = new BitSet(new long[]{0x0000081000000000L}); + public static final BitSet FOLLOW_set_in_rangePar2509 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_number_in_range2536 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_RANGE_in_range2544 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_INT_RANGE_in_range2552 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_STRING_in_string2606 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_79_in_boolean_2627 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_78_in_boolean_2639 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_valueDefinition_in_valueDefinitions2660 = new BitSet(new long[]{0x0000000000400002L}); + public static final BitSet FOLLOW_ID_in_valueDefinition2683 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000040L}); + public static final BitSet FOLLOW_70_in_valueDefinition2685 = new BitSet(new long[]{0x0000000060400000L,0x0000000000010000L}); + public static final BitSet FOLLOW_type_in_valueDefinition2687 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L}); + public static final BitSet FOLLOW_74_in_valueDefinition2689 = new BitSet(new long[]{0x0000100074440000L,0x000000000000C000L}); + public static final BitSet FOLLOW_value_in_valueDefinition2691 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_basicValue_in_value2727 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000040L}); + public static final BitSet FOLLOW_70_in_value2741 = new BitSet(new long[]{0x0000000060400000L,0x0000000000010000L}); + public static final BitSet FOLLOW_type_in_value2743 = new BitSet(new long[]{0x0000000000000002L,0x0000000000000040L}); + public static final BitSet FOLLOW_simpleValue_in_basicValue2775 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_map_in_basicValue2783 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ID_in_basicValue2793 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_taggedValue_in_basicValue2805 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_string_in_simpleValue2830 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_number_in_simpleValue2838 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_boolean__in_simpleValue2846 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_array_in_simpleValue2854 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_tuple_in_simpleValue2862 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_record_in_simpleValue2870 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_LBRACKET_in_array2891 = new BitSet(new long[]{0x0000101074440000L,0x000000000000C000L}); + public static final BitSet FOLLOW_value_in_array2894 = new BitSet(new long[]{0x0000001000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_67_in_array2897 = new BitSet(new long[]{0x0000100074440000L,0x000000000000C000L}); + public static final BitSet FOLLOW_value_in_array2899 = new BitSet(new long[]{0x0000001000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_RBRACKET_in_array2905 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_LPAREN_in_tuple2937 = new BitSet(new long[]{0x0000180074440000L,0x000000000000C000L}); + public static final BitSet FOLLOW_value_in_tuple2940 = new BitSet(new long[]{0x0000080000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_67_in_tuple2943 = new BitSet(new long[]{0x0000100074440000L,0x000000000000C000L}); + public static final BitSet FOLLOW_value_in_tuple2945 = new BitSet(new long[]{0x0000080000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_RPAREN_in_tuple2951 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ID_in_taggedValue2983 = new BitSet(new long[]{0x0000100074040002L,0x000000000000C000L}); + public static final BitSet FOLLOW_simpleValue_in_taggedValue2985 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_LCURLY_in_record3020 = new BitSet(new long[]{0x0000002000400000L}); + public static final BitSet FOLLOW_recordAssignment_in_record3023 = new BitSet(new long[]{0x0000002000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_67_in_record3026 = new BitSet(new long[]{0x0000000000400000L}); + public static final BitSet FOLLOW_recordAssignment_in_record3028 = new BitSet(new long[]{0x0000002000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_RCURLY_in_record3034 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ID_in_recordAssignment3066 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L}); + public static final BitSet FOLLOW_74_in_recordAssignment3068 = new BitSet(new long[]{0x0000100074440000L,0x000000000000C000L}); + public static final BitSet FOLLOW_value_in_recordAssignment3070 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_ID_in_map3100 = new BitSet(new long[]{0x0000000020000000L}); + public static final BitSet FOLLOW_LCURLY_in_map3102 = new BitSet(new long[]{0x0000102074440000L,0x000000000000C000L}); + public static final BitSet FOLLOW_mapAssignment_in_map3105 = new BitSet(new long[]{0x0000002000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_67_in_map3108 = new BitSet(new long[]{0x0000100074440000L,0x000000000000C000L}); + public static final BitSet FOLLOW_mapAssignment_in_map3110 = new BitSet(new long[]{0x0000002000000000L,0x0000000000000008L}); + public static final BitSet FOLLOW_RCURLY_in_map3116 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_value_in_mapAssignment3148 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000400L}); + public static final BitSet FOLLOW_74_in_mapAssignment3150 = new BitSet(new long[]{0x0000100074440000L,0x000000000000C000L}); + public static final BitSet FOLLOW_value_in_mapAssignment3152 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_arrayType_in_synpred1_Graph2075 = new BitSet(new long[]{0x0000000000000002L}); + public static final BitSet FOLLOW_LPAREN_in_synpred2_Graph2354 = new BitSet(new long[]{0x0000000000000002L}); +} diff --git a/bundles/org.simantics.graph.compiler/tools/antlr-3.3-complete.jar b/bundles/org.simantics.graph.compiler/tools/antlr-3.3-complete.jar deleted file mode 100644 index d5a65aed5..000000000 Binary files a/bundles/org.simantics.graph.compiler/tools/antlr-3.3-complete.jar and /dev/null differ diff --git a/bundles/org.simantics.graph.compiler/tools/antlr-3.5.2-complete.jar b/bundles/org.simantics.graph.compiler/tools/antlr-3.5.2-complete.jar new file mode 100644 index 000000000..260de7634 Binary files /dev/null and b/bundles/org.simantics.graph.compiler/tools/antlr-3.5.2-complete.jar differ diff --git a/bundles/org.simantics.ltk.antlr/META-INF/MANIFEST.MF b/bundles/org.simantics.ltk.antlr/META-INF/MANIFEST.MF index 0be675325..c44c99cb9 100644 --- a/bundles/org.simantics.ltk.antlr/META-INF/MANIFEST.MF +++ b/bundles/org.simantics.ltk.antlr/META-INF/MANIFEST.MF @@ -2,8 +2,11 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Simantics Language Toolkit, ANTLR support Bundle-SymbolicName: org.simantics.ltk.antlr -Bundle-Version: 1.1.10.qualifier +Bundle-Version: 1.1.12.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: org.simantics.ltk;bundle-version="1.0.0";visibility:=reexport, - org.antlr.runtime;bundle-version="[3.2.0,4.0.0)";visibility:=reexport +Require-Bundle: org.simantics.ltk;bundle-version="1.0.0";visibility:=reexport Export-Package: org.simantics.ltk.antlr +Import-Package: org.antlr.runtime;bundle-version="[3.5.2,4.0.0)", + org.antlr.runtime.debug;bundle-version="[3.5.2,4.0.0)", + org.antlr.runtime.misc;bundle-version="[3.5.2,4.0.0)", + org.antlr.runtime.tree;bundle-version="[3.5.2,4.0.0)"