From 5785f36b17d2b290d88c05fee54e39060a07b6d4 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sun, 27 Jun 2021 17:59:54 +0200 Subject: Customize client-side CodeMirror mode --- language/build.gradle | 1 + .../viatra/solver/language/GenerateProblem.mwe2 | 20 +- .../eclipse/viatra/solver/language/Problem.xtext | 6 +- .../naming/ProblemQualifiedNameConverter.java | 2 +- .../viatra/solver/language/Problem.xtextbin | Bin 6159 -> 6292 bytes .../parser/antlr/internal/InternalProblem.g | 12 +- .../parser/antlr/internal/InternalProblem.tokens | 14 +- .../antlr/internal/InternalProblemLexer.java | 694 +++++++++++---------- .../antlr/internal/InternalProblemParser.java | 179 +++--- .../language/services/ProblemGrammarAccess.java | 38 +- 10 files changed, 520 insertions(+), 446 deletions(-) (limited to 'language') diff --git a/language/build.gradle b/language/build.gradle index f32a60e1..855b0a7f 100644 --- a/language/build.gradle +++ b/language/build.gradle @@ -20,6 +20,7 @@ dependencies { mwe2 "org.eclipse.xtext:org.eclipse.xtext.common.types:${xtextVersion}" mwe2 "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:${xtextVersion}" mwe2 'org.eclipse.xtext:xtext-antlr-generator' + mwe2 project(':language-mwe2') } task generateXtextLanguage(type: JavaExec) { diff --git a/language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2 b/language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2 index 76563e2c..a63681c8 100644 --- a/language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2 +++ b/language/src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2 @@ -3,6 +3,8 @@ module org.eclipse.viatra.solver.language.GenerateProblem import org.eclipse.xtext.xtext.generator.* import org.eclipse.xtext.xtext.generator.model.project.* +import org.eclipse.viatra.solver.language.mwe2.* + var rootPath = ".." Workflow { @@ -14,12 +16,12 @@ Workflow { runtimeTest = { enabled = true } - genericIde = { - name = "language-ide" - } + genericIde = { + name = "language-ide" + } web = { enabled = true - name = "language-web" + name = "language-web" } mavenLayout = true } @@ -30,18 +32,15 @@ Workflow { preferXtendStubs = false } } - + language = StandardLanguage { name = "org.eclipse.viatra.solver.language.Problem" fileExtensions = "problem" referencedResource = "platform:/resource/language-model/model/problem.genmodel" - serializer = { generateStub = false } validator = { - // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" - // Generates checks for @Deprecated grammar annotations, an IssueProvider and a corresponding PropertyPage generateDeprecationValidation = true } generator = { @@ -50,10 +49,7 @@ Workflow { junitSupport = { junitVersion = "5" } - webSupport = { - framework = "CodeMirror" - suppressPattern = "string_singleQuote" - } + webSupport = ProblemWebIntegrationFragment {} } } } diff --git a/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext b/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext index 5f8b35f3..466988d8 100644 --- a/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext +++ b/language/src/main/java/org/eclipse/viatra/solver/language/Problem.xtext @@ -103,7 +103,7 @@ QuotedOrUnquotedId: QUOTED_ID | Identifier; QualifiedName: - QUOTED_ID | Identifier (":" Identifier)* (":" QUOTED_ID)?; + QUOTED_ID | Identifier ("::" Identifier)* ("::" QUOTED_ID)?; Identifier: ID | "true" | "false"; @@ -114,3 +114,7 @@ terminal STRING: terminal QUOTED_ID: "'" ('\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\' | "'"))* "'"; + +@Override +terminal SL_COMMENT: + ('%' | '//') !('\n'|'\r')* ('\r'? '\n')?; diff --git a/language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameConverter.java b/language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameConverter.java index 3cee31f3..e55e5dda 100644 --- a/language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameConverter.java +++ b/language/src/main/java/org/eclipse/viatra/solver/language/naming/ProblemQualifiedNameConverter.java @@ -6,7 +6,7 @@ import com.google.inject.Singleton; @Singleton public class ProblemQualifiedNameConverter extends IQualifiedNameConverter.DefaultImpl { - public static final String DELIMITER = ":"; + public static final String DELIMITER = "::"; @Override public String getDelimiter() { diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbin b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbin index cabf6537..dc21001d 100644 Binary files a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbin and b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/Problem.xtextbin differ diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g index 64db0417..3a368756 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.g @@ -1758,10 +1758,10 @@ ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleT afterParserOrEnumRuleCall(); } ( - kw=':' + kw='::' { $current.merge(kw); - newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonKeyword_1_1_0()); + newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonColonKeyword_1_1_0()); } { newCompositeNode(grammarAccess.getQualifiedNameAccess().getIdentifierParserRuleCall_1_1_1()); @@ -1775,10 +1775,10 @@ ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleT } )* ( - kw=':' + kw='::' { $current.merge(kw); - newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonKeyword_1_2_0()); + newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonColonKeyword_1_2_0()); } this_QUOTED_ID_5=RULE_QUOTED_ID { @@ -1896,14 +1896,14 @@ RULE_STRING : '"' ('\\' .|~(('\\'|'"')))* '"'; RULE_QUOTED_ID : '\'' ('\\' .|~(('\\'|'\'')))* '\''; +RULE_SL_COMMENT : ('%'|'//') ~(('\n'|'\r'))* ('\r'? '\n')?; + RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; RULE_INT : ('0'..'9')+; RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/'; -RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; - RULE_WS : (' '|'\t'|'\r'|'\n')+; RULE_ANY_OTHER : .; diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.tokens b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.tokens index e968ac14..7b308424 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.tokens +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblem.tokens @@ -9,9 +9,10 @@ '..'=38 ':'=34 ':-'=31 +'::'=40 ';'=19 '='=37 -'?'=43 +'?'=44 '['=24 ']'=25 'abstract'=14 @@ -20,22 +21,22 @@ 'enum'=21 'error'=27 'extends'=16 -'false'=41 +'false'=42 'opposite'=26 'pred'=28 'problem'=12 'refers'=23 'scope'=35 -'true'=40 -'unknown'=42 +'true'=41 +'unknown'=43 '{'=18 '}'=20 RULE_ANY_OTHER=11 RULE_ID=4 RULE_INT=5 -RULE_ML_COMMENT=8 +RULE_ML_COMMENT=9 RULE_QUOTED_ID=6 -RULE_SL_COMMENT=9 +RULE_SL_COMMENT=8 RULE_STRING=7 RULE_WS=10 T__12=12 @@ -70,3 +71,4 @@ T__40=40 T__41=41 T__42=42 T__43=43 +T__44=44 diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java index 1fd1e166..c6298afc 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemLexer.java @@ -28,14 +28,14 @@ public class InternalProblemLexer extends Lexer { public static final int RULE_INT=5; public static final int T__29=29; public static final int T__22=22; - public static final int RULE_ML_COMMENT=8; + public static final int RULE_ML_COMMENT=9; public static final int T__23=23; public static final int T__24=24; public static final int T__25=25; public static final int T__20=20; public static final int T__21=21; public static final int RULE_STRING=7; - public static final int RULE_SL_COMMENT=9; + public static final int RULE_SL_COMMENT=8; public static final int T__37=37; public static final int T__38=38; public static final int T__39=39; @@ -49,6 +49,7 @@ public class InternalProblemLexer extends Lexer { public static final int T__32=32; public static final int RULE_WS=10; public static final int RULE_ANY_OTHER=11; + public static final int T__44=44; public static final int T__40=40; public static final int T__41=41; public static final int T__42=42; @@ -646,10 +647,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__40; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:39:7: ( 'true' ) - // InternalProblem.g:39:9: 'true' + // InternalProblem.g:39:7: ( '::' ) + // InternalProblem.g:39:9: '::' { - match("true"); + match("::"); } @@ -667,10 +668,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__41; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:40:7: ( 'false' ) - // InternalProblem.g:40:9: 'false' + // InternalProblem.g:40:7: ( 'true' ) + // InternalProblem.g:40:9: 'true' { - match("false"); + match("true"); } @@ -688,10 +689,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__42; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:41:7: ( 'unknown' ) - // InternalProblem.g:41:9: 'unknown' + // InternalProblem.g:41:7: ( 'false' ) + // InternalProblem.g:41:9: 'false' { - match("unknown"); + match("false"); } @@ -709,10 +710,11 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__43; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:42:7: ( '?' ) - // InternalProblem.g:42:9: '?' + // InternalProblem.g:42:7: ( 'unknown' ) + // InternalProblem.g:42:9: 'unknown' { - match('?'); + match("unknown"); + } @@ -724,6 +726,26 @@ public class InternalProblemLexer extends Lexer { } // $ANTLR end "T__43" + // $ANTLR start "T__44" + public final void mT__44() throws RecognitionException { + try { + int _type = T__44; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalProblem.g:43:7: ( '?' ) + // InternalProblem.g:43:9: '?' + { + match('?'); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "T__44" + // $ANTLR start "RULE_STRING" public final void mRULE_STRING() throws RecognitionException { try { @@ -854,57 +876,65 @@ public class InternalProblemLexer extends Lexer { } // $ANTLR end "RULE_QUOTED_ID" - // $ANTLR start "RULE_ID" - public final void mRULE_ID() throws RecognitionException { + // $ANTLR start "RULE_SL_COMMENT" + public final void mRULE_SL_COMMENT() throws RecognitionException { try { - int _type = RULE_ID; + int _type = RULE_SL_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:1899:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // InternalProblem.g:1899:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalProblem.g:1899:17: ( ( '%' | '//' ) (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) + // InternalProblem.g:1899:19: ( '%' | '//' ) (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? { - // InternalProblem.g:1899:11: ( '^' )? + // InternalProblem.g:1899:19: ( '%' | '//' ) int alt3=2; int LA3_0 = input.LA(1); - if ( (LA3_0=='^') ) { + if ( (LA3_0=='%') ) { alt3=1; } + else if ( (LA3_0=='/') ) { + alt3=2; + } + else { + NoViableAltException nvae = + new NoViableAltException("", 3, 0, input); + + throw nvae; + } switch (alt3) { case 1 : - // InternalProblem.g:1899:11: '^' + // InternalProblem.g:1899:20: '%' { - match('^'); + match('%'); } break; + case 2 : + // InternalProblem.g:1899:24: '//' + { + match("//"); - } - if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); + } + break; } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - // InternalProblem.g:1899:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalProblem.g:1899:30: (~ ( ( '\\n' | '\\r' ) ) )* loop4: do { int alt4=2; int LA4_0 = input.LA(1); - if ( ((LA4_0>='0' && LA4_0<='9')||(LA4_0>='A' && LA4_0<='Z')||LA4_0=='_'||(LA4_0>='a' && LA4_0<='z')) ) { + if ( ((LA4_0>='\u0000' && LA4_0<='\t')||(LA4_0>='\u000B' && LA4_0<='\f')||(LA4_0>='\u000E' && LA4_0<='\uFFFF')) ) { alt4=1; } switch (alt4) { case 1 : - // InternalProblem.g: + // InternalProblem.g:1899:30: ~ ( ( '\\n' | '\\r' ) ) { - 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') ) { + if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { input.consume(); } @@ -922,6 +952,42 @@ public class InternalProblemLexer extends Lexer { } } while (true); + // InternalProblem.g:1899:46: ( ( '\\r' )? '\\n' )? + int alt6=2; + int LA6_0 = input.LA(1); + + if ( (LA6_0=='\n'||LA6_0=='\r') ) { + alt6=1; + } + switch (alt6) { + case 1 : + // InternalProblem.g:1899:47: ( '\\r' )? '\\n' + { + // InternalProblem.g:1899:47: ( '\\r' )? + int alt5=2; + int LA5_0 = input.LA(1); + + if ( (LA5_0=='\r') ) { + alt5=1; + } + switch (alt5) { + case 1 : + // InternalProblem.g:1899:47: '\\r' + { + match('\r'); + + } + break; + + } + + match('\n'); + + } + break; + + } + } @@ -931,44 +997,74 @@ public class InternalProblemLexer extends Lexer { finally { } } - // $ANTLR end "RULE_ID" + // $ANTLR end "RULE_SL_COMMENT" - // $ANTLR start "RULE_INT" - public final void mRULE_INT() throws RecognitionException { + // $ANTLR start "RULE_ID" + public final void mRULE_ID() throws RecognitionException { try { - int _type = RULE_INT; + int _type = RULE_ID; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:1901:10: ( ( '0' .. '9' )+ ) - // InternalProblem.g:1901:12: ( '0' .. '9' )+ + // InternalProblem.g:1901:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) + // InternalProblem.g:1901:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* { - // InternalProblem.g:1901:12: ( '0' .. '9' )+ - int cnt5=0; - loop5: + // InternalProblem.g:1901:11: ( '^' )? + int alt7=2; + int LA7_0 = input.LA(1); + + if ( (LA7_0=='^') ) { + alt7=1; + } + switch (alt7) { + case 1 : + // InternalProblem.g:1901:11: '^' + { + match('^'); + + } + break; + + } + + 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;} + + // InternalProblem.g:1901:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + loop8: do { - int alt5=2; - int LA5_0 = input.LA(1); + int alt8=2; + int LA8_0 = input.LA(1); - if ( ((LA5_0>='0' && LA5_0<='9')) ) { - alt5=1; + if ( ((LA8_0>='0' && LA8_0<='9')||(LA8_0>='A' && LA8_0<='Z')||LA8_0=='_'||(LA8_0>='a' && LA8_0<='z')) ) { + alt8=1; } - switch (alt5) { + switch (alt8) { case 1 : - // InternalProblem.g:1901:13: '0' .. '9' + // InternalProblem.g: { - matchRange('0','9'); + 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 : - if ( cnt5 >= 1 ) break loop5; - EarlyExitException eee = - new EarlyExitException(5, input); - throw eee; + break loop8; } - cnt5++; } while (true); @@ -980,57 +1076,46 @@ public class InternalProblemLexer extends Lexer { finally { } } - // $ANTLR end "RULE_INT" + // $ANTLR end "RULE_ID" - // $ANTLR start "RULE_ML_COMMENT" - public final void mRULE_ML_COMMENT() throws RecognitionException { + // $ANTLR start "RULE_INT" + public final void mRULE_INT() throws RecognitionException { try { - int _type = RULE_ML_COMMENT; + int _type = RULE_INT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:1903:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // InternalProblem.g:1903:19: '/*' ( options {greedy=false; } : . )* '*/' + // InternalProblem.g:1903:10: ( ( '0' .. '9' )+ ) + // InternalProblem.g:1903:12: ( '0' .. '9' )+ { - match("/*"); - - // InternalProblem.g:1903:24: ( options {greedy=false; } : . )* - loop6: + // InternalProblem.g:1903:12: ( '0' .. '9' )+ + int cnt9=0; + loop9: do { - int alt6=2; - int LA6_0 = input.LA(1); - - if ( (LA6_0=='*') ) { - int LA6_1 = input.LA(2); + int alt9=2; + int LA9_0 = input.LA(1); - if ( (LA6_1=='/') ) { - alt6=2; - } - else if ( ((LA6_1>='\u0000' && LA6_1<='.')||(LA6_1>='0' && LA6_1<='\uFFFF')) ) { - alt6=1; - } - - - } - else if ( ((LA6_0>='\u0000' && LA6_0<=')')||(LA6_0>='+' && LA6_0<='\uFFFF')) ) { - alt6=1; + if ( ((LA9_0>='0' && LA9_0<='9')) ) { + alt9=1; } - switch (alt6) { + switch (alt9) { case 1 : - // InternalProblem.g:1903:52: . + // InternalProblem.g:1903:13: '0' .. '9' { - matchAny(); + matchRange('0','9'); } break; default : - break loop6; + if ( cnt9 >= 1 ) break loop9; + EarlyExitException eee = + new EarlyExitException(9, input); + throw eee; } + cnt9++; } while (true); - match("*/"); - } @@ -1040,86 +1125,56 @@ public class InternalProblemLexer extends Lexer { finally { } } - // $ANTLR end "RULE_ML_COMMENT" + // $ANTLR end "RULE_INT" - // $ANTLR start "RULE_SL_COMMENT" - public final void mRULE_SL_COMMENT() throws RecognitionException { + // $ANTLR start "RULE_ML_COMMENT" + public final void mRULE_ML_COMMENT() throws RecognitionException { try { - int _type = RULE_SL_COMMENT; + int _type = RULE_ML_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:1905:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // InternalProblem.g:1905:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? + // InternalProblem.g:1905:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) + // InternalProblem.g:1905:19: '/*' ( options {greedy=false; } : . )* '*/' { - match("//"); + match("/*"); - // InternalProblem.g:1905:24: (~ ( ( '\\n' | '\\r' ) ) )* - loop7: + // InternalProblem.g:1905:24: ( options {greedy=false; } : . )* + loop10: do { - int alt7=2; - int LA7_0 = input.LA(1); + 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; + } + - if ( ((LA7_0>='\u0000' && LA7_0<='\t')||(LA7_0>='\u000B' && LA7_0<='\f')||(LA7_0>='\u000E' && LA7_0<='\uFFFF')) ) { - alt7=1; + } + else if ( ((LA10_0>='\u0000' && LA10_0<=')')||(LA10_0>='+' && LA10_0<='\uFFFF')) ) { + alt10=1; } - switch (alt7) { + switch (alt10) { case 1 : - // InternalProblem.g:1905:24: ~ ( ( '\\n' | '\\r' ) ) + // InternalProblem.g:1905:52: . { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - + matchAny(); } break; default : - break loop7; + break loop10; } } while (true); - // InternalProblem.g:1905:40: ( ( '\\r' )? '\\n' )? - int alt9=2; - int LA9_0 = input.LA(1); - - if ( (LA9_0=='\n'||LA9_0=='\r') ) { - alt9=1; - } - switch (alt9) { - case 1 : - // InternalProblem.g:1905:41: ( '\\r' )? '\\n' - { - // InternalProblem.g:1905:41: ( '\\r' )? - int alt8=2; - int LA8_0 = input.LA(1); - - if ( (LA8_0=='\r') ) { - alt8=1; - } - switch (alt8) { - case 1 : - // InternalProblem.g:1905:41: '\\r' - { - match('\r'); - - } - break; - - } - - match('\n'); - - } - break; - - } + match("*/"); } @@ -1130,7 +1185,7 @@ public class InternalProblemLexer extends Lexer { finally { } } - // $ANTLR end "RULE_SL_COMMENT" + // $ANTLR end "RULE_ML_COMMENT" // $ANTLR start "RULE_WS" public final void mRULE_WS() throws RecognitionException { @@ -1141,18 +1196,18 @@ public class InternalProblemLexer extends Lexer { // InternalProblem.g:1907:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ { // InternalProblem.g:1907:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ - int cnt10=0; - loop10: + int cnt11=0; + loop11: do { - int alt10=2; - int LA10_0 = input.LA(1); + int alt11=2; + int LA11_0 = input.LA(1); - if ( ((LA10_0>='\t' && LA10_0<='\n')||LA10_0=='\r'||LA10_0==' ') ) { - alt10=1; + if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) { + alt11=1; } - switch (alt10) { + switch (alt11) { case 1 : // InternalProblem.g: { @@ -1170,12 +1225,12 @@ public class InternalProblemLexer extends Lexer { break; default : - if ( cnt10 >= 1 ) break loop10; + if ( cnt11 >= 1 ) break loop11; EarlyExitException eee = - new EarlyExitException(10, input); + new EarlyExitException(11, input); throw eee; } - cnt10++; + cnt11++; } while (true); @@ -1210,10 +1265,10 @@ public class InternalProblemLexer extends Lexer { // $ANTLR end "RULE_ANY_OTHER" public void mTokens() throws RecognitionException { - // InternalProblem.g:1:8: ( T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | RULE_STRING | RULE_QUOTED_ID | RULE_ID | RULE_INT | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER ) - int alt11=40; - alt11 = dfa11.predict(input); - switch (alt11) { + // InternalProblem.g:1:8: ( T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | RULE_STRING | RULE_QUOTED_ID | RULE_SL_COMMENT | RULE_ID | RULE_INT | RULE_ML_COMMENT | RULE_WS | RULE_ANY_OTHER ) + int alt12=41; + alt12 = dfa12.predict(input); + switch (alt12) { case 1 : // InternalProblem.g:1:10: T__12 { @@ -1439,56 +1494,63 @@ public class InternalProblemLexer extends Lexer { } break; case 33 : - // InternalProblem.g:1:202: RULE_STRING + // InternalProblem.g:1:202: T__44 { - mRULE_STRING(); + mT__44(); } break; case 34 : - // InternalProblem.g:1:214: RULE_QUOTED_ID + // InternalProblem.g:1:208: RULE_STRING { - mRULE_QUOTED_ID(); + mRULE_STRING(); } break; case 35 : - // InternalProblem.g:1:229: RULE_ID + // InternalProblem.g:1:220: RULE_QUOTED_ID { - mRULE_ID(); + mRULE_QUOTED_ID(); } break; case 36 : - // InternalProblem.g:1:237: RULE_INT + // InternalProblem.g:1:235: RULE_SL_COMMENT { - mRULE_INT(); + mRULE_SL_COMMENT(); } break; case 37 : - // InternalProblem.g:1:246: RULE_ML_COMMENT + // InternalProblem.g:1:251: RULE_ID { - mRULE_ML_COMMENT(); + mRULE_ID(); } break; case 38 : - // InternalProblem.g:1:262: RULE_SL_COMMENT + // InternalProblem.g:1:259: RULE_INT { - mRULE_SL_COMMENT(); + mRULE_INT(); } break; case 39 : - // InternalProblem.g:1:278: RULE_WS + // InternalProblem.g:1:268: RULE_ML_COMMENT { - mRULE_WS(); + mRULE_ML_COMMENT(); } break; case 40 : - // InternalProblem.g:1:286: RULE_ANY_OTHER + // InternalProblem.g:1:284: RULE_WS + { + mRULE_WS(); + + } + break; + case 41 : + // InternalProblem.g:1:292: RULE_ANY_OTHER { mRULE_ANY_OTHER(); @@ -1500,85 +1562,87 @@ public class InternalProblemLexer extends Lexer { } - protected DFA11 dfa11 = new DFA11(this); - static final String DFA11_eotS = - "\1\uffff\1\43\1\45\3\43\4\uffff\1\43\2\uffff\1\43\2\uffff\1\67\1\uffff\1\72\1\43\2\uffff\3\43\1\uffff\3\41\2\uffff\1\41\2\uffff\1\43\3\uffff\6\43\4\uffff\1\43\2\uffff\1\43\7\uffff\1\43\2\uffff\3\43\7\uffff\17\43\1\145\4\43\1\152\4\43\1\157\3\43\1\uffff\1\43\1\164\2\43\1\uffff\1\167\2\43\1\172\1\uffff\1\173\3\43\1\uffff\2\43\1\uffff\1\u0081\1\43\2\uffff\1\43\1\u0084\2\43\1\u0087\1\uffff\1\43\1\u0089\1\uffff\1\u008a\1\u008b\1\uffff\1\u008c\4\uffff"; - static final String DFA11_eofS = - "\u008d\uffff"; - static final String DFA11_minS = - "\1\0\1\162\1\56\1\142\1\154\1\156\4\uffff\1\145\2\uffff\1\160\2\uffff\1\55\1\uffff\1\75\1\143\2\uffff\1\162\1\141\1\156\1\uffff\2\0\1\101\2\uffff\1\52\2\uffff\1\145\3\uffff\1\163\1\141\1\156\1\164\1\165\1\162\4\uffff\1\146\2\uffff\1\160\7\uffff\1\157\2\uffff\1\165\1\154\1\153\7\uffff\1\142\1\144\1\164\1\163\1\164\1\145\1\155\1\157\1\145\1\157\1\160\1\145\1\163\1\156\1\154\1\60\1\162\1\163\1\141\1\156\1\60\2\162\1\163\1\145\1\60\1\145\1\157\1\145\1\uffff\1\141\1\60\1\151\1\144\1\uffff\1\60\1\163\1\151\1\60\1\uffff\1\60\1\167\1\155\1\143\1\uffff\1\156\1\163\1\uffff\1\60\1\164\2\uffff\1\156\1\60\1\164\1\163\1\60\1\uffff\1\145\1\60\1\uffff\2\60\1\uffff\1\60\4\uffff"; - static final String DFA11_maxS = - "\1\uffff\1\162\1\56\1\142\1\157\1\170\4\uffff\1\145\2\uffff\1\160\2\uffff\1\55\1\uffff\1\75\1\143\2\uffff\1\162\1\141\1\156\1\uffff\2\uffff\1\172\2\uffff\1\57\2\uffff\1\157\3\uffff\1\163\1\141\1\156\1\164\1\165\1\162\4\uffff\1\146\2\uffff\1\160\7\uffff\1\157\2\uffff\1\165\1\154\1\153\7\uffff\1\142\1\144\1\164\1\163\1\164\1\145\1\155\1\157\1\145\1\157\1\160\1\145\1\163\1\156\1\154\1\172\1\162\1\163\1\141\1\156\1\172\2\162\1\163\1\145\1\172\1\145\1\157\1\145\1\uffff\1\141\1\172\1\151\1\144\1\uffff\1\172\1\163\1\151\1\172\1\uffff\1\172\1\167\1\155\1\143\1\uffff\1\156\1\163\1\uffff\1\172\1\164\2\uffff\1\156\1\172\1\164\1\163\1\172\1\uffff\1\145\1\172\1\uffff\2\172\1\uffff\1\172\4\uffff"; - static final String DFA11_acceptS = - "\6\uffff\1\6\1\7\1\10\1\11\1\uffff\1\15\1\16\1\uffff\1\22\1\23\1\uffff\1\25\2\uffff\1\32\1\34\3\uffff\1\40\3\uffff\1\43\1\44\1\uffff\1\47\1\50\1\uffff\1\43\1\33\1\2\6\uffff\1\6\1\7\1\10\1\11\1\uffff\1\15\1\16\1\uffff\1\22\1\23\1\24\1\27\1\25\1\31\1\26\1\uffff\1\32\1\34\3\uffff\1\40\1\41\1\42\1\44\1\45\1\46\1\47\35\uffff\1\21\4\uffff\1\12\4\uffff\1\35\4\uffff\1\4\2\uffff\1\20\2\uffff\1\30\1\36\5\uffff\1\14\2\uffff\1\1\2\uffff\1\5\1\uffff\1\37\1\3\1\13\1\17"; - static final String DFA11_specialS = - "\1\2\31\uffff\1\1\1\0\161\uffff}>"; - static final String[] DFA11_transitionS = { - "\11\41\2\40\2\41\1\40\22\41\1\40\1\21\1\32\4\41\1\33\1\16\1\17\1\25\1\22\1\6\1\41\1\2\1\37\12\36\1\20\1\10\1\41\1\24\1\41\1\31\1\41\32\35\1\13\1\41\1\14\1\34\1\35\1\41\1\3\1\35\1\4\1\35\1\5\1\27\10\35\1\15\1\1\1\35\1\12\1\23\1\26\1\30\5\35\1\7\1\41\1\11\uff82\41", - "\1\42", - "\1\44", - "\1\46", - "\1\47\2\uffff\1\50", - "\1\52\3\uffff\1\53\5\uffff\1\51", + protected DFA12 dfa12 = new DFA12(this); + static final String DFA12_eotS = + "\1\uffff\1\44\1\46\3\44\4\uffff\1\44\2\uffff\1\44\2\uffff\1\71\1\uffff\1\74\1\44\2\uffff\3\44\1\uffff\2\42\1\uffff\2\42\4\uffff\1\44\3\uffff\6\44\4\uffff\1\44\2\uffff\1\44\10\uffff\1\44\2\uffff\3\44\7\uffff\17\44\1\147\4\44\1\154\4\44\1\161\3\44\1\uffff\1\44\1\166\2\44\1\uffff\1\171\2\44\1\174\1\uffff\1\175\3\44\1\uffff\2\44\1\uffff\1\u0083\1\44\2\uffff\1\44\1\u0086\2\44\1\u0089\1\uffff\1\44\1\u008b\1\uffff\1\u008c\1\u008d\1\uffff\1\u008e\4\uffff"; + static final String DFA12_eofS = + "\u008f\uffff"; + static final String DFA12_minS = + "\1\0\1\162\1\56\1\142\1\154\1\156\4\uffff\1\145\2\uffff\1\160\2\uffff\1\55\1\uffff\1\75\1\143\2\uffff\1\162\1\141\1\156\1\uffff\2\0\1\uffff\1\52\1\101\4\uffff\1\145\3\uffff\1\163\1\141\1\156\1\164\1\165\1\162\4\uffff\1\146\2\uffff\1\160\10\uffff\1\157\2\uffff\1\165\1\154\1\153\7\uffff\1\142\1\144\1\164\1\163\1\164\1\145\1\155\1\157\1\145\1\157\1\160\1\145\1\163\1\156\1\154\1\60\1\162\1\163\1\141\1\156\1\60\2\162\1\163\1\145\1\60\1\145\1\157\1\145\1\uffff\1\141\1\60\1\151\1\144\1\uffff\1\60\1\163\1\151\1\60\1\uffff\1\60\1\167\1\155\1\143\1\uffff\1\156\1\163\1\uffff\1\60\1\164\2\uffff\1\156\1\60\1\164\1\163\1\60\1\uffff\1\145\1\60\1\uffff\2\60\1\uffff\1\60\4\uffff"; + static final String DFA12_maxS = + "\1\uffff\1\162\1\56\1\142\1\157\1\170\4\uffff\1\145\2\uffff\1\160\2\uffff\1\72\1\uffff\1\75\1\143\2\uffff\1\162\1\141\1\156\1\uffff\2\uffff\1\uffff\1\57\1\172\4\uffff\1\157\3\uffff\1\163\1\141\1\156\1\164\1\165\1\162\4\uffff\1\146\2\uffff\1\160\10\uffff\1\157\2\uffff\1\165\1\154\1\153\7\uffff\1\142\1\144\1\164\1\163\1\164\1\145\1\155\1\157\1\145\1\157\1\160\1\145\1\163\1\156\1\154\1\172\1\162\1\163\1\141\1\156\1\172\2\162\1\163\1\145\1\172\1\145\1\157\1\145\1\uffff\1\141\1\172\1\151\1\144\1\uffff\1\172\1\163\1\151\1\172\1\uffff\1\172\1\167\1\155\1\143\1\uffff\1\156\1\163\1\uffff\1\172\1\164\2\uffff\1\156\1\172\1\164\1\163\1\172\1\uffff\1\145\1\172\1\uffff\2\172\1\uffff\1\172\4\uffff"; + static final String DFA12_acceptS = + "\6\uffff\1\6\1\7\1\10\1\11\1\uffff\1\15\1\16\1\uffff\1\22\1\23\1\uffff\1\25\2\uffff\1\32\1\34\3\uffff\1\41\2\uffff\1\44\2\uffff\1\45\1\46\1\50\1\51\1\uffff\1\45\1\33\1\2\6\uffff\1\6\1\7\1\10\1\11\1\uffff\1\15\1\16\1\uffff\1\22\1\23\1\24\1\35\1\27\1\25\1\31\1\26\1\uffff\1\32\1\34\3\uffff\1\41\1\42\1\43\1\44\1\47\1\46\1\50\35\uffff\1\21\4\uffff\1\12\4\uffff\1\36\4\uffff\1\4\2\uffff\1\20\2\uffff\1\30\1\37\5\uffff\1\14\2\uffff\1\1\2\uffff\1\5\1\uffff\1\40\1\3\1\13\1\17"; + static final String DFA12_specialS = + "\1\0\31\uffff\1\2\1\1\163\uffff}>"; + static final String[] DFA12_transitionS = { + "\11\42\2\41\2\42\1\41\22\42\1\41\1\21\1\32\2\42\1\34\1\42\1\33\1\16\1\17\1\25\1\22\1\6\1\42\1\2\1\35\12\40\1\20\1\10\1\42\1\24\1\42\1\31\1\42\32\37\1\13\1\42\1\14\1\36\1\37\1\42\1\3\1\37\1\4\1\37\1\5\1\27\10\37\1\15\1\1\1\37\1\12\1\23\1\26\1\30\5\37\1\7\1\42\1\11\uff82\42", + "\1\43", + "\1\45", + "\1\47", + "\1\50\2\uffff\1\51", + "\1\53\3\uffff\1\54\5\uffff\1\52", "", "", "", "", - "\1\60", + "\1\61", "", "", - "\1\63", + "\1\64", "", "", - "\1\66", + "\1\67\14\uffff\1\70", "", - "\1\71", "\1\73", + "\1\75", "", "", - "\1\76", - "\1\77", "\1\100", + "\1\101", + "\1\102", + "", + "\0\104", + "\0\105", "", - "\0\102", - "\0\103", - "\32\43\4\uffff\1\43\1\uffff\32\43", + "\1\107\4\uffff\1\106", + "\32\44\4\uffff\1\44\1\uffff\32\44", "", "", - "\1\105\4\uffff\1\106", "", "", - "\1\111\11\uffff\1\110", + "\1\113\11\uffff\1\112", "", "", "", - "\1\112", - "\1\113", "\1\114", "\1\115", "\1\116", "\1\117", + "\1\120", + "\1\121", "", "", "", "", - "\1\120", - "", + "\1\122", "", - "\1\121", "", + "\1\123", "", "", "", "", "", "", - "\1\122", "", "", - "\1\123", "\1\124", + "", + "", "\1\125", + "\1\126", + "\1\127", "", "", "", @@ -1586,8 +1650,6 @@ public class InternalProblemLexer extends Lexer { "", "", "", - "\1\126", - "\1\127", "\1\130", "\1\131", "\1\132", @@ -1601,193 +1663,197 @@ public class InternalProblemLexer extends Lexer { "\1\142", "\1\143", "\1\144", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", + "\1\145", "\1\146", - "\1\147", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", "\1\150", "\1\151", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", + "\1\152", "\1\153", - "\1\154", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", "\1\155", "\1\156", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", + "\1\157", "\1\160", - "\1\161", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", "\1\162", - "", "\1\163", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\165", - "\1\166", + "\1\164", "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", + "\1\165", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\167", "\1\170", - "\1\171", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\174", - "\1\175", - "\1\176", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\172", + "\1\173", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", "", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\176", "\1\177", "\1\u0080", "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", + "\1\u0081", "\1\u0082", "", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\u0084", "", - "\1\u0083", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u0085", - "\1\u0086", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", "", + "\1\u0085", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\u0087", "\1\u0088", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "", + "\1\u008a", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", "", "", "", "" }; - static final short[] DFA11_eot = DFA.unpackEncodedString(DFA11_eotS); - static final short[] DFA11_eof = DFA.unpackEncodedString(DFA11_eofS); - static final char[] DFA11_min = DFA.unpackEncodedStringToUnsignedChars(DFA11_minS); - static final char[] DFA11_max = DFA.unpackEncodedStringToUnsignedChars(DFA11_maxS); - static final short[] DFA11_accept = DFA.unpackEncodedString(DFA11_acceptS); - static final short[] DFA11_special = DFA.unpackEncodedString(DFA11_specialS); - static final short[][] DFA11_transition; + static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS); + static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS); + static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS); + static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS); + static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS); + static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS); + static final short[][] DFA12_transition; static { - int numStates = DFA11_transitionS.length; - DFA11_transition = new short[numStates][]; + int numStates = DFA12_transitionS.length; + DFA12_transition = new short[numStates][]; for (int i=0; i='\u0000' && LA11_27<='\uFFFF')) ) {s = 67;} + if ( (LA12_0=='p') ) {s = 1;} - else s = 33; + else if ( (LA12_0=='.') ) {s = 2;} - if ( s>=0 ) return s; - break; - case 1 : - int LA11_26 = input.LA(1); + else if ( (LA12_0=='a') ) {s = 3;} - s = -1; - if ( ((LA11_26>='\u0000' && LA11_26<='\uFFFF')) ) {s = 66;} + else if ( (LA12_0=='c') ) {s = 4;} - else s = 33; + else if ( (LA12_0=='e') ) {s = 5;} - if ( s>=0 ) return s; - break; - case 2 : - int LA11_0 = input.LA(1); + else if ( (LA12_0==',') ) {s = 6;} - s = -1; - if ( (LA11_0=='p') ) {s = 1;} + else if ( (LA12_0=='{') ) {s = 7;} - else if ( (LA11_0=='.') ) {s = 2;} + else if ( (LA12_0==';') ) {s = 8;} - else if ( (LA11_0=='a') ) {s = 3;} + else if ( (LA12_0=='}') ) {s = 9;} - else if ( (LA11_0=='c') ) {s = 4;} + else if ( (LA12_0=='r') ) {s = 10;} - else if ( (LA11_0=='e') ) {s = 5;} + else if ( (LA12_0=='[') ) {s = 11;} - else if ( (LA11_0==',') ) {s = 6;} + else if ( (LA12_0==']') ) {s = 12;} - else if ( (LA11_0=='{') ) {s = 7;} + else if ( (LA12_0=='o') ) {s = 13;} - else if ( (LA11_0==';') ) {s = 8;} + else if ( (LA12_0=='(') ) {s = 14;} - else if ( (LA11_0=='}') ) {s = 9;} + else if ( (LA12_0==')') ) {s = 15;} - else if ( (LA11_0=='r') ) {s = 10;} + else if ( (LA12_0==':') ) {s = 16;} - else if ( (LA11_0=='[') ) {s = 11;} + else if ( (LA12_0=='!') ) {s = 17;} - else if ( (LA11_0==']') ) {s = 12;} + else if ( (LA12_0=='+') ) {s = 18;} - else if ( (LA11_0=='o') ) {s = 13;} + else if ( (LA12_0=='s') ) {s = 19;} - else if ( (LA11_0=='(') ) {s = 14;} + else if ( (LA12_0=='=') ) {s = 20;} - else if ( (LA11_0==')') ) {s = 15;} + else if ( (LA12_0=='*') ) {s = 21;} - else if ( (LA11_0==':') ) {s = 16;} + else if ( (LA12_0=='t') ) {s = 22;} - else if ( (LA11_0=='!') ) {s = 17;} + else if ( (LA12_0=='f') ) {s = 23;} - else if ( (LA11_0=='+') ) {s = 18;} + else if ( (LA12_0=='u') ) {s = 24;} - else if ( (LA11_0=='s') ) {s = 19;} + else if ( (LA12_0=='?') ) {s = 25;} - else if ( (LA11_0=='=') ) {s = 20;} + else if ( (LA12_0=='\"') ) {s = 26;} - else if ( (LA11_0=='*') ) {s = 21;} + else if ( (LA12_0=='\'') ) {s = 27;} - else if ( (LA11_0=='t') ) {s = 22;} + else if ( (LA12_0=='%') ) {s = 28;} - else if ( (LA11_0=='f') ) {s = 23;} + else if ( (LA12_0=='/') ) {s = 29;} - else if ( (LA11_0=='u') ) {s = 24;} + else if ( (LA12_0=='^') ) {s = 30;} - else if ( (LA11_0=='?') ) {s = 25;} + else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='b'||LA12_0=='d'||(LA12_0>='g' && LA12_0<='n')||LA12_0=='q'||(LA12_0>='v' && LA12_0<='z')) ) {s = 31;} - else if ( (LA11_0=='\"') ) {s = 26;} + else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 32;} - else if ( (LA11_0=='\'') ) {s = 27;} + else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 33;} - else if ( (LA11_0=='^') ) {s = 28;} + else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||(LA12_0>='#' && LA12_0<='$')||LA12_0=='&'||LA12_0=='-'||LA12_0=='<'||LA12_0=='>'||LA12_0=='@'||LA12_0=='\\'||LA12_0=='`'||LA12_0=='|'||(LA12_0>='~' && LA12_0<='\uFFFF')) ) {s = 34;} - else if ( ((LA11_0>='A' && LA11_0<='Z')||LA11_0=='_'||LA11_0=='b'||LA11_0=='d'||(LA11_0>='g' && LA11_0<='n')||LA11_0=='q'||(LA11_0>='v' && LA11_0<='z')) ) {s = 29;} + if ( s>=0 ) return s; + break; + case 1 : + int LA12_27 = input.LA(1); - else if ( ((LA11_0>='0' && LA11_0<='9')) ) {s = 30;} + s = -1; + if ( ((LA12_27>='\u0000' && LA12_27<='\uFFFF')) ) {s = 69;} - else if ( (LA11_0=='/') ) {s = 31;} + else s = 34; - else if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {s = 32;} + if ( s>=0 ) return s; + break; + case 2 : + int LA12_26 = input.LA(1); + + s = -1; + if ( ((LA12_26>='\u0000' && LA12_26<='\uFFFF')) ) {s = 68;} - else if ( ((LA11_0>='\u0000' && LA11_0<='\b')||(LA11_0>='\u000B' && LA11_0<='\f')||(LA11_0>='\u000E' && LA11_0<='\u001F')||(LA11_0>='#' && LA11_0<='&')||LA11_0=='-'||LA11_0=='<'||LA11_0=='>'||LA11_0=='@'||LA11_0=='\\'||LA11_0=='`'||LA11_0=='|'||(LA11_0>='~' && LA11_0<='\uFFFF')) ) {s = 33;} + else s = 34; if ( s>=0 ) return s; break; } NoViableAltException nvae = - new NoViableAltException(getDescription(), 11, _s, input); + new NoViableAltException(getDescription(), 12, _s, input); error(nvae); throw nvae; } diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java index 28b54551..fa8643aa 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/parser/antlr/internal/InternalProblemParser.java @@ -22,7 +22,7 @@ import java.util.ArrayList; @SuppressWarnings("all") public class InternalProblemParser extends AbstractInternalAntlrParser { public static final String[] tokenNames = new String[] { - "", "", "", "", "RULE_ID", "RULE_INT", "RULE_QUOTED_ID", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'problem'", "'.'", "'abstract'", "'class'", "'extends'", "','", "'{'", "';'", "'}'", "'enum'", "'contains'", "'refers'", "'['", "']'", "'opposite'", "'error'", "'pred'", "'('", "')'", "':-'", "'!'", "'+'", "':'", "'scope'", "'+='", "'='", "'..'", "'*'", "'true'", "'false'", "'unknown'", "'?'" + "", "", "", "", "RULE_ID", "RULE_INT", "RULE_QUOTED_ID", "RULE_STRING", "RULE_SL_COMMENT", "RULE_ML_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'problem'", "'.'", "'abstract'", "'class'", "'extends'", "','", "'{'", "';'", "'}'", "'enum'", "'contains'", "'refers'", "'['", "']'", "'opposite'", "'error'", "'pred'", "'('", "')'", "':-'", "'!'", "'+'", "':'", "'scope'", "'+='", "'='", "'..'", "'*'", "'::'", "'true'", "'false'", "'unknown'", "'?'" }; public static final int T__19=19; public static final int T__15=15; @@ -40,14 +40,14 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { public static final int RULE_INT=5; public static final int T__29=29; public static final int T__22=22; - public static final int RULE_ML_COMMENT=8; + public static final int RULE_ML_COMMENT=9; public static final int T__23=23; public static final int T__24=24; public static final int T__25=25; public static final int T__20=20; public static final int T__21=21; public static final int RULE_STRING=7; - public static final int RULE_SL_COMMENT=9; + public static final int RULE_SL_COMMENT=8; public static final int T__37=37; public static final int T__38=38; public static final int T__39=39; @@ -61,6 +61,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { public static final int T__32=32; public static final int RULE_WS=10; public static final int RULE_ANY_OTHER=11; + public static final int T__44=44; public static final int T__40=40; public static final int T__41=41; public static final int T__42=42; @@ -225,7 +226,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt2=2; int LA2_0 = input.LA(1); - if ( (LA2_0==RULE_ID||LA2_0==RULE_QUOTED_ID||(LA2_0>=14 && LA2_0<=15)||LA2_0==21||(LA2_0>=27 && LA2_0<=28)||LA2_0==32||LA2_0==35||(LA2_0>=40 && LA2_0<=41)||LA2_0==43) ) { + if ( (LA2_0==RULE_ID||LA2_0==RULE_QUOTED_ID||(LA2_0>=14 && LA2_0<=15)||LA2_0==21||(LA2_0>=27 && LA2_0<=28)||LA2_0==32||LA2_0==35||(LA2_0>=41 && LA2_0<=42)||LA2_0==44) ) { alt2=1; } @@ -372,9 +373,9 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case RULE_ID: case RULE_QUOTED_ID: case 32: - case 40: case 41: - case 43: + case 42: + case 44: { alt3=4; } @@ -774,7 +775,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt8=2; int LA8_0 = input.LA(1); - if ( (LA8_0==RULE_ID||LA8_0==RULE_QUOTED_ID||(LA8_0>=22 && LA8_0<=23)||(LA8_0>=40 && LA8_0<=41)) ) { + if ( (LA8_0==RULE_ID||LA8_0==RULE_QUOTED_ID||(LA8_0>=22 && LA8_0<=23)||(LA8_0>=41 && LA8_0<=42)) ) { alt8=1; } @@ -1020,7 +1021,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt12=2; int LA12_0 = input.LA(1); - if ( (LA12_0==RULE_ID||LA12_0==RULE_QUOTED_ID||(LA12_0>=40 && LA12_0<=41)) ) { + if ( (LA12_0==RULE_ID||LA12_0==RULE_QUOTED_ID||(LA12_0>=41 && LA12_0<=42)) ) { alt12=1; } switch (alt12) { @@ -1067,7 +1068,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { if ( (LA10_0==17) ) { int LA10_1 = input.LA(2); - if ( (LA10_1==RULE_ID||LA10_1==RULE_QUOTED_ID||(LA10_1>=40 && LA10_1<=41)) ) { + if ( (LA10_1==RULE_ID||LA10_1==RULE_QUOTED_ID||(LA10_1>=41 && LA10_1<=42)) ) { alt10=1; } @@ -1803,7 +1804,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt20=2; int LA20_0 = input.LA(1); - if ( (LA20_0==RULE_ID||LA20_0==RULE_QUOTED_ID||(LA20_0>=40 && LA20_0<=41)) ) { + if ( (LA20_0==RULE_ID||LA20_0==RULE_QUOTED_ID||(LA20_0>=41 && LA20_0<=42)) ) { alt20=1; } switch (alt20) { @@ -2113,25 +2114,25 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { { int LA23_2 = input.LA(2); - if ( (LA23_2==RULE_ID||LA23_2==34||(LA23_2>=40 && LA23_2<=41)) ) { + if ( (LA23_2==RULE_ID||(LA23_2>=40 && LA23_2<=42)) ) { alt23=1; } } break; - case 40: + case 41: { int LA23_3 = input.LA(2); - if ( (LA23_3==RULE_ID||LA23_3==34||(LA23_3>=40 && LA23_3<=41)) ) { + if ( (LA23_3==RULE_ID||(LA23_3>=40 && LA23_3<=42)) ) { alt23=1; } } break; - case 41: + case 42: { int LA23_4 = input.LA(2); - if ( (LA23_4==RULE_ID||LA23_4==34||(LA23_4>=40 && LA23_4<=41)) ) { + if ( (LA23_4==RULE_ID||(LA23_4>=40 && LA23_4<=42)) ) { alt23=1; } } @@ -2449,7 +2450,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt25=2; int LA25_0 = input.LA(1); - if ( (LA25_0==RULE_ID||LA25_0==RULE_QUOTED_ID||(LA25_0>=40 && LA25_0<=41)) ) { + if ( (LA25_0==RULE_ID||LA25_0==RULE_QUOTED_ID||(LA25_0>=41 && LA25_0<=42)) ) { alt25=1; } else if ( (LA25_0==32) ) { @@ -2761,7 +2762,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt28=2; int LA28_0 = input.LA(1); - if ( (LA28_0==RULE_ID||LA28_0==RULE_QUOTED_ID||(LA28_0>=40 && LA28_0<=41)) ) { + if ( (LA28_0==RULE_ID||LA28_0==RULE_QUOTED_ID||(LA28_0>=41 && LA28_0<=42)) ) { alt28=1; } switch (alt28) { @@ -3095,7 +3096,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt30=2; int LA30_0 = input.LA(1); - if ( (LA30_0==RULE_ID||LA30_0==RULE_QUOTED_ID||(LA30_0>=40 && LA30_0<=41)) ) { + if ( (LA30_0==RULE_ID||LA30_0==RULE_QUOTED_ID||(LA30_0>=41 && LA30_0<=42)) ) { alt30=1; } switch (alt30) { @@ -3247,7 +3248,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt31=2; int LA31_0 = input.LA(1); - if ( (LA31_0==32||LA31_0==43) ) { + if ( (LA31_0==32||LA31_0==44) ) { alt31=1; } switch (alt31) { @@ -3321,7 +3322,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt33=2; int LA33_0 = input.LA(1); - if ( (LA33_0==RULE_ID||LA33_0==RULE_QUOTED_ID||(LA33_0>=40 && LA33_0<=41)) ) { + if ( (LA33_0==RULE_ID||LA33_0==RULE_QUOTED_ID||(LA33_0>=41 && LA33_0<=42)) ) { alt33=1; } switch (alt33) { @@ -4571,7 +4572,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { if ( (LA40_0==RULE_QUOTED_ID) ) { alt40=1; } - else if ( (LA40_0==RULE_ID||(LA40_0>=40 && LA40_0<=41)) ) { + else if ( (LA40_0==RULE_ID||(LA40_0>=41 && LA40_0<=42)) ) { alt40=2; } else { @@ -4673,7 +4674,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleQualifiedName" - // InternalProblem.g:1733:1: ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= ':' this_Identifier_3= ruleIdentifier )* (kw= ':' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) ; + // InternalProblem.g:1733:1: ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) ; public final AntlrDatatypeRuleToken ruleQualifiedName() throws RecognitionException { AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); @@ -4689,17 +4690,17 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalProblem.g:1739:2: ( (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= ':' this_Identifier_3= ruleIdentifier )* (kw= ':' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) ) - // InternalProblem.g:1740:2: (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= ':' this_Identifier_3= ruleIdentifier )* (kw= ':' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) + // InternalProblem.g:1739:2: ( (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) ) + // InternalProblem.g:1740:2: (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) { - // InternalProblem.g:1740:2: (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= ':' this_Identifier_3= ruleIdentifier )* (kw= ':' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) + // InternalProblem.g:1740:2: (this_QUOTED_ID_0= RULE_QUOTED_ID | (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) ) int alt43=2; int LA43_0 = input.LA(1); if ( (LA43_0==RULE_QUOTED_ID) ) { alt43=1; } - else if ( (LA43_0==RULE_ID||(LA43_0>=40 && LA43_0<=41)) ) { + else if ( (LA43_0==RULE_ID||(LA43_0>=41 && LA43_0<=42)) ) { alt43=2; } else { @@ -4723,10 +4724,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } break; case 2 : - // InternalProblem.g:1749:3: (this_Identifier_1= ruleIdentifier (kw= ':' this_Identifier_3= ruleIdentifier )* (kw= ':' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) + // InternalProblem.g:1749:3: (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) { - // InternalProblem.g:1749:3: (this_Identifier_1= ruleIdentifier (kw= ':' this_Identifier_3= ruleIdentifier )* (kw= ':' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) - // InternalProblem.g:1750:4: this_Identifier_1= ruleIdentifier (kw= ':' this_Identifier_3= ruleIdentifier )* (kw= ':' this_QUOTED_ID_5= RULE_QUOTED_ID )? + // InternalProblem.g:1749:3: (this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? ) + // InternalProblem.g:1750:4: this_Identifier_1= ruleIdentifier (kw= '::' this_Identifier_3= ruleIdentifier )* (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? { newCompositeNode(grammarAccess.getQualifiedNameAccess().getIdentifierParserRuleCall_1_0()); @@ -4742,16 +4743,16 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { afterParserOrEnumRuleCall(); - // InternalProblem.g:1760:4: (kw= ':' this_Identifier_3= ruleIdentifier )* + // InternalProblem.g:1760:4: (kw= '::' this_Identifier_3= ruleIdentifier )* loop41: do { int alt41=2; int LA41_0 = input.LA(1); - if ( (LA41_0==34) ) { + if ( (LA41_0==40) ) { int LA41_1 = input.LA(2); - if ( (LA41_1==RULE_ID||(LA41_1>=40 && LA41_1<=41)) ) { + if ( (LA41_1==RULE_ID||(LA41_1>=41 && LA41_1<=42)) ) { alt41=1; } @@ -4761,12 +4762,12 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { switch (alt41) { case 1 : - // InternalProblem.g:1761:5: kw= ':' this_Identifier_3= ruleIdentifier + // InternalProblem.g:1761:5: kw= '::' this_Identifier_3= ruleIdentifier { - kw=(Token)match(input,34,FOLLOW_3); + kw=(Token)match(input,40,FOLLOW_3); current.merge(kw); - newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonKeyword_1_1_0()); + newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonColonKeyword_1_1_0()); newCompositeNode(grammarAccess.getQualifiedNameAccess().getIdentifierParserRuleCall_1_1_1()); @@ -4791,21 +4792,21 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } } while (true); - // InternalProblem.g:1777:4: (kw= ':' this_QUOTED_ID_5= RULE_QUOTED_ID )? + // InternalProblem.g:1777:4: (kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID )? int alt42=2; int LA42_0 = input.LA(1); - if ( (LA42_0==34) ) { + if ( (LA42_0==40) ) { alt42=1; } switch (alt42) { case 1 : - // InternalProblem.g:1778:5: kw= ':' this_QUOTED_ID_5= RULE_QUOTED_ID + // InternalProblem.g:1778:5: kw= '::' this_QUOTED_ID_5= RULE_QUOTED_ID { - kw=(Token)match(input,34,FOLLOW_37); + kw=(Token)match(input,40,FOLLOW_37); current.merge(kw); - newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonKeyword_1_2_0()); + newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonColonKeyword_1_2_0()); this_QUOTED_ID_5=(Token)match(input,RULE_QUOTED_ID,FOLLOW_2); @@ -4907,12 +4908,12 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { alt44=1; } break; - case 40: + case 41: { alt44=2; } break; - case 41: + case 42: { alt44=3; } @@ -4941,7 +4942,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 2 : // InternalProblem.g:1819:3: kw= 'true' { - kw=(Token)match(input,40,FOLLOW_2); + kw=(Token)match(input,41,FOLLOW_2); current.merge(kw); newLeafNode(kw, grammarAccess.getIdentifierAccess().getTrueKeyword_1()); @@ -4952,7 +4953,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 3 : // InternalProblem.g:1825:3: kw= 'false' { - kw=(Token)match(input,41,FOLLOW_2); + kw=(Token)match(input,42,FOLLOW_2); current.merge(kw); newLeafNode(kw, grammarAccess.getIdentifierAccess().getFalseKeyword_2()); @@ -5001,17 +5002,17 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:1841:2: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) int alt45=3; switch ( input.LA(1) ) { - case 40: + case 41: { alt45=1; } break; - case 41: + case 42: { alt45=2; } break; - case 42: + case 43: { alt45=3; } @@ -5030,7 +5031,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:1842:3: (enumLiteral_0= 'true' ) // InternalProblem.g:1843:4: enumLiteral_0= 'true' { - enumLiteral_0=(Token)match(input,40,FOLLOW_2); + enumLiteral_0=(Token)match(input,41,FOLLOW_2); current = grammarAccess.getLogicValueAccess().getTRUEEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); newLeafNode(enumLiteral_0, grammarAccess.getLogicValueAccess().getTRUEEnumLiteralDeclaration_0()); @@ -5047,7 +5048,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:1850:3: (enumLiteral_1= 'false' ) // InternalProblem.g:1851:4: enumLiteral_1= 'false' { - enumLiteral_1=(Token)match(input,41,FOLLOW_2); + enumLiteral_1=(Token)match(input,42,FOLLOW_2); current = grammarAccess.getLogicValueAccess().getFALSEEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); newLeafNode(enumLiteral_1, grammarAccess.getLogicValueAccess().getFALSEEnumLiteralDeclaration_1()); @@ -5064,7 +5065,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:1858:3: (enumLiteral_2= 'unknown' ) // InternalProblem.g:1859:4: enumLiteral_2= 'unknown' { - enumLiteral_2=(Token)match(input,42,FOLLOW_2); + enumLiteral_2=(Token)match(input,43,FOLLOW_2); current = grammarAccess.getLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_2().getEnumLiteral().getInstance(); newLeafNode(enumLiteral_2, grammarAccess.getLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_2()); @@ -5119,7 +5120,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { if ( (LA46_0==32) ) { alt46=1; } - else if ( (LA46_0==43) ) { + else if ( (LA46_0==44) ) { alt46=2; } else { @@ -5152,7 +5153,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:1885:3: (enumLiteral_1= '?' ) // InternalProblem.g:1886:4: enumLiteral_1= '?' { - enumLiteral_1=(Token)match(input,43,FOLLOW_2); + enumLiteral_1=(Token)match(input,44,FOLLOW_2); current = grammarAccess.getShortLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); newLeafNode(enumLiteral_1, grammarAccess.getShortLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_1()); @@ -5190,42 +5191,42 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { protected DFA34 dfa34 = new DFA34(this); static final String dfa_1s = "\41\uffff"; static final String dfa_2s = "\1\4\4\35\1\uffff\2\4\4\21\1\15\4\35\2\4\1\uffff\10\21\1\4\4\21"; - static final String dfa_3s = "\1\53\1\35\3\42\1\uffff\2\51\1\36\7\42\1\35\2\51\1\uffff\1\36\6\42\1\36\1\51\3\42\1\36"; + static final String dfa_3s = "\1\54\1\35\3\50\1\uffff\2\52\1\36\3\50\1\42\3\50\1\35\2\52\1\uffff\1\36\6\50\1\36\1\52\3\50\1\36"; static final String dfa_4s = "\5\uffff\1\2\15\uffff\1\1\15\uffff"; static final String dfa_5s = "\41\uffff}>"; static final String[] dfa_6s = { - "\1\2\1\uffff\1\1\31\uffff\1\5\7\uffff\1\3\1\4\1\uffff\1\5", + "\1\2\1\uffff\1\1\31\uffff\1\5\10\uffff\1\3\1\4\1\uffff\1\5", "\1\6", - "\1\6\4\uffff\1\7", - "\1\6\4\uffff\1\7", - "\1\6\4\uffff\1\7", + "\1\6\12\uffff\1\7", + "\1\6\12\uffff\1\7", + "\1\6\12\uffff\1\7", "", - "\1\11\1\uffff\1\10\27\uffff\1\14\11\uffff\1\12\1\13", - "\1\15\1\uffff\1\20\41\uffff\1\16\1\17", + "\1\11\1\uffff\1\10\27\uffff\1\14\12\uffff\1\12\1\13", + "\1\15\1\uffff\1\20\42\uffff\1\16\1\17", "\1\21\14\uffff\1\14", - "\1\21\14\uffff\1\14\3\uffff\1\22", - "\1\21\14\uffff\1\14\3\uffff\1\22", - "\1\21\14\uffff\1\14\3\uffff\1\22", + "\1\21\14\uffff\1\14\11\uffff\1\22", + "\1\21\14\uffff\1\14\11\uffff\1\22", + "\1\21\14\uffff\1\14\11\uffff\1\22", "\1\5\24\uffff\1\23", - "\1\6\4\uffff\1\7", - "\1\6\4\uffff\1\7", - "\1\6\4\uffff\1\7", + "\1\6\12\uffff\1\7", + "\1\6\12\uffff\1\7", + "\1\6\12\uffff\1\7", "\1\6", - "\1\25\1\uffff\1\24\41\uffff\1\26\1\27", - "\1\30\1\uffff\1\33\41\uffff\1\31\1\32", + "\1\25\1\uffff\1\24\42\uffff\1\26\1\27", + "\1\30\1\uffff\1\33\42\uffff\1\31\1\32", "", "\1\21\14\uffff\1\14", - "\1\21\14\uffff\1\14\3\uffff\1\34", - "\1\21\14\uffff\1\14\3\uffff\1\34", - "\1\21\14\uffff\1\14\3\uffff\1\34", - "\1\21\14\uffff\1\14\3\uffff\1\22", - "\1\21\14\uffff\1\14\3\uffff\1\22", - "\1\21\14\uffff\1\14\3\uffff\1\22", + "\1\21\14\uffff\1\14\11\uffff\1\34", + "\1\21\14\uffff\1\14\11\uffff\1\34", + "\1\21\14\uffff\1\14\11\uffff\1\34", + "\1\21\14\uffff\1\14\11\uffff\1\22", + "\1\21\14\uffff\1\14\11\uffff\1\22", + "\1\21\14\uffff\1\14\11\uffff\1\22", "\1\21\14\uffff\1\14", - "\1\35\1\uffff\1\40\41\uffff\1\36\1\37", - "\1\21\14\uffff\1\14\3\uffff\1\34", - "\1\21\14\uffff\1\14\3\uffff\1\34", - "\1\21\14\uffff\1\14\3\uffff\1\34", + "\1\35\1\uffff\1\40\42\uffff\1\36\1\37", + "\1\21\14\uffff\1\14\11\uffff\1\34", + "\1\21\14\uffff\1\14\11\uffff\1\34", + "\1\21\14\uffff\1\14\11\uffff\1\34", "\1\21\14\uffff\1\14" }; @@ -5257,40 +5258,40 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { public static final BitSet FOLLOW_1 = new BitSet(new long[]{0x0000000000000000L}); public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x0000030000000010L}); + public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x0000060000000010L}); public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000002000L}); - public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x00000B091820C052L}); + public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x000016091820C052L}); public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000008000L}); public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x0000000000052000L}); - public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000030000000050L}); + public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000060000000050L}); public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x0000000000062000L}); - public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x0000030000D00050L}); - public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x0000030000D80050L}); + public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x0000060000D00050L}); + public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x0000060000D80050L}); public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x0000000000042000L}); - public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x0000030000100050L}); + public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x0000060000100050L}); public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x00000000001A0000L}); public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000000100000L}); - public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x0000030001000010L}); + public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x0000060001000010L}); public static final BitSet FOLLOW_17 = new BitSet(new long[]{0x0000000000000020L}); public static final BitSet FOLLOW_18 = new BitSet(new long[]{0x0000000002000000L}); public static final BitSet FOLLOW_19 = new BitSet(new long[]{0x0000000004000002L}); - public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x0000030010000010L}); + public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x0000060010000010L}); public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x0000000020000000L}); - public static final BitSet FOLLOW_22 = new BitSet(new long[]{0x0000030040000050L}); + public static final BitSet FOLLOW_22 = new BitSet(new long[]{0x0000060040000050L}); public static final BitSet FOLLOW_23 = new BitSet(new long[]{0x0000000040020000L}); public static final BitSet FOLLOW_24 = new BitSet(new long[]{0x0000000080002000L}); - public static final BitSet FOLLOW_25 = new BitSet(new long[]{0x0000030100000050L}); + public static final BitSet FOLLOW_25 = new BitSet(new long[]{0x0000060100000050L}); public static final BitSet FOLLOW_26 = new BitSet(new long[]{0x0000000000082000L}); public static final BitSet FOLLOW_27 = new BitSet(new long[]{0x0000000000020002L}); public static final BitSet FOLLOW_28 = new BitSet(new long[]{0x0000000220000000L}); public static final BitSet FOLLOW_29 = new BitSet(new long[]{0x0000000400000000L}); - public static final BitSet FOLLOW_30 = new BitSet(new long[]{0x0000070000000000L}); + public static final BitSet FOLLOW_30 = new BitSet(new long[]{0x00000E0000000000L}); public static final BitSet FOLLOW_31 = new BitSet(new long[]{0x0000000000000010L}); public static final BitSet FOLLOW_32 = new BitSet(new long[]{0x0000000000022000L}); public static final BitSet FOLLOW_33 = new BitSet(new long[]{0x0000003000000000L}); public static final BitSet FOLLOW_34 = new BitSet(new long[]{0x0000004000000000L}); public static final BitSet FOLLOW_35 = new BitSet(new long[]{0x0000008000000020L}); - public static final BitSet FOLLOW_36 = new BitSet(new long[]{0x0000000400000002L}); + public static final BitSet FOLLOW_36 = new BitSet(new long[]{0x0000010000000002L}); public static final BitSet FOLLOW_37 = new BitSet(new long[]{0x0000000000000040L}); } \ No newline at end of file diff --git a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java index 4368036b..13f92444 100644 --- a/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java +++ b/language/src/main/xtext-gen/org/eclipse/viatra/solver/language/services/ProblemGrammarAccess.java @@ -1143,42 +1143,42 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE private final Group cGroup_1 = (Group)cAlternatives.eContents().get(1); private final RuleCall cIdentifierParserRuleCall_1_0 = (RuleCall)cGroup_1.eContents().get(0); private final Group cGroup_1_1 = (Group)cGroup_1.eContents().get(1); - private final Keyword cColonKeyword_1_1_0 = (Keyword)cGroup_1_1.eContents().get(0); + private final Keyword cColonColonKeyword_1_1_0 = (Keyword)cGroup_1_1.eContents().get(0); private final RuleCall cIdentifierParserRuleCall_1_1_1 = (RuleCall)cGroup_1_1.eContents().get(1); private final Group cGroup_1_2 = (Group)cGroup_1.eContents().get(2); - private final Keyword cColonKeyword_1_2_0 = (Keyword)cGroup_1_2.eContents().get(0); + private final Keyword cColonColonKeyword_1_2_0 = (Keyword)cGroup_1_2.eContents().get(0); private final RuleCall cQUOTED_IDTerminalRuleCall_1_2_1 = (RuleCall)cGroup_1_2.eContents().get(1); //QualifiedName: - // QUOTED_ID | Identifier (":" Identifier)* (":" QUOTED_ID)?; + // QUOTED_ID | Identifier ("::" Identifier)* ("::" QUOTED_ID)?; @Override public ParserRule getRule() { return rule; } - //QUOTED_ID | Identifier (":" Identifier)* (":" QUOTED_ID)? + //QUOTED_ID | Identifier ("::" Identifier)* ("::" QUOTED_ID)? public Alternatives getAlternatives() { return cAlternatives; } //QUOTED_ID public RuleCall getQUOTED_IDTerminalRuleCall_0() { return cQUOTED_IDTerminalRuleCall_0; } - //Identifier (":" Identifier)* (":" QUOTED_ID)? + //Identifier ("::" Identifier)* ("::" QUOTED_ID)? public Group getGroup_1() { return cGroup_1; } //Identifier public RuleCall getIdentifierParserRuleCall_1_0() { return cIdentifierParserRuleCall_1_0; } - //(":" Identifier)* + //("::" Identifier)* public Group getGroup_1_1() { return cGroup_1_1; } - //":" - public Keyword getColonKeyword_1_1_0() { return cColonKeyword_1_1_0; } + //"::" + public Keyword getColonColonKeyword_1_1_0() { return cColonColonKeyword_1_1_0; } //Identifier public RuleCall getIdentifierParserRuleCall_1_1_1() { return cIdentifierParserRuleCall_1_1_1; } - //(":" QUOTED_ID)? + //("::" QUOTED_ID)? public Group getGroup_1_2() { return cGroup_1_2; } - //":" - public Keyword getColonKeyword_1_2_0() { return cColonKeyword_1_2_0; } + //"::" + public Keyword getColonColonKeyword_1_2_0() { return cColonColonKeyword_1_2_0; } //QUOTED_ID public RuleCall getQUOTED_IDTerminalRuleCall_1_2_1() { return cQUOTED_IDTerminalRuleCall_1_2_1; } @@ -1299,6 +1299,7 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE private final IdentifierElements pIdentifier; private final TerminalRule tSTRING; private final TerminalRule tQUOTED_ID; + private final TerminalRule tSL_COMMENT; private final Grammar grammar; @@ -1338,6 +1339,7 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE this.pIdentifier = new IdentifierElements(); this.tSTRING = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.STRING"); this.tQUOTED_ID = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.QUOTED_ID"); + this.tSL_COMMENT = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.SL_COMMENT"); } protected Grammar internalFindGrammar(GrammarProvider grammarProvider) { @@ -1642,7 +1644,7 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE } //QualifiedName: - // QUOTED_ID | Identifier (":" Identifier)* (":" QUOTED_ID)?; + // QUOTED_ID | Identifier ("::" Identifier)* ("::" QUOTED_ID)?; public QualifiedNameElements getQualifiedNameAccess() { return pQualifiedName; } @@ -1674,6 +1676,13 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE return tQUOTED_ID; } + //@Override + //terminal SL_COMMENT: + // ('%' | '//') !('\n'|'\r')* ('\r'? '\n')?; + public TerminalRule getSL_COMMENTRule() { + return tSL_COMMENT; + } + //terminal ID: '^'?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; public TerminalRule getIDRule() { return gaTerminals.getIDRule(); @@ -1689,11 +1698,6 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE return gaTerminals.getML_COMMENTRule(); } - //terminal SL_COMMENT : '//' !('\n'|'\r')* ('\r'? '\n')?; - public TerminalRule getSL_COMMENTRule() { - return gaTerminals.getSL_COMMENTRule(); - } - //terminal WS : (' '|'\t'|'\r'|'\n')+; public TerminalRule getWSRule() { return gaTerminals.getWSRule(); -- cgit v1.2.3-54-g00ecf