From 82a2ca3c963e47611d1ba55f6938e7665488fc5a Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Mon, 28 Jun 2021 17:16:56 +0200 Subject: Fix real literals --- .../eclipse/viatra/solver/language/Problem.xtext | 11 +- .../eclipse/viatra/solver/language/builtin.problem | 2 +- .../viatra/solver/language/Problem.xtextbin | Bin 7550 -> 7566 bytes .../parser/antlr/internal/InternalProblem.g | 111 +-- .../parser/antlr/internal/InternalProblem.tokens | 81 +- .../antlr/internal/InternalProblemLexer.java | 999 +++++++++++---------- .../antlr/internal/InternalProblemParser.java | 972 ++++++++------------ .../language/services/ProblemGrammarAccess.java | 128 +-- .../solver/language/tests/ProblemParsingTest.xtend | 46 +- .../solver/language/tests/ProblemScopingTest.xtend | 33 +- .../solver/language/tests/ProblemTestUtil.xtend | 10 +- 11 files changed, 1077 insertions(+), 1316 deletions(-) (limited to 'language') 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 495f50e4..4aeb0acd 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 @@ -92,7 +92,7 @@ NodeValueAssertion: node=[Node|QualifiedName] ":" value=Constant "."; Constant: - IntConstant | RealConstant | StringConstant; + RealConstant | IntConstant | StringConstant; IntConstant: intValue=Integer; @@ -133,18 +133,21 @@ QualifiedName hidden(): QUOTED_ID | Identifier ("::" Identifier)*; Identifier: - ID | "true" | "false" | "e" | "E"; + ID | "true" | "false"; Integer returns ecore::EInt hidden(): "-"? INT; -Real returns ecore::EDouble hidden(): - "-"? INT ("." INT | ("." INT)? ("e" | "E") ("-" | "+")? INT); +Real returns ecore::EDouble: + "-"? (EXPONENTIAL | INT "." (INT | EXPONENTIAL)); @Override terminal ID: ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; +terminal EXPONENTIAL: + INT ("e" | "E") ("+" | "-")? INT; + @Override terminal STRING: '"' ('\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\' | '"'))* '"'; diff --git a/language/src/main/resources/org/eclipse/viatra/solver/language/builtin.problem b/language/src/main/resources/org/eclipse/viatra/solver/language/builtin.problem index 7ece2db0..7c4f6685 100644 --- a/language/src/main/resources/org/eclipse/viatra/solver/language/builtin.problem +++ b/language/src/main/resources/org/eclipse/viatra/solver/language/builtin.problem @@ -16,6 +16,6 @@ enum bool { class real extends data. -class int extends real. +class int extends data. class string extends data. 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 9528b778..0b613873 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 f9372e7b..583f8c1c 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 @@ -1596,20 +1596,20 @@ ruleConstant returns [EObject current=null] }: ( { - newCompositeNode(grammarAccess.getConstantAccess().getIntConstantParserRuleCall_0()); + newCompositeNode(grammarAccess.getConstantAccess().getRealConstantParserRuleCall_0()); } - this_IntConstant_0=ruleIntConstant + this_RealConstant_0=ruleRealConstant { - $current = $this_IntConstant_0.current; + $current = $this_RealConstant_0.current; afterParserOrEnumRuleCall(); } | { - newCompositeNode(grammarAccess.getConstantAccess().getRealConstantParserRuleCall_1()); + newCompositeNode(grammarAccess.getConstantAccess().getIntConstantParserRuleCall_1()); } - this_RealConstant_1=ruleRealConstant + this_IntConstant_1=ruleIntConstant { - $current = $this_RealConstant_1.current; + $current = $this_IntConstant_1.current; afterParserOrEnumRuleCall(); } | @@ -2197,18 +2197,6 @@ ruleIdentifier returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToke $current.merge(kw); newLeafNode(kw, grammarAccess.getIdentifierAccess().getFalseKeyword_2()); } - | - kw='e' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getIdentifierAccess().getEKeyword_3()); - } - | - kw='E' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getIdentifierAccess().getEKeyword_4()); - } ) ; @@ -2255,22 +2243,16 @@ finally { } // Entry rule entryRuleReal -entryRuleReal returns [String current=null]@init { - HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); -}: +entryRuleReal returns [String current=null]: { newCompositeNode(grammarAccess.getRealRule()); } iv_ruleReal=ruleReal { $current=$iv_ruleReal.current.getText(); } EOF; -finally { - myHiddenTokenState.restore(); -} // Rule Real ruleReal returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] @init { enterRule(); - HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); } @after { leaveRule(); @@ -2283,84 +2265,49 @@ ruleReal returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] newLeafNode(kw, grammarAccess.getRealAccess().getHyphenMinusKeyword_0()); } )? - this_INT_1=RULE_INT - { - $current.merge(this_INT_1); - } - { - newLeafNode(this_INT_1, grammarAccess.getRealAccess().getINTTerminalRuleCall_1()); - } ( + this_EXPONENTIAL_1=RULE_EXPONENTIAL + { + $current.merge(this_EXPONENTIAL_1); + } + { + newLeafNode(this_EXPONENTIAL_1, grammarAccess.getRealAccess().getEXPONENTIALTerminalRuleCall_1_0()); + } + | ( - kw='.' + this_INT_2=RULE_INT { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getFullStopKeyword_2_0_0()); + $current.merge(this_INT_2); } - this_INT_3=RULE_INT { - $current.merge(this_INT_3); + newLeafNode(this_INT_2, grammarAccess.getRealAccess().getINTTerminalRuleCall_1_1_0()); } + kw='.' { - newLeafNode(this_INT_3, grammarAccess.getRealAccess().getINTTerminalRuleCall_2_0_1()); + $current.merge(kw); + newLeafNode(kw, grammarAccess.getRealAccess().getFullStopKeyword_1_1_1()); } - ) - | - ( ( - kw='.' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getFullStopKeyword_2_1_0_0()); - } - this_INT_5=RULE_INT + this_INT_4=RULE_INT { - $current.merge(this_INT_5); + $current.merge(this_INT_4); } { - newLeafNode(this_INT_5, grammarAccess.getRealAccess().getINTTerminalRuleCall_2_1_0_1()); - } - )? - ( - kw='e' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getEKeyword_2_1_1_0()); + newLeafNode(this_INT_4, grammarAccess.getRealAccess().getINTTerminalRuleCall_1_1_2_0()); } | - kw='E' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getEKeyword_2_1_1_1()); - } - ) - ( - kw='-' + this_EXPONENTIAL_5=RULE_EXPONENTIAL { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getHyphenMinusKeyword_2_1_2_0()); + $current.merge(this_EXPONENTIAL_5); } - | - kw='+' { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getPlusSignKeyword_2_1_2_1()); + newLeafNode(this_EXPONENTIAL_5, grammarAccess.getRealAccess().getEXPONENTIALTerminalRuleCall_1_1_2_1()); } - )? - this_INT_10=RULE_INT - { - $current.merge(this_INT_10); - } - { - newLeafNode(this_INT_10, grammarAccess.getRealAccess().getINTTerminalRuleCall_2_1_3()); - } + ) ) ) ) ; -finally { - myHiddenTokenState.restore(); -} // Rule LogicValue ruleLogicValue returns [Enumerator current=null] @@ -2426,6 +2373,8 @@ ruleShortLogicValue returns [Enumerator current=null] RULE_ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; +RULE_EXPONENTIAL : RULE_INT ('e'|'E') ('+'|'-')? RULE_INT; + RULE_STRING : '"' ('\\' .|~(('\\'|'"')))* '"'; RULE_QUOTED_ID : '\'' ('\\' .|~(('\\'|'\'')))* '\''; 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 763a9cc8..7ceb60d6 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 @@ -1,48 +1,46 @@ -'!'=32 -'('=29 -')'=30 -'*'=39 -'+'=33 -'+='=36 -','=17 -'-'=45 -'.'=13 -'..'=38 -':'=34 -':-'=31 -'::'=40 -';'=19 -'='=37 -'?'=47 -'E'=44 -'['=24 -']'=25 -'abstract'=14 -'class'=15 -'contains'=22 -'e'=43 -'enum'=21 -'error'=27 -'extends'=16 -'false'=42 -'opposite'=26 -'pred'=28 -'problem'=12 -'refers'=23 -'scope'=35 -'true'=41 -'unknown'=46 -'{'=18 -'}'=20 -RULE_ANY_OTHER=11 +'!'=33 +'('=30 +')'=31 +'*'=40 +'+'=34 +'+='=37 +','=18 +'-'=44 +'.'=14 +'..'=39 +':'=35 +':-'=32 +'::'=41 +';'=20 +'='=38 +'?'=46 +'['=25 +']'=26 +'abstract'=15 +'class'=16 +'contains'=23 +'enum'=22 +'error'=28 +'extends'=17 +'false'=43 +'opposite'=27 +'pred'=29 +'problem'=13 +'refers'=24 +'scope'=36 +'true'=42 +'unknown'=45 +'{'=19 +'}'=21 +RULE_ANY_OTHER=12 +RULE_EXPONENTIAL=8 RULE_ID=5 RULE_INT=6 -RULE_ML_COMMENT=9 +RULE_ML_COMMENT=10 RULE_QUOTED_ID=7 -RULE_SL_COMMENT=8 +RULE_SL_COMMENT=9 RULE_STRING=4 -RULE_WS=10 -T__12=12 +RULE_WS=11 T__13=13 T__14=14 T__15=15 @@ -77,4 +75,3 @@ T__43=43 T__44=44 T__45=45 T__46=46 -T__47=47 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 8adc6935..cc9b39b6 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 @@ -17,9 +17,9 @@ public class InternalProblemLexer extends Lexer { public static final int T__16=16; public static final int T__17=17; public static final int T__18=18; - public static final int T__12=12; public static final int T__13=13; public static final int T__14=14; + public static final int RULE_EXPONENTIAL=8; public static final int RULE_ID=5; public static final int RULE_QUOTED_ID=7; public static final int T__26=26; @@ -28,14 +28,14 @@ public class InternalProblemLexer extends Lexer { public static final int RULE_INT=6; public static final int T__29=29; public static final int T__22=22; - public static final int RULE_ML_COMMENT=9; + public static final int RULE_ML_COMMENT=10; 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=4; - public static final int RULE_SL_COMMENT=8; + public static final int RULE_SL_COMMENT=9; public static final int T__37=37; public static final int T__38=38; public static final int T__39=39; @@ -47,12 +47,11 @@ public class InternalProblemLexer extends Lexer { public static final int T__30=30; public static final int T__31=31; 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 RULE_WS=11; + public static final int RULE_ANY_OTHER=12; public static final int T__44=44; public static final int T__45=45; public static final int T__46=46; - public static final int T__47=47; public static final int T__40=40; public static final int T__41=41; public static final int T__42=42; @@ -71,10 +70,10 @@ public class InternalProblemLexer extends Lexer { } public String getGrammarFileName() { return "InternalProblem.g"; } - // $ANTLR start "T__12" - public final void mT__12() throws RecognitionException { + // $ANTLR start "T__13" + public final void mT__13() throws RecognitionException { try { - int _type = T__12; + int _type = T__13; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalProblem.g:11:7: ( 'problem' ) // InternalProblem.g:11:9: 'problem' @@ -82,26 +81,6 @@ public class InternalProblemLexer extends Lexer { match("problem"); - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__12" - - // $ANTLR start "T__13" - public final void mT__13() throws RecognitionException { - try { - int _type = T__13; - int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:12:7: ( '.' ) - // InternalProblem.g:12:9: '.' - { - match('.'); - } state.type = _type; @@ -117,11 +96,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__14; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:13:7: ( 'abstract' ) - // InternalProblem.g:13:9: 'abstract' + // InternalProblem.g:12:7: ( '.' ) + // InternalProblem.g:12:9: '.' { - match("abstract"); - + match('.'); } @@ -138,10 +116,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__15; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:14:7: ( 'class' ) - // InternalProblem.g:14:9: 'class' + // InternalProblem.g:13:7: ( 'abstract' ) + // InternalProblem.g:13:9: 'abstract' { - match("class"); + match("abstract"); } @@ -159,10 +137,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__16; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:15:7: ( 'extends' ) - // InternalProblem.g:15:9: 'extends' + // InternalProblem.g:14:7: ( 'class' ) + // InternalProblem.g:14:9: 'class' { - match("extends"); + match("class"); } @@ -180,10 +158,11 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__17; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:16:7: ( ',' ) - // InternalProblem.g:16:9: ',' + // InternalProblem.g:15:7: ( 'extends' ) + // InternalProblem.g:15:9: 'extends' { - match(','); + match("extends"); + } @@ -200,10 +179,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__18; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:17:7: ( '{' ) - // InternalProblem.g:17:9: '{' + // InternalProblem.g:16:7: ( ',' ) + // InternalProblem.g:16:9: ',' { - match('{'); + match(','); } @@ -220,10 +199,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__19; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:18:7: ( ';' ) - // InternalProblem.g:18:9: ';' + // InternalProblem.g:17:7: ( '{' ) + // InternalProblem.g:17:9: '{' { - match(';'); + match('{'); } @@ -240,10 +219,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__20; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:19:7: ( '}' ) - // InternalProblem.g:19:9: '}' + // InternalProblem.g:18:7: ( ';' ) + // InternalProblem.g:18:9: ';' { - match('}'); + match(';'); } @@ -260,11 +239,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__21; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:20:7: ( 'enum' ) - // InternalProblem.g:20:9: 'enum' + // InternalProblem.g:19:7: ( '}' ) + // InternalProblem.g:19:9: '}' { - match("enum"); - + match('}'); } @@ -281,10 +259,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__22; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:21:7: ( 'contains' ) - // InternalProblem.g:21:9: 'contains' + // InternalProblem.g:20:7: ( 'enum' ) + // InternalProblem.g:20:9: 'enum' { - match("contains"); + match("enum"); } @@ -302,10 +280,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__23; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:22:7: ( 'refers' ) - // InternalProblem.g:22:9: 'refers' + // InternalProblem.g:21:7: ( 'contains' ) + // InternalProblem.g:21:9: 'contains' { - match("refers"); + match("contains"); } @@ -323,10 +301,11 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__24; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:23:7: ( '[' ) - // InternalProblem.g:23:9: '[' + // InternalProblem.g:22:7: ( 'refers' ) + // InternalProblem.g:22:9: 'refers' { - match('['); + match("refers"); + } @@ -343,10 +322,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__25; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:24:7: ( ']' ) - // InternalProblem.g:24:9: ']' + // InternalProblem.g:23:7: ( '[' ) + // InternalProblem.g:23:9: '[' { - match(']'); + match('['); } @@ -363,11 +342,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__26; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:25:7: ( 'opposite' ) - // InternalProblem.g:25:9: 'opposite' + // InternalProblem.g:24:7: ( ']' ) + // InternalProblem.g:24:9: ']' { - match("opposite"); - + match(']'); } @@ -384,10 +362,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__27; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:26:7: ( 'error' ) - // InternalProblem.g:26:9: 'error' + // InternalProblem.g:25:7: ( 'opposite' ) + // InternalProblem.g:25:9: 'opposite' { - match("error"); + match("opposite"); } @@ -405,10 +383,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__28; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:27:7: ( 'pred' ) - // InternalProblem.g:27:9: 'pred' + // InternalProblem.g:26:7: ( 'error' ) + // InternalProblem.g:26:9: 'error' { - match("pred"); + match("error"); } @@ -426,10 +404,11 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__29; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:28:7: ( '(' ) - // InternalProblem.g:28:9: '(' + // InternalProblem.g:27:7: ( 'pred' ) + // InternalProblem.g:27:9: 'pred' { - match('('); + match("pred"); + } @@ -446,10 +425,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__30; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:29:7: ( ')' ) - // InternalProblem.g:29:9: ')' + // InternalProblem.g:28:7: ( '(' ) + // InternalProblem.g:28:9: '(' { - match(')'); + match('('); } @@ -466,11 +445,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__31; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:30:7: ( ':-' ) - // InternalProblem.g:30:9: ':-' + // InternalProblem.g:29:7: ( ')' ) + // InternalProblem.g:29:9: ')' { - match(":-"); - + match(')'); } @@ -487,10 +465,11 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__32; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:31:7: ( '!' ) - // InternalProblem.g:31:9: '!' + // InternalProblem.g:30:7: ( ':-' ) + // InternalProblem.g:30:9: ':-' { - match('!'); + match(":-"); + } @@ -507,10 +486,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__33; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:32:7: ( '+' ) - // InternalProblem.g:32:9: '+' + // InternalProblem.g:31:7: ( '!' ) + // InternalProblem.g:31:9: '!' { - match('+'); + match('!'); } @@ -527,10 +506,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__34; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:33:7: ( ':' ) - // InternalProblem.g:33:9: ':' + // InternalProblem.g:32:7: ( '+' ) + // InternalProblem.g:32:9: '+' { - match(':'); + match('+'); } @@ -547,11 +526,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__35; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:34:7: ( 'scope' ) - // InternalProblem.g:34:9: 'scope' + // InternalProblem.g:33:7: ( ':' ) + // InternalProblem.g:33:9: ':' { - match("scope"); - + match(':'); } @@ -568,10 +546,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__36; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:35:7: ( '+=' ) - // InternalProblem.g:35:9: '+=' + // InternalProblem.g:34:7: ( 'scope' ) + // InternalProblem.g:34:9: 'scope' { - match("+="); + match("scope"); } @@ -589,10 +567,11 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__37; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:36:7: ( '=' ) - // InternalProblem.g:36:9: '=' + // InternalProblem.g:35:7: ( '+=' ) + // InternalProblem.g:35:9: '+=' { - match('='); + match("+="); + } @@ -609,11 +588,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__38; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:37:7: ( '..' ) - // InternalProblem.g:37:9: '..' + // InternalProblem.g:36:7: ( '=' ) + // InternalProblem.g:36:9: '=' { - match(".."); - + match('='); } @@ -630,10 +608,11 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__39; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:38:7: ( '*' ) - // InternalProblem.g:38:9: '*' + // InternalProblem.g:37:7: ( '..' ) + // InternalProblem.g:37:9: '..' { - match('*'); + match(".."); + } @@ -650,11 +629,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__40; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:39:7: ( '::' ) - // InternalProblem.g:39:9: '::' + // InternalProblem.g:38:7: ( '*' ) + // InternalProblem.g:38:9: '*' { - match("::"); - + match('*'); } @@ -671,10 +649,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__41; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:40:7: ( 'true' ) - // InternalProblem.g:40:9: 'true' + // InternalProblem.g:39:7: ( '::' ) + // InternalProblem.g:39:9: '::' { - match("true"); + match("::"); } @@ -692,10 +670,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__42; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:41:7: ( 'false' ) - // InternalProblem.g:41:9: 'false' + // InternalProblem.g:40:7: ( 'true' ) + // InternalProblem.g:40:9: 'true' { - match("false"); + match("true"); } @@ -713,10 +691,11 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__43; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:42:7: ( 'e' ) - // InternalProblem.g:42:9: 'e' + // InternalProblem.g:41:7: ( 'false' ) + // InternalProblem.g:41:9: 'false' { - match('e'); + match("false"); + } @@ -733,10 +712,10 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__44; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:43:7: ( 'E' ) - // InternalProblem.g:43:9: 'E' + // InternalProblem.g:42:7: ( '-' ) + // InternalProblem.g:42:9: '-' { - match('E'); + match('-'); } @@ -753,10 +732,11 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__45; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:44:7: ( '-' ) - // InternalProblem.g:44:9: '-' + // InternalProblem.g:43:7: ( 'unknown' ) + // InternalProblem.g:43:9: 'unknown' { - match('-'); + match("unknown"); + } @@ -773,29 +753,8 @@ public class InternalProblemLexer extends Lexer { try { int _type = T__46; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:45:7: ( 'unknown' ) - // InternalProblem.g:45:9: 'unknown' - { - match("unknown"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__46" - - // $ANTLR start "T__47" - public final void mT__47() throws RecognitionException { - try { - int _type = T__47; - int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:46:7: ( '?' ) - // InternalProblem.g:46:9: '?' + // InternalProblem.g:44:7: ( '?' ) + // InternalProblem.g:44:9: '?' { match('?'); @@ -807,15 +766,15 @@ public class InternalProblemLexer extends Lexer { finally { } } - // $ANTLR end "T__47" + // $ANTLR end "T__46" // $ANTLR start "RULE_ID" public final void mRULE_ID() throws RecognitionException { try { int _type = RULE_ID; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:2427:9: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // InternalProblem.g:2427:11: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalProblem.g:2374:9: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) + // InternalProblem.g:2374:11: ( '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(); @@ -826,7 +785,7 @@ public class InternalProblemLexer extends Lexer { recover(mse); throw mse;} - // InternalProblem.g:2427:35: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalProblem.g:2374:35: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* loop1: do { int alt1=2; @@ -870,32 +829,88 @@ public class InternalProblemLexer extends Lexer { } // $ANTLR end "RULE_ID" + // $ANTLR start "RULE_EXPONENTIAL" + public final void mRULE_EXPONENTIAL() throws RecognitionException { + try { + int _type = RULE_EXPONENTIAL; + int _channel = DEFAULT_TOKEN_CHANNEL; + // InternalProblem.g:2376:18: ( RULE_INT ( 'e' | 'E' ) ( '+' | '-' )? RULE_INT ) + // InternalProblem.g:2376:20: RULE_INT ( 'e' | 'E' ) ( '+' | '-' )? RULE_INT + { + mRULE_INT(); + if ( input.LA(1)=='E'||input.LA(1)=='e' ) { + input.consume(); + + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse;} + + // InternalProblem.g:2376:39: ( '+' | '-' )? + int alt2=2; + int LA2_0 = input.LA(1); + + if ( (LA2_0=='+'||LA2_0=='-') ) { + alt2=1; + } + switch (alt2) { + case 1 : + // InternalProblem.g: + { + if ( input.LA(1)=='+'||input.LA(1)=='-' ) { + input.consume(); + + } + else { + MismatchedSetException mse = new MismatchedSetException(null,input); + recover(mse); + throw mse;} + + + } + break; + + } + + mRULE_INT(); + + } + + state.type = _type; + state.channel = _channel; + } + finally { + } + } + // $ANTLR end "RULE_EXPONENTIAL" + // $ANTLR start "RULE_STRING" public final void mRULE_STRING() throws RecognitionException { try { int _type = RULE_STRING; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:2429:13: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' ) - // InternalProblem.g:2429:15: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' + // InternalProblem.g:2378:13: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' ) + // InternalProblem.g:2378:15: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' { match('\"'); - // InternalProblem.g:2429:19: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* - loop2: + // InternalProblem.g:2378:19: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* + loop3: do { - int alt2=3; - int LA2_0 = input.LA(1); + int alt3=3; + int LA3_0 = input.LA(1); - if ( (LA2_0=='\\') ) { - alt2=1; + if ( (LA3_0=='\\') ) { + alt3=1; } - else if ( ((LA2_0>='\u0000' && LA2_0<='!')||(LA2_0>='#' && LA2_0<='[')||(LA2_0>=']' && LA2_0<='\uFFFF')) ) { - alt2=2; + else if ( ((LA3_0>='\u0000' && LA3_0<='!')||(LA3_0>='#' && LA3_0<='[')||(LA3_0>=']' && LA3_0<='\uFFFF')) ) { + alt3=2; } - switch (alt2) { + switch (alt3) { case 1 : - // InternalProblem.g:2429:20: '\\\\' . + // InternalProblem.g:2378:20: '\\\\' . { match('\\'); matchAny(); @@ -903,7 +918,7 @@ public class InternalProblemLexer extends Lexer { } break; case 2 : - // InternalProblem.g:2429:27: ~ ( ( '\\\\' | '\"' ) ) + // InternalProblem.g:2378:27: ~ ( ( '\\\\' | '\"' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -919,7 +934,7 @@ public class InternalProblemLexer extends Lexer { break; default : - break loop2; + break loop3; } } while (true); @@ -940,27 +955,27 @@ public class InternalProblemLexer extends Lexer { try { int _type = RULE_QUOTED_ID; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:2431:16: ( '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) - // InternalProblem.g:2431:18: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' + // InternalProblem.g:2380:16: ( '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalProblem.g:2380:18: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' { match('\''); - // InternalProblem.g:2431:23: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* - loop3: + // InternalProblem.g:2380:23: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* + loop4: do { - int alt3=3; - int LA3_0 = input.LA(1); + int alt4=3; + int LA4_0 = input.LA(1); - if ( (LA3_0=='\\') ) { - alt3=1; + if ( (LA4_0=='\\') ) { + alt4=1; } - else if ( ((LA3_0>='\u0000' && LA3_0<='&')||(LA3_0>='(' && LA3_0<='[')||(LA3_0>=']' && LA3_0<='\uFFFF')) ) { - alt3=2; + else if ( ((LA4_0>='\u0000' && LA4_0<='&')||(LA4_0>='(' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) { + alt4=2; } - switch (alt3) { + switch (alt4) { case 1 : - // InternalProblem.g:2431:24: '\\\\' . + // InternalProblem.g:2380:24: '\\\\' . { match('\\'); matchAny(); @@ -968,7 +983,7 @@ public class InternalProblemLexer extends Lexer { } break; case 2 : - // InternalProblem.g:2431:31: ~ ( ( '\\\\' | '\\'' ) ) + // InternalProblem.g:2380:31: ~ ( ( '\\\\' | '\\'' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -984,7 +999,7 @@ public class InternalProblemLexer extends Lexer { break; default : - break loop3; + break loop4; } } while (true); @@ -1005,35 +1020,35 @@ public class InternalProblemLexer extends Lexer { try { int _type = RULE_SL_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:2433:17: ( ( '%' | '//' ) (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // InternalProblem.g:2433:19: ( '%' | '//' ) (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? + // InternalProblem.g:2382:17: ( ( '%' | '//' ) (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) + // InternalProblem.g:2382:19: ( '%' | '//' ) (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? { - // InternalProblem.g:2433:19: ( '%' | '//' ) - int alt4=2; - int LA4_0 = input.LA(1); + // InternalProblem.g:2382:19: ( '%' | '//' ) + int alt5=2; + int LA5_0 = input.LA(1); - if ( (LA4_0=='%') ) { - alt4=1; + if ( (LA5_0=='%') ) { + alt5=1; } - else if ( (LA4_0=='/') ) { - alt4=2; + else if ( (LA5_0=='/') ) { + alt5=2; } else { NoViableAltException nvae = - new NoViableAltException("", 4, 0, input); + new NoViableAltException("", 5, 0, input); throw nvae; } - switch (alt4) { + switch (alt5) { case 1 : - // InternalProblem.g:2433:20: '%' + // InternalProblem.g:2382:20: '%' { match('%'); } break; case 2 : - // InternalProblem.g:2433:24: '//' + // InternalProblem.g:2382:24: '//' { match("//"); @@ -1043,20 +1058,20 @@ public class InternalProblemLexer extends Lexer { } - // InternalProblem.g:2433:30: (~ ( ( '\\n' | '\\r' ) ) )* - loop5: + // InternalProblem.g:2382:30: (~ ( ( '\\n' | '\\r' ) ) )* + loop6: do { - int alt5=2; - int LA5_0 = input.LA(1); + int alt6=2; + int LA6_0 = input.LA(1); - if ( ((LA5_0>='\u0000' && LA5_0<='\t')||(LA5_0>='\u000B' && LA5_0<='\f')||(LA5_0>='\u000E' && LA5_0<='\uFFFF')) ) { - alt5=1; + if ( ((LA6_0>='\u0000' && LA6_0<='\t')||(LA6_0>='\u000B' && LA6_0<='\f')||(LA6_0>='\u000E' && LA6_0<='\uFFFF')) ) { + alt6=1; } - switch (alt5) { + switch (alt6) { case 1 : - // InternalProblem.g:2433:30: ~ ( ( '\\n' | '\\r' ) ) + // InternalProblem.g:2382:30: ~ ( ( '\\n' | '\\r' ) ) { 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(); @@ -1072,31 +1087,31 @@ public class InternalProblemLexer extends Lexer { break; default : - break loop5; + break loop6; } } while (true); - // InternalProblem.g:2433:46: ( ( '\\r' )? '\\n' )? - int alt7=2; - int LA7_0 = input.LA(1); + // InternalProblem.g:2382:46: ( ( '\\r' )? '\\n' )? + int alt8=2; + int LA8_0 = input.LA(1); - if ( (LA7_0=='\n'||LA7_0=='\r') ) { - alt7=1; + if ( (LA8_0=='\n'||LA8_0=='\r') ) { + alt8=1; } - switch (alt7) { + switch (alt8) { case 1 : - // InternalProblem.g:2433:47: ( '\\r' )? '\\n' + // InternalProblem.g:2382:47: ( '\\r' )? '\\n' { - // InternalProblem.g:2433:47: ( '\\r' )? - int alt6=2; - int LA6_0 = input.LA(1); + // InternalProblem.g:2382:47: ( '\\r' )? + int alt7=2; + int LA7_0 = input.LA(1); - if ( (LA6_0=='\r') ) { - alt6=1; + if ( (LA7_0=='\r') ) { + alt7=1; } - switch (alt6) { + switch (alt7) { case 1 : - // InternalProblem.g:2433:47: '\\r' + // InternalProblem.g:2382:47: '\\r' { match('\r'); @@ -1128,24 +1143,24 @@ public class InternalProblemLexer extends Lexer { try { int _type = RULE_INT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:2435:10: ( ( '0' .. '9' )+ ) - // InternalProblem.g:2435:12: ( '0' .. '9' )+ + // InternalProblem.g:2384:10: ( ( '0' .. '9' )+ ) + // InternalProblem.g:2384:12: ( '0' .. '9' )+ { - // InternalProblem.g:2435:12: ( '0' .. '9' )+ - int cnt8=0; - loop8: + // InternalProblem.g:2384:12: ( '0' .. '9' )+ + int cnt9=0; + loop9: do { - int alt8=2; - int LA8_0 = input.LA(1); + int alt9=2; + int LA9_0 = input.LA(1); - if ( ((LA8_0>='0' && LA8_0<='9')) ) { - alt8=1; + if ( ((LA9_0>='0' && LA9_0<='9')) ) { + alt9=1; } - switch (alt8) { + switch (alt9) { case 1 : - // InternalProblem.g:2435:13: '0' .. '9' + // InternalProblem.g:2384:13: '0' .. '9' { matchRange('0','9'); @@ -1153,12 +1168,12 @@ public class InternalProblemLexer extends Lexer { break; default : - if ( cnt8 >= 1 ) break loop8; + if ( cnt9 >= 1 ) break loop9; EarlyExitException eee = - new EarlyExitException(8, input); + new EarlyExitException(9, input); throw eee; } - cnt8++; + cnt9++; } while (true); @@ -1177,37 +1192,37 @@ public class InternalProblemLexer extends Lexer { try { int _type = RULE_ML_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:2437:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // InternalProblem.g:2437:19: '/*' ( options {greedy=false; } : . )* '*/' + // InternalProblem.g:2386:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) + // InternalProblem.g:2386:19: '/*' ( options {greedy=false; } : . )* '*/' { match("/*"); - // InternalProblem.g:2437:24: ( options {greedy=false; } : . )* - loop9: + // InternalProblem.g:2386:24: ( options {greedy=false; } : . )* + loop10: do { - int alt9=2; - int LA9_0 = input.LA(1); + int alt10=2; + int LA10_0 = input.LA(1); - if ( (LA9_0=='*') ) { - int LA9_1 = input.LA(2); + if ( (LA10_0=='*') ) { + int LA10_1 = input.LA(2); - if ( (LA9_1=='/') ) { - alt9=2; + if ( (LA10_1=='/') ) { + alt10=2; } - else if ( ((LA9_1>='\u0000' && LA9_1<='.')||(LA9_1>='0' && LA9_1<='\uFFFF')) ) { - alt9=1; + else if ( ((LA10_1>='\u0000' && LA10_1<='.')||(LA10_1>='0' && LA10_1<='\uFFFF')) ) { + alt10=1; } } - else if ( ((LA9_0>='\u0000' && LA9_0<=')')||(LA9_0>='+' && LA9_0<='\uFFFF')) ) { - alt9=1; + else if ( ((LA10_0>='\u0000' && LA10_0<=')')||(LA10_0>='+' && LA10_0<='\uFFFF')) ) { + alt10=1; } - switch (alt9) { + switch (alt10) { case 1 : - // InternalProblem.g:2437:52: . + // InternalProblem.g:2386:52: . { matchAny(); @@ -1215,7 +1230,7 @@ public class InternalProblemLexer extends Lexer { break; default : - break loop9; + break loop10; } } while (true); @@ -1237,22 +1252,22 @@ public class InternalProblemLexer extends Lexer { try { int _type = RULE_WS; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:2439:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) - // InternalProblem.g:2439:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalProblem.g:2388:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) + // InternalProblem.g:2388:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ { - // InternalProblem.g:2439:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ - int cnt10=0; - loop10: + // InternalProblem.g:2388:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + 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: { @@ -1270,12 +1285,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); @@ -1294,8 +1309,8 @@ public class InternalProblemLexer extends Lexer { try { int _type = RULE_ANY_OTHER; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalProblem.g:2441:16: ( . ) - // InternalProblem.g:2441:18: . + // InternalProblem.g:2390:16: ( . ) + // InternalProblem.g:2390:18: . { matchAny(); @@ -1310,313 +1325,306 @@ 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 | T__44 | T__45 | T__46 | T__47 | RULE_ID | RULE_STRING | RULE_QUOTED_ID | RULE_SL_COMMENT | RULE_INT | RULE_ML_COMMENT | RULE_WS | RULE_ANY_OTHER ) - int alt11=44; - alt11 = dfa11.predict(input); - switch (alt11) { + // InternalProblem.g:1:8: ( 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 | T__45 | T__46 | RULE_ID | RULE_EXPONENTIAL | RULE_STRING | RULE_QUOTED_ID | RULE_SL_COMMENT | RULE_INT | RULE_ML_COMMENT | RULE_WS | RULE_ANY_OTHER ) + int alt12=43; + alt12 = dfa12.predict(input); + switch (alt12) { case 1 : - // InternalProblem.g:1:10: T__12 + // InternalProblem.g:1:10: T__13 { - mT__12(); + mT__13(); } break; case 2 : - // InternalProblem.g:1:16: T__13 + // InternalProblem.g:1:16: T__14 { - mT__13(); + mT__14(); } break; case 3 : - // InternalProblem.g:1:22: T__14 + // InternalProblem.g:1:22: T__15 { - mT__14(); + mT__15(); } break; case 4 : - // InternalProblem.g:1:28: T__15 + // InternalProblem.g:1:28: T__16 { - mT__15(); + mT__16(); } break; case 5 : - // InternalProblem.g:1:34: T__16 + // InternalProblem.g:1:34: T__17 { - mT__16(); + mT__17(); } break; case 6 : - // InternalProblem.g:1:40: T__17 + // InternalProblem.g:1:40: T__18 { - mT__17(); + mT__18(); } break; case 7 : - // InternalProblem.g:1:46: T__18 + // InternalProblem.g:1:46: T__19 { - mT__18(); + mT__19(); } break; case 8 : - // InternalProblem.g:1:52: T__19 + // InternalProblem.g:1:52: T__20 { - mT__19(); + mT__20(); } break; case 9 : - // InternalProblem.g:1:58: T__20 + // InternalProblem.g:1:58: T__21 { - mT__20(); + mT__21(); } break; case 10 : - // InternalProblem.g:1:64: T__21 + // InternalProblem.g:1:64: T__22 { - mT__21(); + mT__22(); } break; case 11 : - // InternalProblem.g:1:70: T__22 + // InternalProblem.g:1:70: T__23 { - mT__22(); + mT__23(); } break; case 12 : - // InternalProblem.g:1:76: T__23 + // InternalProblem.g:1:76: T__24 { - mT__23(); + mT__24(); } break; case 13 : - // InternalProblem.g:1:82: T__24 + // InternalProblem.g:1:82: T__25 { - mT__24(); + mT__25(); } break; case 14 : - // InternalProblem.g:1:88: T__25 + // InternalProblem.g:1:88: T__26 { - mT__25(); + mT__26(); } break; case 15 : - // InternalProblem.g:1:94: T__26 + // InternalProblem.g:1:94: T__27 { - mT__26(); + mT__27(); } break; case 16 : - // InternalProblem.g:1:100: T__27 + // InternalProblem.g:1:100: T__28 { - mT__27(); + mT__28(); } break; case 17 : - // InternalProblem.g:1:106: T__28 + // InternalProblem.g:1:106: T__29 { - mT__28(); + mT__29(); } break; case 18 : - // InternalProblem.g:1:112: T__29 + // InternalProblem.g:1:112: T__30 { - mT__29(); + mT__30(); } break; case 19 : - // InternalProblem.g:1:118: T__30 + // InternalProblem.g:1:118: T__31 { - mT__30(); + mT__31(); } break; case 20 : - // InternalProblem.g:1:124: T__31 + // InternalProblem.g:1:124: T__32 { - mT__31(); + mT__32(); } break; case 21 : - // InternalProblem.g:1:130: T__32 + // InternalProblem.g:1:130: T__33 { - mT__32(); + mT__33(); } break; case 22 : - // InternalProblem.g:1:136: T__33 + // InternalProblem.g:1:136: T__34 { - mT__33(); + mT__34(); } break; case 23 : - // InternalProblem.g:1:142: T__34 + // InternalProblem.g:1:142: T__35 { - mT__34(); + mT__35(); } break; case 24 : - // InternalProblem.g:1:148: T__35 + // InternalProblem.g:1:148: T__36 { - mT__35(); + mT__36(); } break; case 25 : - // InternalProblem.g:1:154: T__36 + // InternalProblem.g:1:154: T__37 { - mT__36(); + mT__37(); } break; case 26 : - // InternalProblem.g:1:160: T__37 + // InternalProblem.g:1:160: T__38 { - mT__37(); + mT__38(); } break; case 27 : - // InternalProblem.g:1:166: T__38 + // InternalProblem.g:1:166: T__39 { - mT__38(); + mT__39(); } break; case 28 : - // InternalProblem.g:1:172: T__39 + // InternalProblem.g:1:172: T__40 { - mT__39(); + mT__40(); } break; case 29 : - // InternalProblem.g:1:178: T__40 + // InternalProblem.g:1:178: T__41 { - mT__40(); + mT__41(); } break; case 30 : - // InternalProblem.g:1:184: T__41 + // InternalProblem.g:1:184: T__42 { - mT__41(); + mT__42(); } break; case 31 : - // InternalProblem.g:1:190: T__42 + // InternalProblem.g:1:190: T__43 { - mT__42(); + mT__43(); } break; case 32 : - // InternalProblem.g:1:196: T__43 + // InternalProblem.g:1:196: T__44 { - mT__43(); + mT__44(); } break; case 33 : - // InternalProblem.g:1:202: T__44 + // InternalProblem.g:1:202: T__45 { - mT__44(); + mT__45(); } break; case 34 : - // InternalProblem.g:1:208: T__45 + // InternalProblem.g:1:208: T__46 { - mT__45(); + mT__46(); } break; case 35 : - // InternalProblem.g:1:214: T__46 + // InternalProblem.g:1:214: RULE_ID { - mT__46(); + mRULE_ID(); } break; case 36 : - // InternalProblem.g:1:220: T__47 + // InternalProblem.g:1:222: RULE_EXPONENTIAL { - mT__47(); + mRULE_EXPONENTIAL(); } break; case 37 : - // InternalProblem.g:1:226: RULE_ID - { - mRULE_ID(); - - } - break; - case 38 : - // InternalProblem.g:1:234: RULE_STRING + // InternalProblem.g:1:239: RULE_STRING { mRULE_STRING(); } break; - case 39 : - // InternalProblem.g:1:246: RULE_QUOTED_ID + case 38 : + // InternalProblem.g:1:251: RULE_QUOTED_ID { mRULE_QUOTED_ID(); } break; - case 40 : - // InternalProblem.g:1:261: RULE_SL_COMMENT + case 39 : + // InternalProblem.g:1:266: RULE_SL_COMMENT { mRULE_SL_COMMENT(); } break; - case 41 : - // InternalProblem.g:1:277: RULE_INT + case 40 : + // InternalProblem.g:1:282: RULE_INT { mRULE_INT(); } break; - case 42 : - // InternalProblem.g:1:286: RULE_ML_COMMENT + case 41 : + // InternalProblem.g:1:291: RULE_ML_COMMENT { mRULE_ML_COMMENT(); } break; - case 43 : - // InternalProblem.g:1:302: RULE_WS + case 42 : + // InternalProblem.g:1:307: RULE_WS { mRULE_WS(); } break; - case 44 : - // InternalProblem.g:1:310: RULE_ANY_OTHER + case 43 : + // InternalProblem.g:1:315: RULE_ANY_OTHER { mRULE_ANY_OTHER(); @@ -1628,98 +1636,98 @@ public class InternalProblemLexer extends Lexer { } - protected DFA11 dfa11 = new DFA11(this); - static final String DFA11_eotS = - "\1\uffff\1\45\1\47\2\45\1\56\4\uffff\1\45\2\uffff\1\45\2\uffff\1\73\1\uffff\1\76\1\45\2\uffff\2\45\1\104\1\uffff\1\45\2\uffff\2\43\1\uffff\1\43\3\uffff\1\45\3\uffff\6\45\5\uffff\1\45\2\uffff\1\45\10\uffff\1\45\2\uffff\2\45\2\uffff\1\45\7\uffff\17\45\1\153\4\45\1\160\4\45\1\165\3\45\1\uffff\1\45\1\172\2\45\1\uffff\1\175\2\45\1\u0080\1\uffff\1\u0081\3\45\1\uffff\2\45\1\uffff\1\u0087\1\45\2\uffff\1\45\1\u008a\2\45\1\u008d\1\uffff\1\45\1\u008f\1\uffff\1\u0090\1\u0091\1\uffff\1\u0092\4\uffff"; - static final String DFA11_eofS = - "\u0093\uffff"; - static final String DFA11_minS = - "\1\0\1\162\1\56\1\142\1\154\1\60\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\60\1\uffff\1\156\2\uffff\2\0\1\uffff\1\52\3\uffff\1\145\3\uffff\1\163\1\141\1\156\1\164\1\165\1\162\5\uffff\1\146\2\uffff\1\160\10\uffff\1\157\2\uffff\1\165\1\154\2\uffff\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\172\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\172\1\uffff\1\156\2\uffff\2\uffff\1\uffff\1\57\3\uffff\1\157\3\uffff\1\163\1\141\1\156\1\164\1\165\1\162\5\uffff\1\146\2\uffff\1\160\10\uffff\1\157\2\uffff\1\165\1\154\2\uffff\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\42\1\uffff\1\44\1\45\2\uffff\1\50\1\uffff\1\51\1\53\1\54\1\uffff\1\45\1\33\1\2\6\uffff\1\40\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\2\uffff\1\41\1\42\1\uffff\1\44\1\46\1\47\1\50\1\52\1\51\1\53\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\43\1\3\1\13\1\17"; - static final String DFA11_specialS = - "\1\1\34\uffff\1\2\1\0\164\uffff}>"; - static final String[] DFA11_transitionS = { - "\11\43\2\42\2\43\1\42\22\43\1\42\1\21\1\35\2\43\1\37\1\43\1\36\1\16\1\17\1\25\1\22\1\6\1\31\1\2\1\40\12\41\1\20\1\10\1\43\1\24\1\43\1\33\1\43\4\34\1\30\25\34\1\13\1\43\1\14\1\43\1\34\1\43\1\3\1\34\1\4\1\34\1\5\1\27\10\34\1\15\1\1\1\34\1\12\1\23\1\26\1\32\5\34\1\7\1\43\1\11\uff82\43", - "\1\44", - "\1\46", - "\1\50", - "\1\51\2\uffff\1\52", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\15\45\1\54\3\45\1\55\5\45\1\53\2\45", + 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\2\44\1\uffff\1\44\2\uffff\1\105\2\42\1\uffff\1\42\2\uffff\1\44\3\uffff\6\44\4\uffff\1\44\2\uffff\1\44\10\uffff\1\44\2\uffff\2\44\1\uffff\1\44\2\uffff\1\105\6\uffff\17\44\1\152\4\44\1\157\4\44\1\164\3\44\1\uffff\1\44\1\171\2\44\1\uffff\1\174\2\44\1\177\1\uffff\1\u0080\3\44\1\uffff\2\44\1\uffff\1\u0086\1\44\2\uffff\1\44\1\u0089\2\44\1\u008c\1\uffff\1\44\1\u008e\1\uffff\1\u008f\1\u0090\1\uffff\1\u0091\4\uffff"; + static final String DFA12_eofS = + "\u0092\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\uffff\1\156\2\uffff\1\60\2\0\1\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\10\uffff\1\157\2\uffff\1\165\1\154\1\uffff\1\153\2\uffff\1\60\6\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\uffff\1\156\2\uffff\1\145\2\uffff\1\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\10\uffff\1\157\2\uffff\1\165\1\154\1\uffff\1\153\2\uffff\1\145\6\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\2\uffff\1\40\1\uffff\1\42\1\43\3\uffff\1\47\1\uffff\1\52\1\53\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\35\1\27\1\25\1\31\1\26\1\uffff\1\32\1\34\2\uffff\1\40\1\uffff\1\42\1\50\1\uffff\1\44\1\45\1\46\1\47\1\51\1\52\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\41\1\3\1\13\1\17"; + static final String DFA12_specialS = + "\1\2\34\uffff\1\0\1\1\163\uffff}>"; + static final String[] DFA12_transitionS = { + "\11\42\2\41\2\42\1\41\22\42\1\41\1\21\1\35\2\42\1\37\1\42\1\36\1\16\1\17\1\25\1\22\1\6\1\30\1\2\1\40\12\34\1\20\1\10\1\42\1\24\1\42\1\32\1\42\32\33\1\13\1\42\1\14\1\42\1\33\1\42\1\3\1\33\1\4\1\33\1\5\1\27\10\33\1\15\1\1\1\33\1\12\1\23\1\26\1\31\5\33\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\63", + "\1\61", "", "", - "\1\66", + "\1\64", "", "", - "\1\71\14\uffff\1\72", + "\1\67\14\uffff\1\70", "", + "\1\73", "\1\75", - "\1\77", "", "", - "\1\102", - "\1\103", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\1\100", + "\1\101", "", - "\1\106", + "\1\103", "", "", + "\12\106\13\uffff\1\107\37\uffff\1\107", "\0\110", "\0\111", "", "\1\113\4\uffff\1\112", "", "", - "", - "\1\117\11\uffff\1\116", + "\1\116\11\uffff\1\115", "", "", "", + "\1\117", "\1\120", "\1\121", "\1\122", "\1\123", "\1\124", - "\1\125", "", "", "", "", + "\1\125", + "", "", "\1\126", "", "", - "\1\127", "", "", "", "", "", "", + "\1\127", "", "", "\1\130", - "", - "", "\1\131", - "\1\132", "", + "\1\132", "", - "\1\133", "", + "\12\106\13\uffff\1\107\37\uffff\1\107", "", "", "", "", "", "", + "\1\133", "\1\134", "\1\135", "\1\136", @@ -1734,198 +1742,195 @@ public class InternalProblemLexer extends Lexer { "\1\147", "\1\150", "\1\151", - "\1\152", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\153", "\1\154", "\1\155", "\1\156", - "\1\157", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\160", "\1\161", "\1\162", "\1\163", - "\1\164", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\165", "\1\166", "\1\167", - "\1\170", "", - "\1\171", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\1\170", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\172", "\1\173", - "\1\174", "", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\175", "\1\176", - "\1\177", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", "", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\u0081", "\1\u0082", "\1\u0083", - "\1\u0084", "", + "\1\u0084", "\1\u0085", - "\1\u0086", "", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", - "\1\u0088", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\u0087", "", "", - "\1\u0089", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\1\u0088", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", + "\1\u008a", "\1\u008b", - "\1\u008c", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", "", - "\1\u008e", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\1\u008d", + "\12\44\7\uffff\32\44\4\uffff\1\44\1\uffff\32\44", "", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", - "\12\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\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\45\7\uffff\32\45\4\uffff\1\45\1\uffff\32\45", + "\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_30<='\uFFFF')) ) {s = 73;} + if ( ((LA12_29>='\u0000' && LA12_29<='\uFFFF')) ) {s = 72;} - else s = 35; + else s = 34; if ( s>=0 ) return s; break; case 1 : - int LA11_0 = input.LA(1); + int LA12_30 = input.LA(1); s = -1; - if ( (LA11_0=='p') ) {s = 1;} + if ( ((LA12_30>='\u0000' && LA12_30<='\uFFFF')) ) {s = 73;} - else if ( (LA11_0=='.') ) {s = 2;} + else s = 34; - else if ( (LA11_0=='a') ) {s = 3;} - - else if ( (LA11_0=='c') ) {s = 4;} + if ( s>=0 ) return s; + break; + case 2 : + int LA12_0 = input.LA(1); - else if ( (LA11_0=='e') ) {s = 5;} + s = -1; + if ( (LA12_0=='p') ) {s = 1;} - else if ( (LA11_0==',') ) {s = 6;} + else if ( (LA12_0=='.') ) {s = 2;} - else if ( (LA11_0=='{') ) {s = 7;} + else if ( (LA12_0=='a') ) {s = 3;} - else if ( (LA11_0==';') ) {s = 8;} + else if ( (LA12_0=='c') ) {s = 4;} - else if ( (LA11_0=='}') ) {s = 9;} + else if ( (LA12_0=='e') ) {s = 5;} - else if ( (LA11_0=='r') ) {s = 10;} + else if ( (LA12_0==',') ) {s = 6;} - else if ( (LA11_0=='[') ) {s = 11;} + else if ( (LA12_0=='{') ) {s = 7;} - else if ( (LA11_0==']') ) {s = 12;} + else if ( (LA12_0==';') ) {s = 8;} - else if ( (LA11_0=='o') ) {s = 13;} + else if ( (LA12_0=='}') ) {s = 9;} - else if ( (LA11_0=='(') ) {s = 14;} + else if ( (LA12_0=='r') ) {s = 10;} - else if ( (LA11_0==')') ) {s = 15;} + else if ( (LA12_0=='[') ) {s = 11;} - else if ( (LA11_0==':') ) {s = 16;} + else if ( (LA12_0==']') ) {s = 12;} - else if ( (LA11_0=='!') ) {s = 17;} + else if ( (LA12_0=='o') ) {s = 13;} - else if ( (LA11_0=='+') ) {s = 18;} + else if ( (LA12_0=='(') ) {s = 14;} - else if ( (LA11_0=='s') ) {s = 19;} + else if ( (LA12_0==')') ) {s = 15;} - else if ( (LA11_0=='=') ) {s = 20;} + else if ( (LA12_0==':') ) {s = 16;} - else if ( (LA11_0=='*') ) {s = 21;} + else if ( (LA12_0=='!') ) {s = 17;} - else if ( (LA11_0=='t') ) {s = 22;} + else if ( (LA12_0=='+') ) {s = 18;} - else if ( (LA11_0=='f') ) {s = 23;} + else if ( (LA12_0=='s') ) {s = 19;} - else if ( (LA11_0=='E') ) {s = 24;} + else if ( (LA12_0=='=') ) {s = 20;} - else if ( (LA11_0=='-') ) {s = 25;} + else if ( (LA12_0=='*') ) {s = 21;} - else if ( (LA11_0=='u') ) {s = 26;} + else if ( (LA12_0=='t') ) {s = 22;} - else if ( (LA11_0=='?') ) {s = 27;} + else if ( (LA12_0=='f') ) {s = 23;} - else if ( ((LA11_0>='A' && LA11_0<='D')||(LA11_0>='F' && 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 = 28;} + else if ( (LA12_0=='-') ) {s = 24;} - else if ( (LA11_0=='\"') ) {s = 29;} + else if ( (LA12_0=='u') ) {s = 25;} - else if ( (LA11_0=='\'') ) {s = 30;} + else if ( (LA12_0=='?') ) {s = 26;} - else if ( (LA11_0=='%') ) {s = 31;} + 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 = 27;} - else if ( (LA11_0=='/') ) {s = 32;} + else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 28;} - else if ( ((LA11_0>='0' && LA11_0<='9')) ) {s = 33;} + else if ( (LA12_0=='\"') ) {s = 29;} - else if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {s = 34;} + else if ( (LA12_0=='\'') ) {s = 30;} - 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>='~' && LA11_0<='\uFFFF')) ) {s = 35;} + else if ( (LA12_0=='%') ) {s = 31;} - if ( s>=0 ) return s; - break; - case 2 : - int LA11_29 = input.LA(1); + else if ( (LA12_0=='/') ) {s = 32;} - s = -1; - if ( ((LA11_29>='\u0000' && LA11_29<='\uFFFF')) ) {s = 72;} + else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 33;} - else s = 35; + 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;} 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 f0a69c90..cddaa9c1 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,16 +22,16 @@ import java.util.ArrayList; @SuppressWarnings("all") public class InternalProblemParser extends AbstractInternalAntlrParser { public static final String[] tokenNames = new String[] { - "", "", "", "", "RULE_STRING", "RULE_ID", "RULE_INT", "RULE_QUOTED_ID", "RULE_SL_COMMENT", "RULE_ML_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'problem'", "'.'", "'abstract'", "'class'", "'extends'", "','", "'{'", "';'", "'}'", "'enum'", "'contains'", "'refers'", "'['", "']'", "'opposite'", "'error'", "'pred'", "'('", "')'", "':-'", "'!'", "'+'", "':'", "'scope'", "'+='", "'='", "'..'", "'*'", "'::'", "'true'", "'false'", "'e'", "'E'", "'-'", "'unknown'", "'?'" + "", "", "", "", "RULE_STRING", "RULE_ID", "RULE_INT", "RULE_QUOTED_ID", "RULE_EXPONENTIAL", "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; public static final int T__16=16; public static final int T__17=17; public static final int T__18=18; - public static final int T__12=12; public static final int T__13=13; public static final int T__14=14; + public static final int RULE_EXPONENTIAL=8; public static final int RULE_ID=5; public static final int RULE_QUOTED_ID=7; public static final int T__26=26; @@ -40,14 +40,14 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { public static final int RULE_INT=6; public static final int T__29=29; public static final int T__22=22; - public static final int RULE_ML_COMMENT=9; + public static final int RULE_ML_COMMENT=10; 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=4; - public static final int RULE_SL_COMMENT=8; + public static final int RULE_SL_COMMENT=9; public static final int T__37=37; public static final int T__38=38; public static final int T__39=39; @@ -59,12 +59,11 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { public static final int T__30=30; public static final int T__31=31; 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 RULE_WS=11; + public static final int RULE_ANY_OTHER=12; public static final int T__44=44; public static final int T__45=45; public static final int T__46=46; - public static final int T__47=47; public static final int T__40=40; public static final int T__41=41; public static final int T__42=42; @@ -171,14 +170,14 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt1=2; int LA1_0 = input.LA(1); - if ( (LA1_0==12) ) { + if ( (LA1_0==13) ) { alt1=1; } switch (alt1) { case 1 : // InternalProblem.g:81:4: otherlv_0= 'problem' ( (lv_name_1_0= ruleIdentifier ) ) otherlv_2= '.' { - otherlv_0=(Token)match(input,12,FOLLOW_3); + otherlv_0=(Token)match(input,13,FOLLOW_3); newLeafNode(otherlv_0, grammarAccess.getProblemAccess().getProblemKeyword_0_0()); @@ -213,7 +212,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_2=(Token)match(input,13,FOLLOW_5); + otherlv_2=(Token)match(input,14,FOLLOW_5); newLeafNode(otherlv_2, grammarAccess.getProblemAccess().getFullStopKeyword_0_2()); @@ -229,7 +228,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>=41 && LA2_0<=44)||LA2_0==47) ) { + if ( (LA2_0==RULE_ID||LA2_0==RULE_QUOTED_ID||(LA2_0>=15 && LA2_0<=16)||LA2_0==22||(LA2_0>=28 && LA2_0<=29)||LA2_0==33||LA2_0==36||(LA2_0>=42 && LA2_0<=43)||LA2_0==46) ) { alt2=1; } @@ -557,7 +556,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt4=2; int LA4_0 = input.LA(1); - if ( (LA4_0==14) ) { + if ( (LA4_0==15) ) { alt4=1; } switch (alt4) { @@ -567,7 +566,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:220:4: (lv_abstract_0_0= 'abstract' ) // InternalProblem.g:221:5: lv_abstract_0_0= 'abstract' { - lv_abstract_0_0=(Token)match(input,14,FOLLOW_6); + lv_abstract_0_0=(Token)match(input,15,FOLLOW_6); newLeafNode(lv_abstract_0_0, grammarAccess.getClassDeclarationAccess().getAbstractAbstractKeyword_0_0()); @@ -586,7 +585,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_1=(Token)match(input,15,FOLLOW_3); + otherlv_1=(Token)match(input,16,FOLLOW_3); newLeafNode(otherlv_1, grammarAccess.getClassDeclarationAccess().getClassKeyword_1()); @@ -625,14 +624,14 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt6=2; int LA6_0 = input.LA(1); - if ( (LA6_0==16) ) { + if ( (LA6_0==17) ) { alt6=1; } switch (alt6) { case 1 : // InternalProblem.g:257:4: otherlv_3= 'extends' ( ( ruleQualifiedName ) ) (otherlv_5= ',' ( ( ruleQualifiedName ) ) )* { - otherlv_3=(Token)match(input,16,FOLLOW_8); + otherlv_3=(Token)match(input,17,FOLLOW_8); newLeafNode(otherlv_3, grammarAccess.getClassDeclarationAccess().getExtendsKeyword_3_0()); @@ -670,7 +669,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt5=2; int LA5_0 = input.LA(1); - if ( (LA5_0==17) ) { + if ( (LA5_0==18) ) { alt5=1; } @@ -679,7 +678,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 1 : // InternalProblem.g:278:5: otherlv_5= ',' ( ( ruleQualifiedName ) ) { - otherlv_5=(Token)match(input,17,FOLLOW_8); + otherlv_5=(Token)match(input,18,FOLLOW_8); newLeafNode(otherlv_5, grammarAccess.getClassDeclarationAccess().getCommaKeyword_3_2_0()); @@ -730,10 +729,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt9=2; int LA9_0 = input.LA(1); - if ( (LA9_0==18) ) { + if ( (LA9_0==19) ) { alt9=1; } - else if ( (LA9_0==13) ) { + else if ( (LA9_0==14) ) { alt9=2; } else { @@ -749,7 +748,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:301:4: (otherlv_7= '{' ( ( (lv_referenceDeclarations_8_0= ruleReferenceDeclaration ) ) (otherlv_9= ';' )? )* otherlv_10= '}' ) // InternalProblem.g:302:5: otherlv_7= '{' ( ( (lv_referenceDeclarations_8_0= ruleReferenceDeclaration ) ) (otherlv_9= ';' )? )* otherlv_10= '}' { - otherlv_7=(Token)match(input,18,FOLLOW_10); + otherlv_7=(Token)match(input,19,FOLLOW_10); newLeafNode(otherlv_7, grammarAccess.getClassDeclarationAccess().getLeftCurlyBracketKeyword_4_0_0()); @@ -759,7 +758,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>=41 && LA8_0<=44)) ) { + if ( (LA8_0==RULE_ID||LA8_0==RULE_QUOTED_ID||(LA8_0>=23 && LA8_0<=24)||(LA8_0>=42 && LA8_0<=43)) ) { alt8=1; } @@ -803,14 +802,14 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt7=2; int LA7_0 = input.LA(1); - if ( (LA7_0==19) ) { + if ( (LA7_0==20) ) { alt7=1; } switch (alt7) { case 1 : // InternalProblem.g:327:7: otherlv_9= ';' { - otherlv_9=(Token)match(input,19,FOLLOW_10); + otherlv_9=(Token)match(input,20,FOLLOW_10); newLeafNode(otherlv_9, grammarAccess.getClassDeclarationAccess().getSemicolonKeyword_4_0_1_1()); @@ -829,7 +828,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } } while (true); - otherlv_10=(Token)match(input,20,FOLLOW_2); + otherlv_10=(Token)match(input,21,FOLLOW_2); newLeafNode(otherlv_10, grammarAccess.getClassDeclarationAccess().getRightCurlyBracketKeyword_4_0_2()); @@ -842,7 +841,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 2 : // InternalProblem.g:339:4: otherlv_11= '.' { - otherlv_11=(Token)match(input,13,FOLLOW_2); + otherlv_11=(Token)match(input,14,FOLLOW_2); newLeafNode(otherlv_11, grammarAccess.getClassDeclarationAccess().getFullStopKeyword_4_1()); @@ -939,7 +938,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:362:2: (otherlv_0= 'enum' ( (lv_name_1_0= ruleIdentifier ) ) ( (otherlv_2= '{' ( ( (lv_literals_3_0= ruleEnumLiteral ) ) (otherlv_4= ',' ( (lv_literals_5_0= ruleEnumLiteral ) ) )* (otherlv_6= ',' | otherlv_7= ';' )? )? otherlv_8= '}' ) | otherlv_9= '.' ) ) // InternalProblem.g:363:3: otherlv_0= 'enum' ( (lv_name_1_0= ruleIdentifier ) ) ( (otherlv_2= '{' ( ( (lv_literals_3_0= ruleEnumLiteral ) ) (otherlv_4= ',' ( (lv_literals_5_0= ruleEnumLiteral ) ) )* (otherlv_6= ',' | otherlv_7= ';' )? )? otherlv_8= '}' ) | otherlv_9= '.' ) { - otherlv_0=(Token)match(input,21,FOLLOW_3); + otherlv_0=(Token)match(input,22,FOLLOW_3); newLeafNode(otherlv_0, grammarAccess.getEnumDeclarationAccess().getEnumKeyword_0()); @@ -978,10 +977,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt13=2; int LA13_0 = input.LA(1); - if ( (LA13_0==18) ) { + if ( (LA13_0==19) ) { alt13=1; } - else if ( (LA13_0==13) ) { + else if ( (LA13_0==14) ) { alt13=2; } else { @@ -997,7 +996,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:387:4: (otherlv_2= '{' ( ( (lv_literals_3_0= ruleEnumLiteral ) ) (otherlv_4= ',' ( (lv_literals_5_0= ruleEnumLiteral ) ) )* (otherlv_6= ',' | otherlv_7= ';' )? )? otherlv_8= '}' ) // InternalProblem.g:388:5: otherlv_2= '{' ( ( (lv_literals_3_0= ruleEnumLiteral ) ) (otherlv_4= ',' ( (lv_literals_5_0= ruleEnumLiteral ) ) )* (otherlv_6= ',' | otherlv_7= ';' )? )? otherlv_8= '}' { - otherlv_2=(Token)match(input,18,FOLLOW_13); + otherlv_2=(Token)match(input,19,FOLLOW_13); newLeafNode(otherlv_2, grammarAccess.getEnumDeclarationAccess().getLeftCurlyBracketKeyword_2_0_0()); @@ -1005,7 +1004,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt12=2; int LA12_0 = input.LA(1); - if ( (LA12_0==RULE_ID||(LA12_0>=41 && LA12_0<=44)) ) { + if ( (LA12_0==RULE_ID||(LA12_0>=42 && LA12_0<=43)) ) { alt12=1; } switch (alt12) { @@ -1049,10 +1048,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt10=2; int LA10_0 = input.LA(1); - if ( (LA10_0==17) ) { + if ( (LA10_0==18) ) { int LA10_1 = input.LA(2); - if ( (LA10_1==RULE_ID||(LA10_1>=41 && LA10_1<=44)) ) { + if ( (LA10_1==RULE_ID||(LA10_1>=42 && LA10_1<=43)) ) { alt10=1; } @@ -1064,7 +1063,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 1 : // InternalProblem.g:413:7: otherlv_4= ',' ( (lv_literals_5_0= ruleEnumLiteral ) ) { - otherlv_4=(Token)match(input,17,FOLLOW_3); + otherlv_4=(Token)match(input,18,FOLLOW_3); newLeafNode(otherlv_4, grammarAccess.getEnumDeclarationAccess().getCommaKeyword_2_0_1_1_0()); @@ -1112,17 +1111,17 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt11=3; int LA11_0 = input.LA(1); - if ( (LA11_0==17) ) { + if ( (LA11_0==18) ) { alt11=1; } - else if ( (LA11_0==19) ) { + else if ( (LA11_0==20) ) { alt11=2; } switch (alt11) { case 1 : // InternalProblem.g:438:7: otherlv_6= ',' { - otherlv_6=(Token)match(input,17,FOLLOW_15); + otherlv_6=(Token)match(input,18,FOLLOW_15); newLeafNode(otherlv_6, grammarAccess.getEnumDeclarationAccess().getCommaKeyword_2_0_1_2_0()); @@ -1132,7 +1131,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 2 : // InternalProblem.g:443:7: otherlv_7= ';' { - otherlv_7=(Token)match(input,19,FOLLOW_15); + otherlv_7=(Token)match(input,20,FOLLOW_15); newLeafNode(otherlv_7, grammarAccess.getEnumDeclarationAccess().getSemicolonKeyword_2_0_1_2_1()); @@ -1148,7 +1147,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_8=(Token)match(input,20,FOLLOW_2); + otherlv_8=(Token)match(input,21,FOLLOW_2); newLeafNode(otherlv_8, grammarAccess.getEnumDeclarationAccess().getRightCurlyBracketKeyword_2_0_2()); @@ -1161,7 +1160,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 2 : // InternalProblem.g:455:4: otherlv_9= '.' { - otherlv_9=(Token)match(input,13,FOLLOW_2); + otherlv_9=(Token)match(input,14,FOLLOW_2); newLeafNode(otherlv_9, grammarAccess.getEnumDeclarationAccess().getFullStopKeyword_2_1()); @@ -1359,10 +1358,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt14=3; int LA14_0 = input.LA(1); - if ( (LA14_0==22) ) { + if ( (LA14_0==23) ) { alt14=1; } - else if ( (LA14_0==23) ) { + else if ( (LA14_0==24) ) { alt14=2; } switch (alt14) { @@ -1375,7 +1374,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:517:5: (lv_containment_0_0= 'contains' ) // InternalProblem.g:518:6: lv_containment_0_0= 'contains' { - lv_containment_0_0=(Token)match(input,22,FOLLOW_8); + lv_containment_0_0=(Token)match(input,23,FOLLOW_8); newLeafNode(lv_containment_0_0, grammarAccess.getReferenceDeclarationAccess().getContainmentContainsKeyword_0_0_0()); @@ -1397,7 +1396,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 2 : // InternalProblem.g:531:4: otherlv_1= 'refers' { - otherlv_1=(Token)match(input,23,FOLLOW_8); + otherlv_1=(Token)match(input,24,FOLLOW_8); newLeafNode(otherlv_1, grammarAccess.getReferenceDeclarationAccess().getRefersKeyword_0_1()); @@ -1439,14 +1438,14 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt15=2; int LA15_0 = input.LA(1); - if ( (LA15_0==24) ) { + if ( (LA15_0==25) ) { alt15=1; } switch (alt15) { case 1 : // InternalProblem.g:553:4: otherlv_3= '[' ( (lv_multiplicity_4_0= ruleMultiplicity ) ) otherlv_5= ']' { - otherlv_3=(Token)match(input,24,FOLLOW_17); + otherlv_3=(Token)match(input,25,FOLLOW_17); newLeafNode(otherlv_3, grammarAccess.getReferenceDeclarationAccess().getLeftSquareBracketKeyword_2_0()); @@ -1481,7 +1480,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_5=(Token)match(input,25,FOLLOW_3); + otherlv_5=(Token)match(input,26,FOLLOW_3); newLeafNode(otherlv_5, grammarAccess.getReferenceDeclarationAccess().getRightSquareBracketKeyword_2_2()); @@ -1526,14 +1525,14 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt16=2; int LA16_0 = input.LA(1); - if ( (LA16_0==26) ) { + if ( (LA16_0==27) ) { alt16=1; } switch (alt16) { case 1 : // InternalProblem.g:601:4: otherlv_7= 'opposite' ( ( ruleQualifiedName ) ) { - otherlv_7=(Token)match(input,26,FOLLOW_8); + otherlv_7=(Token)match(input,27,FOLLOW_8); newLeafNode(otherlv_7, grammarAccess.getReferenceDeclarationAccess().getOppositeKeyword_4_0()); @@ -1668,10 +1667,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt18=2; int LA18_0 = input.LA(1); - if ( (LA18_0==27) ) { + if ( (LA18_0==28) ) { alt18=1; } - else if ( (LA18_0==28) ) { + else if ( (LA18_0==29) ) { alt18=2; } else { @@ -1693,7 +1692,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:644:6: (lv_error_0_0= 'error' ) // InternalProblem.g:645:7: lv_error_0_0= 'error' { - lv_error_0_0=(Token)match(input,27,FOLLOW_20); + lv_error_0_0=(Token)match(input,28,FOLLOW_20); newLeafNode(lv_error_0_0, grammarAccess.getPredicateDefinitionAccess().getErrorErrorKeyword_0_0_0_0()); @@ -1713,14 +1712,14 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt17=2; int LA17_0 = input.LA(1); - if ( (LA17_0==28) ) { + if ( (LA17_0==29) ) { alt17=1; } switch (alt17) { case 1 : // InternalProblem.g:658:6: otherlv_1= 'pred' { - otherlv_1=(Token)match(input,28,FOLLOW_3); + otherlv_1=(Token)match(input,29,FOLLOW_3); newLeafNode(otherlv_1, grammarAccess.getPredicateDefinitionAccess().getPredKeyword_0_0_1()); @@ -1739,7 +1738,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 2 : // InternalProblem.g:665:4: otherlv_2= 'pred' { - otherlv_2=(Token)match(input,28,FOLLOW_3); + otherlv_2=(Token)match(input,29,FOLLOW_3); newLeafNode(otherlv_2, grammarAccess.getPredicateDefinitionAccess().getPredKeyword_0_1()); @@ -1780,7 +1779,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_4=(Token)match(input,29,FOLLOW_22); + otherlv_4=(Token)match(input,30,FOLLOW_22); newLeafNode(otherlv_4, grammarAccess.getPredicateDefinitionAccess().getLeftParenthesisKeyword_2()); @@ -1788,7 +1787,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>=41 && LA20_0<=44)) ) { + if ( (LA20_0==RULE_ID||LA20_0==RULE_QUOTED_ID||(LA20_0>=42 && LA20_0<=43)) ) { alt20=1; } switch (alt20) { @@ -1832,7 +1831,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt19=2; int LA19_0 = input.LA(1); - if ( (LA19_0==17) ) { + if ( (LA19_0==18) ) { alt19=1; } @@ -1841,7 +1840,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 1 : // InternalProblem.g:714:5: otherlv_6= ',' ( (lv_parameters_7_0= ruleParameter ) ) { - otherlv_6=(Token)match(input,17,FOLLOW_8); + otherlv_6=(Token)match(input,18,FOLLOW_8); newLeafNode(otherlv_6, grammarAccess.getPredicateDefinitionAccess().getCommaKeyword_3_1_0()); @@ -1891,7 +1890,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_8=(Token)match(input,30,FOLLOW_24); + otherlv_8=(Token)match(input,31,FOLLOW_24); newLeafNode(otherlv_8, grammarAccess.getPredicateDefinitionAccess().getRightParenthesisKeyword_4()); @@ -1899,14 +1898,14 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt22=2; int LA22_0 = input.LA(1); - if ( (LA22_0==31) ) { + if ( (LA22_0==32) ) { alt22=1; } switch (alt22) { case 1 : // InternalProblem.g:744:4: otherlv_9= ':-' ( (lv_bodies_10_0= ruleConjunction ) ) (otherlv_11= ';' ( (lv_bodies_12_0= ruleConjunction ) ) )* { - otherlv_9=(Token)match(input,31,FOLLOW_25); + otherlv_9=(Token)match(input,32,FOLLOW_25); newLeafNode(otherlv_9, grammarAccess.getPredicateDefinitionAccess().getColonHyphenMinusKeyword_5_0()); @@ -1947,7 +1946,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt21=2; int LA21_0 = input.LA(1); - if ( (LA21_0==19) ) { + if ( (LA21_0==20) ) { alt21=1; } @@ -1956,7 +1955,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 1 : // InternalProblem.g:768:5: otherlv_11= ';' ( (lv_bodies_12_0= ruleConjunction ) ) { - otherlv_11=(Token)match(input,19,FOLLOW_25); + otherlv_11=(Token)match(input,20,FOLLOW_25); newLeafNode(otherlv_11, grammarAccess.getPredicateDefinitionAccess().getSemicolonKeyword_5_2_0()); @@ -2006,7 +2005,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_13=(Token)match(input,13,FOLLOW_2); + otherlv_13=(Token)match(input,14,FOLLOW_2); newLeafNode(otherlv_13, grammarAccess.getPredicateDefinitionAccess().getFullStopKeyword_6()); @@ -2098,43 +2097,25 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { { int LA23_2 = input.LA(2); - if ( (LA23_2==RULE_ID||(LA23_2>=40 && LA23_2<=44)) ) { - alt23=1; - } - } - break; - case 41: - { - int LA23_3 = input.LA(2); - - if ( (LA23_3==RULE_ID||(LA23_3>=40 && LA23_3<=44)) ) { + if ( (LA23_2==RULE_ID||(LA23_2>=41 && LA23_2<=43)) ) { alt23=1; } } break; case 42: { - int LA23_4 = input.LA(2); + int LA23_3 = input.LA(2); - if ( (LA23_4==RULE_ID||(LA23_4>=40 && LA23_4<=44)) ) { + if ( (LA23_3==RULE_ID||(LA23_3>=41 && LA23_3<=43)) ) { alt23=1; } } break; case 43: { - int LA23_5 = input.LA(2); - - if ( (LA23_5==RULE_ID||(LA23_5>=40 && LA23_5<=44)) ) { - alt23=1; - } - } - break; - case 44: - { - int LA23_6 = input.LA(2); + int LA23_4 = input.LA(2); - if ( (LA23_6==RULE_ID||(LA23_6>=40 && LA23_6<=44)) ) { + if ( (LA23_4==RULE_ID||(LA23_4>=41 && LA23_4<=43)) ) { alt23=1; } } @@ -2320,7 +2301,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt24=2; int LA24_0 = input.LA(1); - if ( (LA24_0==17) ) { + if ( (LA24_0==18) ) { alt24=1; } @@ -2329,7 +2310,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 1 : // InternalProblem.g:890:4: otherlv_1= ',' ( (lv_literals_2_0= ruleLiteral ) ) { - otherlv_1=(Token)match(input,17,FOLLOW_25); + otherlv_1=(Token)match(input,18,FOLLOW_25); newLeafNode(otherlv_1, grammarAccess.getConjunctionAccess().getCommaKeyword_1_0()); @@ -2452,10 +2433,10 @@ 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>=41 && LA25_0<=44)) ) { + if ( (LA25_0==RULE_ID||LA25_0==RULE_QUOTED_ID||(LA25_0>=42 && LA25_0<=43)) ) { alt25=1; } - else if ( (LA25_0==32) ) { + else if ( (LA25_0==33) ) { alt25=2; } else { @@ -2578,7 +2559,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:968:2: (otherlv_0= '!' ( (lv_atom_1_0= ruleAtom ) ) ) // InternalProblem.g:969:3: otherlv_0= '!' ( (lv_atom_1_0= ruleAtom ) ) { - otherlv_0=(Token)match(input,32,FOLLOW_8); + otherlv_0=(Token)match(input,33,FOLLOW_8); newLeafNode(otherlv_0, grammarAccess.getNegativeLiteralAccess().getExclamationMarkKeyword_0()); @@ -2727,7 +2708,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt26=2; int LA26_0 = input.LA(1); - if ( (LA26_0==33) ) { + if ( (LA26_0==34) ) { alt26=1; } switch (alt26) { @@ -2737,7 +2718,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:1028:4: (lv_transitiveClosure_1_0= '+' ) // InternalProblem.g:1029:5: lv_transitiveClosure_1_0= '+' { - lv_transitiveClosure_1_0=(Token)match(input,33,FOLLOW_21); + lv_transitiveClosure_1_0=(Token)match(input,34,FOLLOW_21); newLeafNode(lv_transitiveClosure_1_0, grammarAccess.getAtomAccess().getTransitiveClosurePlusSignKeyword_1_0()); @@ -2756,7 +2737,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_2=(Token)match(input,29,FOLLOW_29); + otherlv_2=(Token)match(input,30,FOLLOW_29); newLeafNode(otherlv_2, grammarAccess.getAtomAccess().getLeftParenthesisKeyword_2()); @@ -2764,7 +2745,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt28=2; int LA28_0 = input.LA(1); - if ( ((LA28_0>=RULE_STRING && LA28_0<=RULE_QUOTED_ID)||(LA28_0>=41 && LA28_0<=45)) ) { + if ( ((LA28_0>=RULE_STRING && LA28_0<=RULE_EXPONENTIAL)||(LA28_0>=42 && LA28_0<=44)) ) { alt28=1; } switch (alt28) { @@ -2808,7 +2789,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt27=2; int LA27_0 = input.LA(1); - if ( (LA27_0==17) ) { + if ( (LA27_0==18) ) { alt27=1; } @@ -2817,7 +2798,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 1 : // InternalProblem.g:1066:5: otherlv_4= ',' ( (lv_arguments_5_0= ruleArgument ) ) { - otherlv_4=(Token)match(input,17,FOLLOW_30); + otherlv_4=(Token)match(input,18,FOLLOW_30); newLeafNode(otherlv_4, grammarAccess.getAtomAccess().getCommaKeyword_3_1_0()); @@ -2867,7 +2848,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_6=(Token)match(input,30,FOLLOW_2); + otherlv_6=(Token)match(input,31,FOLLOW_2); newLeafNode(otherlv_6, grammarAccess.getAtomAccess().getRightParenthesisKeyword_4()); @@ -2950,10 +2931,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt29=2; int LA29_0 = input.LA(1); - if ( (LA29_0==RULE_ID||LA29_0==RULE_QUOTED_ID||(LA29_0>=41 && LA29_0<=44)) ) { + if ( (LA29_0==RULE_ID||LA29_0==RULE_QUOTED_ID||(LA29_0>=42 && LA29_0<=43)) ) { alt29=1; } - else if ( (LA29_0==RULE_STRING||LA29_0==RULE_INT||LA29_0==45) ) { + else if ( (LA29_0==RULE_STRING||LA29_0==RULE_INT||LA29_0==RULE_EXPONENTIAL||LA29_0==44) ) { alt29=2; } else { @@ -3327,7 +3308,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_1=(Token)match(input,29,FOLLOW_29); + otherlv_1=(Token)match(input,30,FOLLOW_29); newLeafNode(otherlv_1, grammarAccess.getAssertionAccess().getLeftParenthesisKeyword_0_0_1()); @@ -3335,7 +3316,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt31=2; int LA31_0 = input.LA(1); - if ( ((LA31_0>=RULE_STRING && LA31_0<=RULE_QUOTED_ID)||(LA31_0>=41 && LA31_0<=45)) ) { + if ( ((LA31_0>=RULE_STRING && LA31_0<=RULE_EXPONENTIAL)||(LA31_0>=42 && LA31_0<=44)) ) { alt31=1; } switch (alt31) { @@ -3379,7 +3360,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt30=2; int LA30_0 = input.LA(1); - if ( (LA30_0==17) ) { + if ( (LA30_0==18) ) { alt30=1; } @@ -3388,7 +3369,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 1 : // InternalProblem.g:1262:7: otherlv_3= ',' ( (lv_arguments_4_0= ruleAssertionArgument ) ) { - otherlv_3=(Token)match(input,17,FOLLOW_30); + otherlv_3=(Token)match(input,18,FOLLOW_30); newLeafNode(otherlv_3, grammarAccess.getAssertionAccess().getCommaKeyword_0_0_2_1_0()); @@ -3438,11 +3419,11 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_5=(Token)match(input,30,FOLLOW_31); + otherlv_5=(Token)match(input,31,FOLLOW_31); newLeafNode(otherlv_5, grammarAccess.getAssertionAccess().getRightParenthesisKeyword_0_0_3()); - otherlv_6=(Token)match(input,34,FOLLOW_32); + otherlv_6=(Token)match(input,35,FOLLOW_32); newLeafNode(otherlv_6, grammarAccess.getAssertionAccess().getColonKeyword_0_0_4()); @@ -3493,7 +3474,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt32=2; int LA32_0 = input.LA(1); - if ( (LA32_0==32||LA32_0==47) ) { + if ( (LA32_0==33||LA32_0==46) ) { alt32=1; } switch (alt32) { @@ -3559,7 +3540,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_10=(Token)match(input,29,FOLLOW_29); + otherlv_10=(Token)match(input,30,FOLLOW_29); newLeafNode(otherlv_10, grammarAccess.getAssertionAccess().getLeftParenthesisKeyword_0_1_2()); @@ -3567,7 +3548,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt34=2; int LA34_0 = input.LA(1); - if ( ((LA34_0>=RULE_STRING && LA34_0<=RULE_QUOTED_ID)||(LA34_0>=41 && LA34_0<=45)) ) { + if ( ((LA34_0>=RULE_STRING && LA34_0<=RULE_EXPONENTIAL)||(LA34_0>=42 && LA34_0<=44)) ) { alt34=1; } switch (alt34) { @@ -3611,7 +3592,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt33=2; int LA33_0 = input.LA(1); - if ( (LA33_0==17) ) { + if ( (LA33_0==18) ) { alt33=1; } @@ -3620,7 +3601,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 1 : // InternalProblem.g:1377:7: otherlv_12= ',' ( (lv_arguments_13_0= ruleAssertionArgument ) ) { - otherlv_12=(Token)match(input,17,FOLLOW_30); + otherlv_12=(Token)match(input,18,FOLLOW_30); newLeafNode(otherlv_12, grammarAccess.getAssertionAccess().getCommaKeyword_0_1_3_1_0()); @@ -3670,7 +3651,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_14=(Token)match(input,30,FOLLOW_4); + otherlv_14=(Token)match(input,31,FOLLOW_4); newLeafNode(otherlv_14, grammarAccess.getAssertionAccess().getRightParenthesisKeyword_0_1_4()); @@ -3683,7 +3664,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_15=(Token)match(input,13,FOLLOW_2); + otherlv_15=(Token)match(input,14,FOLLOW_2); newLeafNode(otherlv_15, grammarAccess.getAssertionAccess().getFullStopKeyword_1()); @@ -3766,10 +3747,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt36=2; int LA36_0 = input.LA(1); - if ( (LA36_0==RULE_ID||LA36_0==RULE_QUOTED_ID||(LA36_0>=41 && LA36_0<=44)) ) { + if ( (LA36_0==RULE_ID||LA36_0==RULE_QUOTED_ID||(LA36_0>=42 && LA36_0<=43)) ) { alt36=1; } - else if ( (LA36_0==RULE_STRING||LA36_0==RULE_INT||LA36_0==45) ) { + else if ( (LA36_0==RULE_STRING||LA36_0==RULE_INT||LA36_0==RULE_EXPONENTIAL||LA36_0==44) ) { alt36=2; } else { @@ -4117,7 +4098,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_1=(Token)match(input,34,FOLLOW_30); + otherlv_1=(Token)match(input,35,FOLLOW_30); newLeafNode(otherlv_1, grammarAccess.getNodeValueAssertionAccess().getColonKeyword_1()); @@ -4152,7 +4133,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_3=(Token)match(input,13,FOLLOW_2); + otherlv_3=(Token)match(input,14,FOLLOW_2); newLeafNode(otherlv_3, grammarAccess.getNodeValueAssertionAccess().getFullStopKeyword_3()); @@ -4215,13 +4196,13 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleConstant" - // InternalProblem.g:1590:1: ruleConstant returns [EObject current=null] : (this_IntConstant_0= ruleIntConstant | this_RealConstant_1= ruleRealConstant | this_StringConstant_2= ruleStringConstant ) ; + // InternalProblem.g:1590:1: ruleConstant returns [EObject current=null] : (this_RealConstant_0= ruleRealConstant | this_IntConstant_1= ruleIntConstant | this_StringConstant_2= ruleStringConstant ) ; public final EObject ruleConstant() throws RecognitionException { EObject current = null; - EObject this_IntConstant_0 = null; + EObject this_RealConstant_0 = null; - EObject this_RealConstant_1 = null; + EObject this_IntConstant_1 = null; EObject this_StringConstant_2 = null; @@ -4230,56 +4211,47 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalProblem.g:1596:2: ( (this_IntConstant_0= ruleIntConstant | this_RealConstant_1= ruleRealConstant | this_StringConstant_2= ruleStringConstant ) ) - // InternalProblem.g:1597:2: (this_IntConstant_0= ruleIntConstant | this_RealConstant_1= ruleRealConstant | this_StringConstant_2= ruleStringConstant ) + // InternalProblem.g:1596:2: ( (this_RealConstant_0= ruleRealConstant | this_IntConstant_1= ruleIntConstant | this_StringConstant_2= ruleStringConstant ) ) + // InternalProblem.g:1597:2: (this_RealConstant_0= ruleRealConstant | this_IntConstant_1= ruleIntConstant | this_StringConstant_2= ruleStringConstant ) { - // InternalProblem.g:1597:2: (this_IntConstant_0= ruleIntConstant | this_RealConstant_1= ruleRealConstant | this_StringConstant_2= ruleStringConstant ) + // InternalProblem.g:1597:2: (this_RealConstant_0= ruleRealConstant | this_IntConstant_1= ruleIntConstant | this_StringConstant_2= ruleStringConstant ) int alt37=3; switch ( input.LA(1) ) { - case 45: + case 44: { int LA37_1 = input.LA(2); if ( (LA37_1==RULE_INT) ) { - switch ( input.LA(3) ) { - case EOF: - case 17: - case 30: - { - alt37=1; - } - break; - case 13: - { + int LA37_3 = input.LA(3); + + if ( (LA37_3==14) ) { int LA37_5 = input.LA(4); - if ( (LA37_5==EOF||LA37_5==RULE_ID||LA37_5==RULE_QUOTED_ID||(LA37_5>=14 && LA37_5<=15)||LA37_5==21||(LA37_5>=27 && LA37_5<=28)||LA37_5==32||LA37_5==35||(LA37_5>=41 && LA37_5<=44)||LA37_5==47) ) { - alt37=1; - } - else if ( (LA37_5==RULE_INT) ) { + if ( (LA37_5==EOF||LA37_5==RULE_ID||LA37_5==RULE_QUOTED_ID||(LA37_5>=15 && LA37_5<=16)||LA37_5==22||(LA37_5>=28 && LA37_5<=29)||LA37_5==33||LA37_5==36||(LA37_5>=42 && LA37_5<=43)||LA37_5==46) ) { alt37=2; } + else if ( (LA37_5==RULE_INT||LA37_5==RULE_EXPONENTIAL) ) { + alt37=1; + } else { NoViableAltException nvae = new NoViableAltException("", 37, 5, input); throw nvae; } - } - break; - case 43: - case 44: - { + } + else if ( (LA37_3==EOF||LA37_3==18||LA37_3==31) ) { alt37=2; - } - break; - default: + } + else { NoViableAltException nvae = - new NoViableAltException("", 37, 2, input); + new NoViableAltException("", 37, 3, input); throw nvae; } - + } + else if ( (LA37_1==RULE_EXPONENTIAL) ) { + alt37=1; } else { NoViableAltException nvae = @@ -4289,47 +4261,40 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } } break; + case RULE_EXPONENTIAL: + { + alt37=1; + } + break; case RULE_INT: { - switch ( input.LA(2) ) { - case EOF: - case 17: - case 30: - { - alt37=1; - } - break; - case 13: - { + int LA37_3 = input.LA(2); + + if ( (LA37_3==14) ) { int LA37_5 = input.LA(3); - if ( (LA37_5==EOF||LA37_5==RULE_ID||LA37_5==RULE_QUOTED_ID||(LA37_5>=14 && LA37_5<=15)||LA37_5==21||(LA37_5>=27 && LA37_5<=28)||LA37_5==32||LA37_5==35||(LA37_5>=41 && LA37_5<=44)||LA37_5==47) ) { - alt37=1; - } - else if ( (LA37_5==RULE_INT) ) { + if ( (LA37_5==EOF||LA37_5==RULE_ID||LA37_5==RULE_QUOTED_ID||(LA37_5>=15 && LA37_5<=16)||LA37_5==22||(LA37_5>=28 && LA37_5<=29)||LA37_5==33||LA37_5==36||(LA37_5>=42 && LA37_5<=43)||LA37_5==46) ) { alt37=2; } + else if ( (LA37_5==RULE_INT||LA37_5==RULE_EXPONENTIAL) ) { + alt37=1; + } else { NoViableAltException nvae = new NoViableAltException("", 37, 5, input); throw nvae; } - } - break; - case 43: - case 44: - { + } + else if ( (LA37_3==EOF||LA37_3==18||LA37_3==31) ) { alt37=2; - } - break; - default: + } + else { NoViableAltException nvae = - new NoViableAltException("", 37, 2, input); + new NoViableAltException("", 37, 3, input); throw nvae; } - } break; case RULE_STRING: @@ -4346,36 +4311,36 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { switch (alt37) { case 1 : - // InternalProblem.g:1598:3: this_IntConstant_0= ruleIntConstant + // InternalProblem.g:1598:3: this_RealConstant_0= ruleRealConstant { - newCompositeNode(grammarAccess.getConstantAccess().getIntConstantParserRuleCall_0()); + newCompositeNode(grammarAccess.getConstantAccess().getRealConstantParserRuleCall_0()); pushFollow(FOLLOW_2); - this_IntConstant_0=ruleIntConstant(); + this_RealConstant_0=ruleRealConstant(); state._fsp--; - current = this_IntConstant_0; + current = this_RealConstant_0; afterParserOrEnumRuleCall(); } break; case 2 : - // InternalProblem.g:1607:3: this_RealConstant_1= ruleRealConstant + // InternalProblem.g:1607:3: this_IntConstant_1= ruleIntConstant { - newCompositeNode(grammarAccess.getConstantAccess().getRealConstantParserRuleCall_1()); + newCompositeNode(grammarAccess.getConstantAccess().getIntConstantParserRuleCall_1()); pushFollow(FOLLOW_2); - this_RealConstant_1=ruleRealConstant(); + this_IntConstant_1=ruleIntConstant(); state._fsp--; - current = this_RealConstant_1; + current = this_IntConstant_1; afterParserOrEnumRuleCall(); @@ -4777,7 +4742,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:1749:2: (otherlv_0= 'scope' ( (lv_typeScopes_1_0= ruleTypeScope ) ) (otherlv_2= ',' ( (lv_typeScopes_3_0= ruleTypeScope ) ) )* otherlv_4= '.' ) // InternalProblem.g:1750:3: otherlv_0= 'scope' ( (lv_typeScopes_1_0= ruleTypeScope ) ) (otherlv_2= ',' ( (lv_typeScopes_3_0= ruleTypeScope ) ) )* otherlv_4= '.' { - otherlv_0=(Token)match(input,35,FOLLOW_33); + otherlv_0=(Token)match(input,36,FOLLOW_33); newLeafNode(otherlv_0, grammarAccess.getScopeDeclarationAccess().getScopeKeyword_0()); @@ -4818,7 +4783,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt38=2; int LA38_0 = input.LA(1); - if ( (LA38_0==17) ) { + if ( (LA38_0==18) ) { alt38=1; } @@ -4827,7 +4792,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 1 : // InternalProblem.g:1774:4: otherlv_2= ',' ( (lv_typeScopes_3_0= ruleTypeScope ) ) { - otherlv_2=(Token)match(input,17,FOLLOW_33); + otherlv_2=(Token)match(input,18,FOLLOW_33); newLeafNode(otherlv_2, grammarAccess.getScopeDeclarationAccess().getCommaKeyword_2_0()); @@ -4871,7 +4836,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } } while (true); - otherlv_4=(Token)match(input,13,FOLLOW_2); + otherlv_4=(Token)match(input,14,FOLLOW_2); newLeafNode(otherlv_4, grammarAccess.getScopeDeclarationAccess().getFullStopKeyword_3()); @@ -4979,10 +4944,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt39=2; int LA39_0 = input.LA(1); - if ( (LA39_0==36) ) { + if ( (LA39_0==37) ) { alt39=1; } - else if ( (LA39_0==37) ) { + else if ( (LA39_0==38) ) { alt39=2; } else { @@ -5001,7 +4966,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // InternalProblem.g:1836:5: (lv_increment_1_0= '+=' ) // InternalProblem.g:1837:6: lv_increment_1_0= '+=' { - lv_increment_1_0=(Token)match(input,36,FOLLOW_17); + lv_increment_1_0=(Token)match(input,37,FOLLOW_17); newLeafNode(lv_increment_1_0, grammarAccess.getTypeScopeAccess().getIncrementPlusSignEqualsSignKeyword_1_0_0()); @@ -5023,7 +4988,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 2 : // InternalProblem.g:1850:4: otherlv_2= '=' { - otherlv_2=(Token)match(input,37,FOLLOW_17); + otherlv_2=(Token)match(input,38,FOLLOW_17); newLeafNode(otherlv_2, grammarAccess.getTypeScopeAccess().getEqualsSignKeyword_1_1()); @@ -5143,7 +5108,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt40=2; int LA40_0 = input.LA(1); - if ( (LA40_0==EOF||LA40_0==25) ) { + if ( (LA40_0==EOF||LA40_0==26) ) { alt40=1; } else if ( (LA40_0==RULE_INT) ) { @@ -5274,10 +5239,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { if ( (LA41_0==RULE_INT) ) { int LA41_1 = input.LA(2); - if ( (LA41_1==38) ) { + if ( (LA41_1==39) ) { alt41=1; } - else if ( (LA41_1==EOF||LA41_1==13||LA41_1==17||LA41_1==25) ) { + else if ( (LA41_1==EOF||LA41_1==14||LA41_1==18||LA41_1==26) ) { alt41=2; } else { @@ -5507,7 +5472,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - otherlv_1=(Token)match(input,38,FOLLOW_37); + otherlv_1=(Token)match(input,39,FOLLOW_37); newLeafNode(otherlv_1, grammarAccess.getRangeMultiplicityAccess().getFullStopFullStopKeyword_1()); @@ -5717,7 +5682,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { if ( (LA42_0==RULE_INT) ) { alt42=1; } - else if ( (LA42_0==39) ) { + else if ( (LA42_0==40) ) { alt42=2; } else { @@ -5743,7 +5708,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 2 : // InternalProblem.g:2092:3: kw= '*' { - kw=(Token)match(input,39,FOLLOW_2); + kw=(Token)match(input,40,FOLLOW_2); current.merge(kw); newLeafNode(kw, grammarAccess.getUpperBoundAccess().getAsteriskKeyword_1()); @@ -5842,7 +5807,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { if ( (LA44_0==RULE_QUOTED_ID) ) { alt44=1; } - else if ( (LA44_0==RULE_ID||(LA44_0>=41 && LA44_0<=44)) ) { + else if ( (LA44_0==RULE_ID||(LA44_0>=42 && LA44_0<=43)) ) { alt44=2; } else { @@ -5891,7 +5856,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { int alt43=2; int LA43_0 = input.LA(1); - if ( (LA43_0==40) ) { + if ( (LA43_0==41) ) { alt43=1; } @@ -5900,7 +5865,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 1 : // InternalProblem.g:2142:5: kw= '::' this_Identifier_3= ruleIdentifier { - kw=(Token)match(input,40,FOLLOW_3); + kw=(Token)match(input,41,FOLLOW_3); current.merge(kw); newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getColonColonKeyword_1_1_0()); @@ -5996,7 +5961,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleIdentifier" - // InternalProblem.g:2173:1: ruleIdentifier returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) ; + // InternalProblem.g:2173:1: ruleIdentifier returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' ) ; public final AntlrDatatypeRuleToken ruleIdentifier() throws RecognitionException { AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); @@ -6007,35 +5972,25 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalProblem.g:2179:2: ( (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) ) - // InternalProblem.g:2180:2: (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) + // InternalProblem.g:2179:2: ( (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' ) ) + // InternalProblem.g:2180:2: (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' ) { - // InternalProblem.g:2180:2: (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' | kw= 'e' | kw= 'E' ) - int alt45=5; + // InternalProblem.g:2180:2: (this_ID_0= RULE_ID | kw= 'true' | kw= 'false' ) + int alt45=3; switch ( input.LA(1) ) { case RULE_ID: { alt45=1; } break; - case 41: - { - alt45=2; - } - break; case 42: { - alt45=3; + alt45=2; } break; case 43: { - alt45=4; - } - break; - case 44: - { - alt45=5; + alt45=3; } break; default: @@ -6062,7 +6017,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 2 : // InternalProblem.g:2189:3: kw= 'true' { - kw=(Token)match(input,41,FOLLOW_2); + kw=(Token)match(input,42,FOLLOW_2); current.merge(kw); newLeafNode(kw, grammarAccess.getIdentifierAccess().getTrueKeyword_1()); @@ -6073,32 +6028,10 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { case 3 : // InternalProblem.g:2195:3: kw= 'false' { - kw=(Token)match(input,42,FOLLOW_2); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getIdentifierAccess().getFalseKeyword_2()); - - - } - break; - case 4 : - // InternalProblem.g:2201:3: kw= 'e' - { kw=(Token)match(input,43,FOLLOW_2); current.merge(kw); - newLeafNode(kw, grammarAccess.getIdentifierAccess().getEKeyword_3()); - - - } - break; - case 5 : - // InternalProblem.g:2207:3: kw= 'E' - { - kw=(Token)match(input,44,FOLLOW_2); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getIdentifierAccess().getEKeyword_4()); + newLeafNode(kw, grammarAccess.getIdentifierAccess().getFalseKeyword_2()); } @@ -6126,7 +6059,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleInteger" - // InternalProblem.g:2216:1: entryRuleInteger returns [String current=null] : iv_ruleInteger= ruleInteger EOF ; + // InternalProblem.g:2204:1: entryRuleInteger returns [String current=null] : iv_ruleInteger= ruleInteger EOF ; public final String entryRuleInteger() throws RecognitionException { String current = null; @@ -6137,8 +6070,8 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); try { - // InternalProblem.g:2218:2: (iv_ruleInteger= ruleInteger EOF ) - // InternalProblem.g:2219:2: iv_ruleInteger= ruleInteger EOF + // InternalProblem.g:2206:2: (iv_ruleInteger= ruleInteger EOF ) + // InternalProblem.g:2207:2: iv_ruleInteger= ruleInteger EOF { newCompositeNode(grammarAccess.getIntegerRule()); pushFollow(FOLLOW_1); @@ -6168,7 +6101,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleInteger" - // InternalProblem.g:2228:1: ruleInteger returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : ( (kw= '-' )? this_INT_1= RULE_INT ) ; + // InternalProblem.g:2216:1: ruleInteger returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : ( (kw= '-' )? this_INT_1= RULE_INT ) ; public final AntlrDatatypeRuleToken ruleInteger() throws RecognitionException { AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); @@ -6180,24 +6113,24 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); try { - // InternalProblem.g:2235:2: ( ( (kw= '-' )? this_INT_1= RULE_INT ) ) - // InternalProblem.g:2236:2: ( (kw= '-' )? this_INT_1= RULE_INT ) + // InternalProblem.g:2223:2: ( ( (kw= '-' )? this_INT_1= RULE_INT ) ) + // InternalProblem.g:2224:2: ( (kw= '-' )? this_INT_1= RULE_INT ) { - // InternalProblem.g:2236:2: ( (kw= '-' )? this_INT_1= RULE_INT ) - // InternalProblem.g:2237:3: (kw= '-' )? this_INT_1= RULE_INT + // InternalProblem.g:2224:2: ( (kw= '-' )? this_INT_1= RULE_INT ) + // InternalProblem.g:2225:3: (kw= '-' )? this_INT_1= RULE_INT { - // InternalProblem.g:2237:3: (kw= '-' )? + // InternalProblem.g:2225:3: (kw= '-' )? int alt46=2; int LA46_0 = input.LA(1); - if ( (LA46_0==45) ) { + if ( (LA46_0==44) ) { alt46=1; } switch (alt46) { case 1 : - // InternalProblem.g:2238:4: kw= '-' + // InternalProblem.g:2226:4: kw= '-' { - kw=(Token)match(input,45,FOLLOW_17); + kw=(Token)match(input,44,FOLLOW_17); current.merge(kw); newLeafNode(kw, grammarAccess.getIntegerAccess().getHyphenMinusKeyword_0()); @@ -6241,19 +6174,16 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleReal" - // InternalProblem.g:2258:1: entryRuleReal returns [String current=null] : iv_ruleReal= ruleReal EOF ; + // InternalProblem.g:2246:1: entryRuleReal returns [String current=null] : iv_ruleReal= ruleReal EOF ; public final String entryRuleReal() throws RecognitionException { String current = null; AntlrDatatypeRuleToken iv_ruleReal = null; - - HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); - try { - // InternalProblem.g:2260:2: (iv_ruleReal= ruleReal EOF ) - // InternalProblem.g:2261:2: iv_ruleReal= ruleReal EOF + // InternalProblem.g:2246:44: (iv_ruleReal= ruleReal EOF ) + // InternalProblem.g:2247:2: iv_ruleReal= ruleReal EOF { newCompositeNode(grammarAccess.getRealRule()); pushFollow(FOLLOW_1); @@ -6273,9 +6203,6 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { appendSkippedTokens(); } finally { - - myHiddenTokenState.restore(); - } return current; } @@ -6283,39 +6210,38 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleReal" - // InternalProblem.g:2270:1: ruleReal returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) ; + // InternalProblem.g:2253:1: ruleReal returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : ( (kw= '-' )? (this_EXPONENTIAL_1= RULE_EXPONENTIAL | (this_INT_2= RULE_INT kw= '.' (this_INT_4= RULE_INT | this_EXPONENTIAL_5= RULE_EXPONENTIAL ) ) ) ) ; public final AntlrDatatypeRuleToken ruleReal() throws RecognitionException { AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); Token kw=null; - Token this_INT_1=null; - Token this_INT_3=null; - Token this_INT_5=null; - Token this_INT_10=null; + Token this_EXPONENTIAL_1=null; + Token this_INT_2=null; + Token this_INT_4=null; + Token this_EXPONENTIAL_5=null; enterRule(); - HiddenTokens myHiddenTokenState = ((XtextTokenStream)input).setHiddenTokens(); try { - // InternalProblem.g:2277:2: ( ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) ) - // InternalProblem.g:2278:2: ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) + // InternalProblem.g:2259:2: ( ( (kw= '-' )? (this_EXPONENTIAL_1= RULE_EXPONENTIAL | (this_INT_2= RULE_INT kw= '.' (this_INT_4= RULE_INT | this_EXPONENTIAL_5= RULE_EXPONENTIAL ) ) ) ) ) + // InternalProblem.g:2260:2: ( (kw= '-' )? (this_EXPONENTIAL_1= RULE_EXPONENTIAL | (this_INT_2= RULE_INT kw= '.' (this_INT_4= RULE_INT | this_EXPONENTIAL_5= RULE_EXPONENTIAL ) ) ) ) { - // InternalProblem.g:2278:2: ( (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) ) - // InternalProblem.g:2279:3: (kw= '-' )? this_INT_1= RULE_INT ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) + // InternalProblem.g:2260:2: ( (kw= '-' )? (this_EXPONENTIAL_1= RULE_EXPONENTIAL | (this_INT_2= RULE_INT kw= '.' (this_INT_4= RULE_INT | this_EXPONENTIAL_5= RULE_EXPONENTIAL ) ) ) ) + // InternalProblem.g:2261:3: (kw= '-' )? (this_EXPONENTIAL_1= RULE_EXPONENTIAL | (this_INT_2= RULE_INT kw= '.' (this_INT_4= RULE_INT | this_EXPONENTIAL_5= RULE_EXPONENTIAL ) ) ) { - // InternalProblem.g:2279:3: (kw= '-' )? + // InternalProblem.g:2261:3: (kw= '-' )? int alt47=2; int LA47_0 = input.LA(1); - if ( (LA47_0==45) ) { + if ( (LA47_0==44) ) { alt47=1; } switch (alt47) { case 1 : - // InternalProblem.g:2280:4: kw= '-' + // InternalProblem.g:2262:4: kw= '-' { - kw=(Token)match(input,45,FOLLOW_17); + kw=(Token)match(input,44,FOLLOW_39); current.merge(kw); newLeafNode(kw, grammarAccess.getRealAccess().getHyphenMinusKeyword_0()); @@ -6326,183 +6252,93 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - this_INT_1=(Token)match(input,RULE_INT,FOLLOW_39); + // InternalProblem.g:2268:3: (this_EXPONENTIAL_1= RULE_EXPONENTIAL | (this_INT_2= RULE_INT kw= '.' (this_INT_4= RULE_INT | this_EXPONENTIAL_5= RULE_EXPONENTIAL ) ) ) + int alt49=2; + int LA49_0 = input.LA(1); - current.merge(this_INT_1); - - - newLeafNode(this_INT_1, grammarAccess.getRealAccess().getINTTerminalRuleCall_1()); - - // InternalProblem.g:2293:3: ( (kw= '.' this_INT_3= RULE_INT ) | ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) ) - int alt51=2; - int LA51_0 = input.LA(1); - - if ( (LA51_0==13) ) { - int LA51_1 = input.LA(2); - - if ( (LA51_1==RULE_INT) ) { - int LA51_3 = input.LA(3); - - if ( (LA51_3==EOF||LA51_3==13||LA51_3==17||LA51_3==30) ) { - alt51=1; - } - else if ( ((LA51_3>=43 && LA51_3<=44)) ) { - alt51=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 51, 3, input); - - throw nvae; - } - } - else { - NoViableAltException nvae = - new NoViableAltException("", 51, 1, input); - - throw nvae; - } + if ( (LA49_0==RULE_EXPONENTIAL) ) { + alt49=1; } - else if ( ((LA51_0>=43 && LA51_0<=44)) ) { - alt51=2; + else if ( (LA49_0==RULE_INT) ) { + alt49=2; } else { NoViableAltException nvae = - new NoViableAltException("", 51, 0, input); + new NoViableAltException("", 49, 0, input); throw nvae; } - switch (alt51) { + switch (alt49) { case 1 : - // InternalProblem.g:2294:4: (kw= '.' this_INT_3= RULE_INT ) - { - // InternalProblem.g:2294:4: (kw= '.' this_INT_3= RULE_INT ) - // InternalProblem.g:2295:5: kw= '.' this_INT_3= RULE_INT + // InternalProblem.g:2269:4: this_EXPONENTIAL_1= RULE_EXPONENTIAL { - kw=(Token)match(input,13,FOLLOW_17); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getFullStopKeyword_2_0_0()); - - this_INT_3=(Token)match(input,RULE_INT,FOLLOW_2); - - current.merge(this_INT_3); - - - newLeafNode(this_INT_3, grammarAccess.getRealAccess().getINTTerminalRuleCall_2_0_1()); - + this_EXPONENTIAL_1=(Token)match(input,RULE_EXPONENTIAL,FOLLOW_2); - } + current.merge(this_EXPONENTIAL_1); + + newLeafNode(this_EXPONENTIAL_1, grammarAccess.getRealAccess().getEXPONENTIALTerminalRuleCall_1_0()); + } break; case 2 : - // InternalProblem.g:2309:4: ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) + // InternalProblem.g:2277:4: (this_INT_2= RULE_INT kw= '.' (this_INT_4= RULE_INT | this_EXPONENTIAL_5= RULE_EXPONENTIAL ) ) { - // InternalProblem.g:2309:4: ( (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT ) - // InternalProblem.g:2310:5: (kw= '.' this_INT_5= RULE_INT )? (kw= 'e' | kw= 'E' ) (kw= '-' | kw= '+' )? this_INT_10= RULE_INT + // InternalProblem.g:2277:4: (this_INT_2= RULE_INT kw= '.' (this_INT_4= RULE_INT | this_EXPONENTIAL_5= RULE_EXPONENTIAL ) ) + // InternalProblem.g:2278:5: this_INT_2= RULE_INT kw= '.' (this_INT_4= RULE_INT | this_EXPONENTIAL_5= RULE_EXPONENTIAL ) { - // InternalProblem.g:2310:5: (kw= '.' this_INT_5= RULE_INT )? - int alt48=2; - int LA48_0 = input.LA(1); - - if ( (LA48_0==13) ) { - alt48=1; - } - switch (alt48) { - case 1 : - // InternalProblem.g:2311:6: kw= '.' this_INT_5= RULE_INT - { - kw=(Token)match(input,13,FOLLOW_17); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getFullStopKeyword_2_1_0_0()); - - this_INT_5=(Token)match(input,RULE_INT,FOLLOW_40); - - current.merge(this_INT_5); - + this_INT_2=(Token)match(input,RULE_INT,FOLLOW_4); - newLeafNode(this_INT_5, grammarAccess.getRealAccess().getINTTerminalRuleCall_2_1_0_1()); - - - } - break; + current.merge(this_INT_2); + - } + newLeafNode(this_INT_2, grammarAccess.getRealAccess().getINTTerminalRuleCall_1_1_0()); + + kw=(Token)match(input,14,FOLLOW_39); - // InternalProblem.g:2324:5: (kw= 'e' | kw= 'E' ) - int alt49=2; - int LA49_0 = input.LA(1); + current.merge(kw); + newLeafNode(kw, grammarAccess.getRealAccess().getFullStopKeyword_1_1_1()); + + // InternalProblem.g:2290:5: (this_INT_4= RULE_INT | this_EXPONENTIAL_5= RULE_EXPONENTIAL ) + int alt48=2; + int LA48_0 = input.LA(1); - if ( (LA49_0==43) ) { - alt49=1; + if ( (LA48_0==RULE_INT) ) { + alt48=1; } - else if ( (LA49_0==44) ) { - alt49=2; + else if ( (LA48_0==RULE_EXPONENTIAL) ) { + alt48=2; } else { NoViableAltException nvae = - new NoViableAltException("", 49, 0, input); + new NoViableAltException("", 48, 0, input); throw nvae; } - switch (alt49) { + switch (alt48) { case 1 : - // InternalProblem.g:2325:6: kw= 'e' + // InternalProblem.g:2291:6: this_INT_4= RULE_INT { - kw=(Token)match(input,43,FOLLOW_41); + this_INT_4=(Token)match(input,RULE_INT,FOLLOW_2); - current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getEKeyword_2_1_1_0()); + current.merge(this_INT_4); - } - break; - case 2 : - // InternalProblem.g:2331:6: kw= 'E' - { - kw=(Token)match(input,44,FOLLOW_41); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getEKeyword_2_1_1_1()); + newLeafNode(this_INT_4, grammarAccess.getRealAccess().getINTTerminalRuleCall_1_1_2_0()); } break; - - } - - // InternalProblem.g:2337:5: (kw= '-' | kw= '+' )? - int alt50=3; - int LA50_0 = input.LA(1); - - if ( (LA50_0==45) ) { - alt50=1; - } - else if ( (LA50_0==33) ) { - alt50=2; - } - switch (alt50) { - case 1 : - // InternalProblem.g:2338:6: kw= '-' + case 2 : + // InternalProblem.g:2299:6: this_EXPONENTIAL_5= RULE_EXPONENTIAL { - kw=(Token)match(input,45,FOLLOW_17); + this_EXPONENTIAL_5=(Token)match(input,RULE_EXPONENTIAL,FOLLOW_2); - current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getHyphenMinusKeyword_2_1_2_0()); + current.merge(this_EXPONENTIAL_5); - } - break; - case 2 : - // InternalProblem.g:2344:6: kw= '+' - { - kw=(Token)match(input,33,FOLLOW_17); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getRealAccess().getPlusSignKeyword_2_1_2_1()); + newLeafNode(this_EXPONENTIAL_5, grammarAccess.getRealAccess().getEXPONENTIALTerminalRuleCall_1_1_2_1()); } @@ -6510,13 +6346,6 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } - this_INT_10=(Token)match(input,RULE_INT,FOLLOW_2); - - current.merge(this_INT_10); - - - newLeafNode(this_INT_10, grammarAccess.getRealAccess().getINTTerminalRuleCall_2_1_3()); - } @@ -6542,9 +6371,6 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { appendSkippedTokens(); } finally { - - myHiddenTokenState.restore(); - } return current; } @@ -6552,7 +6378,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleLogicValue" - // InternalProblem.g:2366:1: ruleLogicValue returns [Enumerator current=null] : ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) ; + // InternalProblem.g:2313:1: ruleLogicValue returns [Enumerator current=null] : ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) ; public final Enumerator ruleLogicValue() throws RecognitionException { Enumerator current = null; @@ -6564,42 +6390,42 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalProblem.g:2372:2: ( ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) ) - // InternalProblem.g:2373:2: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) + // InternalProblem.g:2319:2: ( ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) ) + // InternalProblem.g:2320:2: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) { - // InternalProblem.g:2373:2: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) - int alt52=3; + // InternalProblem.g:2320:2: ( (enumLiteral_0= 'true' ) | (enumLiteral_1= 'false' ) | (enumLiteral_2= 'unknown' ) ) + int alt50=3; switch ( input.LA(1) ) { - case 41: + case 42: { - alt52=1; + alt50=1; } break; - case 42: + case 43: { - alt52=2; + alt50=2; } break; - case 46: + case 45: { - alt52=3; + alt50=3; } break; default: NoViableAltException nvae = - new NoViableAltException("", 52, 0, input); + new NoViableAltException("", 50, 0, input); throw nvae; } - switch (alt52) { + switch (alt50) { case 1 : - // InternalProblem.g:2374:3: (enumLiteral_0= 'true' ) + // InternalProblem.g:2321:3: (enumLiteral_0= 'true' ) { - // InternalProblem.g:2374:3: (enumLiteral_0= 'true' ) - // InternalProblem.g:2375:4: enumLiteral_0= 'true' + // InternalProblem.g:2321:3: (enumLiteral_0= 'true' ) + // InternalProblem.g:2322:4: enumLiteral_0= 'true' { - enumLiteral_0=(Token)match(input,41,FOLLOW_2); + enumLiteral_0=(Token)match(input,42,FOLLOW_2); current = grammarAccess.getLogicValueAccess().getTRUEEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); newLeafNode(enumLiteral_0, grammarAccess.getLogicValueAccess().getTRUEEnumLiteralDeclaration_0()); @@ -6611,12 +6437,12 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } break; case 2 : - // InternalProblem.g:2382:3: (enumLiteral_1= 'false' ) + // InternalProblem.g:2329:3: (enumLiteral_1= 'false' ) { - // InternalProblem.g:2382:3: (enumLiteral_1= 'false' ) - // InternalProblem.g:2383:4: enumLiteral_1= 'false' + // InternalProblem.g:2329:3: (enumLiteral_1= 'false' ) + // InternalProblem.g:2330:4: enumLiteral_1= 'false' { - enumLiteral_1=(Token)match(input,42,FOLLOW_2); + enumLiteral_1=(Token)match(input,43,FOLLOW_2); current = grammarAccess.getLogicValueAccess().getFALSEEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); newLeafNode(enumLiteral_1, grammarAccess.getLogicValueAccess().getFALSEEnumLiteralDeclaration_1()); @@ -6628,12 +6454,12 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } break; case 3 : - // InternalProblem.g:2390:3: (enumLiteral_2= 'unknown' ) + // InternalProblem.g:2337:3: (enumLiteral_2= 'unknown' ) { - // InternalProblem.g:2390:3: (enumLiteral_2= 'unknown' ) - // InternalProblem.g:2391:4: enumLiteral_2= 'unknown' + // InternalProblem.g:2337:3: (enumLiteral_2= 'unknown' ) + // InternalProblem.g:2338:4: enumLiteral_2= 'unknown' { - enumLiteral_2=(Token)match(input,46,FOLLOW_2); + enumLiteral_2=(Token)match(input,45,FOLLOW_2); current = grammarAccess.getLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_2().getEnumLiteral().getInstance(); newLeafNode(enumLiteral_2, grammarAccess.getLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_2()); @@ -6667,7 +6493,7 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleShortLogicValue" - // InternalProblem.g:2401:1: ruleShortLogicValue returns [Enumerator current=null] : ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) ; + // InternalProblem.g:2348:1: ruleShortLogicValue returns [Enumerator current=null] : ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) ; public final Enumerator ruleShortLogicValue() throws RecognitionException { Enumerator current = null; @@ -6678,33 +6504,33 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalProblem.g:2407:2: ( ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) ) - // InternalProblem.g:2408:2: ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) + // InternalProblem.g:2354:2: ( ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) ) + // InternalProblem.g:2355:2: ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) { - // InternalProblem.g:2408:2: ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) - int alt53=2; - int LA53_0 = input.LA(1); + // InternalProblem.g:2355:2: ( (enumLiteral_0= '!' ) | (enumLiteral_1= '?' ) ) + int alt51=2; + int LA51_0 = input.LA(1); - if ( (LA53_0==32) ) { - alt53=1; + if ( (LA51_0==33) ) { + alt51=1; } - else if ( (LA53_0==47) ) { - alt53=2; + else if ( (LA51_0==46) ) { + alt51=2; } else { NoViableAltException nvae = - new NoViableAltException("", 53, 0, input); + new NoViableAltException("", 51, 0, input); throw nvae; } - switch (alt53) { + switch (alt51) { case 1 : - // InternalProblem.g:2409:3: (enumLiteral_0= '!' ) + // InternalProblem.g:2356:3: (enumLiteral_0= '!' ) { - // InternalProblem.g:2409:3: (enumLiteral_0= '!' ) - // InternalProblem.g:2410:4: enumLiteral_0= '!' + // InternalProblem.g:2356:3: (enumLiteral_0= '!' ) + // InternalProblem.g:2357:4: enumLiteral_0= '!' { - enumLiteral_0=(Token)match(input,32,FOLLOW_2); + enumLiteral_0=(Token)match(input,33,FOLLOW_2); current = grammarAccess.getShortLogicValueAccess().getFALSEEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); newLeafNode(enumLiteral_0, grammarAccess.getShortLogicValueAccess().getFALSEEnumLiteralDeclaration_0()); @@ -6716,12 +6542,12 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { } break; case 2 : - // InternalProblem.g:2417:3: (enumLiteral_1= '?' ) + // InternalProblem.g:2364:3: (enumLiteral_1= '?' ) { - // InternalProblem.g:2417:3: (enumLiteral_1= '?' ) - // InternalProblem.g:2418:4: enumLiteral_1= '?' + // InternalProblem.g:2364:3: (enumLiteral_1= '?' ) + // InternalProblem.g:2365:4: enumLiteral_1= '?' { - enumLiteral_1=(Token)match(input,47,FOLLOW_2); + enumLiteral_1=(Token)match(input,46,FOLLOW_2); current = grammarAccess.getShortLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); newLeafNode(enumLiteral_1, grammarAccess.getShortLogicValueAccess().getUNKNOWNEnumLiteralDeclaration_1()); @@ -6758,31 +6584,27 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { protected DFA3 dfa3 = new DFA3(this); protected DFA35 dfa35 = new DFA35(this); - static final String dfa_1s = "\23\uffff"; - static final String dfa_2s = "\1\5\3\uffff\6\35\3\uffff\1\5\5\35"; - static final String dfa_3s = "\1\57\3\uffff\1\42\5\50\3\uffff\1\54\5\50"; - static final String dfa_4s = "\1\uffff\1\1\1\2\1\3\6\uffff\1\4\1\6\1\5\6\uffff"; - static final String dfa_5s = "\23\uffff}>"; + static final String dfa_1s = "\17\uffff"; + static final String dfa_2s = "\1\5\3\uffff\4\36\3\uffff\1\5\3\36"; + static final String dfa_3s = "\1\56\3\uffff\1\43\3\51\3\uffff\1\53\3\51"; + static final String dfa_4s = "\1\uffff\1\1\1\2\1\3\4\uffff\1\4\1\6\1\5\4\uffff"; + static final String dfa_5s = "\17\uffff}>"; static final String[] dfa_6s = { - "\1\5\1\uffff\1\4\6\uffff\2\1\5\uffff\1\2\5\uffff\2\3\3\uffff\1\12\2\uffff\1\13\5\uffff\1\6\1\7\1\10\1\11\2\uffff\1\12", + "\1\5\1\uffff\1\4\7\uffff\2\1\5\uffff\1\2\5\uffff\2\3\3\uffff\1\10\2\uffff\1\11\5\uffff\1\6\1\7\2\uffff\1\10", "", "", "", - "\1\12\4\uffff\1\14", - "\1\12\4\uffff\1\14\5\uffff\1\15", - "\1\12\4\uffff\1\14\5\uffff\1\15", - "\1\12\4\uffff\1\14\5\uffff\1\15", - "\1\12\4\uffff\1\14\5\uffff\1\15", - "\1\12\4\uffff\1\14\5\uffff\1\15", + "\1\10\4\uffff\1\12", + "\1\10\4\uffff\1\12\5\uffff\1\13", + "\1\10\4\uffff\1\12\5\uffff\1\13", + "\1\10\4\uffff\1\12\5\uffff\1\13", "", "", "", - "\1\16\43\uffff\1\17\1\20\1\21\1\22", - "\1\12\4\uffff\1\14\5\uffff\1\15", - "\1\12\4\uffff\1\14\5\uffff\1\15", - "\1\12\4\uffff\1\14\5\uffff\1\15", - "\1\12\4\uffff\1\14\5\uffff\1\15", - "\1\12\4\uffff\1\14\5\uffff\1\15" + "\1\14\44\uffff\1\15\1\16", + "\1\10\4\uffff\1\12\5\uffff\1\13", + "\1\10\4\uffff\1\12\5\uffff\1\13", + "\1\10\4\uffff\1\12\5\uffff\1\13" }; static final short[] dfa_1 = DFA.unpackEncodedString(dfa_1s); @@ -6809,74 +6631,56 @@ public class InternalProblemParser extends AbstractInternalAntlrParser { return "146:2: (this_ClassDeclaration_0= ruleClassDeclaration | this_EnumDeclaration_1= ruleEnumDeclaration | this_PredicateDefinition_2= rulePredicateDefinition | this_Assertion_3= ruleAssertion | this_NodeValueAssertion_4= ruleNodeValueAssertion | this_ScopeDeclaration_5= ruleScopeDeclaration )"; } } - static final String dfa_7s = "\76\uffff"; - static final String dfa_8s = "\1\5\6\35\1\uffff\1\4\1\5\6\21\1\6\1\15\1\21\1\15\5\35\1\4\1\5\3\6\1\uffff\6\21\1\6\1\15\7\21\2\6\1\21\1\5\3\6\6\21\2\6\1\21"; - static final String dfa_9s = "\1\57\1\35\5\50\1\uffff\1\55\1\54\1\36\5\50\1\6\1\54\1\36\1\42\5\50\1\55\1\54\1\6\2\55\1\uffff\1\36\5\50\1\6\1\54\1\36\5\50\1\54\2\6\1\36\1\54\1\6\2\55\5\50\1\54\2\6\1\36"; - static final String dfa_10s = "\7\uffff\1\2\26\uffff\1\1\37\uffff"; - static final String dfa_11s = "\76\uffff}>"; + static final String dfa_7s = "\54\uffff"; + static final String dfa_8s = "\1\5\4\36\1\uffff\1\4\1\5\4\22\1\6\1\22\1\16\1\22\1\16\3\36\1\4\1\5\1\6\1\uffff\4\22\1\6\1\22\1\16\6\22\1\5\1\6\5\22"; + static final String dfa_9s = "\1\56\1\36\3\51\1\uffff\1\54\1\53\1\37\3\51\1\10\3\37\1\43\3\51\1\54\1\53\1\10\1\uffff\1\37\3\51\1\10\3\37\3\51\2\37\1\53\1\10\3\51\2\37"; + static final String dfa_10s = "\5\uffff\1\2\21\uffff\1\1\24\uffff"; + static final String dfa_11s = "\54\uffff}>"; static final String[] dfa_12s = { - "\1\2\1\uffff\1\1\30\uffff\1\7\10\uffff\1\3\1\4\1\5\1\6\2\uffff\1\7", - "\1\10", - "\1\10\12\uffff\1\11", - "\1\10\12\uffff\1\11", - "\1\10\12\uffff\1\11", - "\1\10\12\uffff\1\11", - "\1\10\12\uffff\1\11", + "\1\2\1\uffff\1\1\31\uffff\1\5\10\uffff\1\3\1\4\2\uffff\1\5", + "\1\6", + "\1\6\12\uffff\1\7", + "\1\6\12\uffff\1\7", + "\1\6\12\uffff\1\7", "", - "\1\22\1\13\1\21\1\12\26\uffff\1\23\12\uffff\1\14\1\15\1\16\1\17\1\20", - "\1\24\43\uffff\1\25\1\26\1\27\1\30", - "\1\31\14\uffff\1\23", - "\1\31\14\uffff\1\23\11\uffff\1\32", - "\1\31\14\uffff\1\23\11\uffff\1\32", - "\1\31\14\uffff\1\23\11\uffff\1\32", - "\1\31\14\uffff\1\23\11\uffff\1\32", - "\1\31\14\uffff\1\23\11\uffff\1\32", - "\1\21", - "\1\33\3\uffff\1\31\14\uffff\1\23\14\uffff\1\34\1\35", - "\1\31\14\uffff\1\23", - "\1\7\24\uffff\1\36", - "\1\10\12\uffff\1\11", - "\1\10\12\uffff\1\11", - "\1\10\12\uffff\1\11", - "\1\10\12\uffff\1\11", - "\1\10\12\uffff\1\11", - "\1\47\1\40\1\46\1\37\41\uffff\1\41\1\42\1\43\1\44\1\45", - "\1\50\43\uffff\1\51\1\52\1\53\1\54", - "\1\55", - "\1\60\32\uffff\1\57\13\uffff\1\56", - "\1\60\32\uffff\1\57\13\uffff\1\56", + "\1\17\1\11\1\16\1\10\1\15\26\uffff\1\20\12\uffff\1\12\1\13\1\14", + "\1\21\44\uffff\1\22\1\23", + "\1\24\14\uffff\1\20", + "\1\24\14\uffff\1\20\11\uffff\1\25", + "\1\24\14\uffff\1\20\11\uffff\1\25", + "\1\24\14\uffff\1\20\11\uffff\1\25", + "\1\16\1\uffff\1\15", + "\1\24\14\uffff\1\20", + "\1\26\3\uffff\1\24\14\uffff\1\20", + "\1\24\14\uffff\1\20", + "\1\5\24\uffff\1\27", + "\1\6\12\uffff\1\7", + "\1\6\12\uffff\1\7", + "\1\6\12\uffff\1\7", + "\1\37\1\31\1\36\1\30\1\35\41\uffff\1\32\1\33\1\34", + "\1\40\44\uffff\1\41\1\42", + "\1\43\1\uffff\1\44", "", - "\1\31\14\uffff\1\23", - "\1\31\14\uffff\1\23\11\uffff\1\61", - "\1\31\14\uffff\1\23\11\uffff\1\61", - "\1\31\14\uffff\1\23\11\uffff\1\61", - "\1\31\14\uffff\1\23\11\uffff\1\61", - "\1\31\14\uffff\1\23\11\uffff\1\61", - "\1\46", - "\1\62\3\uffff\1\31\14\uffff\1\23\14\uffff\1\63\1\64", - "\1\31\14\uffff\1\23", - "\1\31\14\uffff\1\23\11\uffff\1\32", - "\1\31\14\uffff\1\23\11\uffff\1\32", - "\1\31\14\uffff\1\23\11\uffff\1\32", - "\1\31\14\uffff\1\23\11\uffff\1\32", - "\1\31\14\uffff\1\23\11\uffff\1\32", - "\1\31\14\uffff\1\23\14\uffff\1\34\1\35", - "\1\60", - "\1\60", - "\1\31\14\uffff\1\23", - "\1\65\43\uffff\1\66\1\67\1\70\1\71", - "\1\72", - "\1\75\32\uffff\1\74\13\uffff\1\73", - "\1\75\32\uffff\1\74\13\uffff\1\73", - "\1\31\14\uffff\1\23\11\uffff\1\61", - "\1\31\14\uffff\1\23\11\uffff\1\61", - "\1\31\14\uffff\1\23\11\uffff\1\61", - "\1\31\14\uffff\1\23\11\uffff\1\61", - "\1\31\14\uffff\1\23\11\uffff\1\61", - "\1\31\14\uffff\1\23\14\uffff\1\63\1\64", - "\1\75", - "\1\75", - "\1\31\14\uffff\1\23" + "\1\24\14\uffff\1\20", + "\1\24\14\uffff\1\20\11\uffff\1\45", + "\1\24\14\uffff\1\20\11\uffff\1\45", + "\1\24\14\uffff\1\20\11\uffff\1\45", + "\1\36\1\uffff\1\35", + "\1\24\14\uffff\1\20", + "\1\46\3\uffff\1\24\14\uffff\1\20", + "\1\24\14\uffff\1\20", + "\1\24\14\uffff\1\20\11\uffff\1\25", + "\1\24\14\uffff\1\20\11\uffff\1\25", + "\1\24\14\uffff\1\20\11\uffff\1\25", + "\1\24\14\uffff\1\20", + "\1\24\14\uffff\1\20", + "\1\47\44\uffff\1\50\1\51", + "\1\52\1\uffff\1\53", + "\1\24\14\uffff\1\20\11\uffff\1\45", + "\1\24\14\uffff\1\20\11\uffff\1\45", + "\1\24\14\uffff\1\20\11\uffff\1\45", + "\1\24\14\uffff\1\20", + "\1\24\14\uffff\1\20" }; static final short[] dfa_7 = DFA.unpackEncodedString(dfa_7s); @@ -6907,44 +6711,42 @@ 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[]{0x00001E0000000020L}); - public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000002000L}); - public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x00009E091820C0A2L}); - 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[]{0x00001E00000000A0L}); - public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x0000000000062000L}); - public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x00001E0000D000A0L}); - public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x00001E0000D800A0L}); - public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x0000000000042000L}); - public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x00001E0000100020L}); - 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[]{0x00001E0001000020L}); + public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x00000C0000000020L}); + public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000004000L}); + public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x00004C12304180A2L}); + public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000010000L}); + public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x00000000000A4000L}); + public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x00000C00000000A0L}); + public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x00000000000C4000L}); + public static final BitSet FOLLOW_10 = new BitSet(new long[]{0x00000C0001A000A0L}); + public static final BitSet FOLLOW_11 = new BitSet(new long[]{0x00000C0001B000A0L}); + public static final BitSet FOLLOW_12 = new BitSet(new long[]{0x0000000000084000L}); + public static final BitSet FOLLOW_13 = new BitSet(new long[]{0x00000C0000200020L}); + public static final BitSet FOLLOW_14 = new BitSet(new long[]{0x0000000000340000L}); + public static final BitSet FOLLOW_15 = new BitSet(new long[]{0x0000000000200000L}); + public static final BitSet FOLLOW_16 = new BitSet(new long[]{0x00000C0002000020L}); public static final BitSet FOLLOW_17 = new BitSet(new long[]{0x0000000000000040L}); - 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[]{0x00001E0010000020L}); - public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x0000000020000000L}); - public static final BitSet FOLLOW_22 = new BitSet(new long[]{0x00001E00400000A0L}); - 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[]{0x00001E01000000A0L}); - 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[]{0x00003E00400000F0L}); - public static final BitSet FOLLOW_30 = new BitSet(new long[]{0x00003E00000000F0L}); - public static final BitSet FOLLOW_31 = new BitSet(new long[]{0x0000000400000000L}); - public static final BitSet FOLLOW_32 = new BitSet(new long[]{0x0000460000000000L}); + public static final BitSet FOLLOW_18 = new BitSet(new long[]{0x0000000004000000L}); + public static final BitSet FOLLOW_19 = new BitSet(new long[]{0x0000000008000002L}); + public static final BitSet FOLLOW_20 = new BitSet(new long[]{0x00000C0020000020L}); + public static final BitSet FOLLOW_21 = new BitSet(new long[]{0x0000000040000000L}); + public static final BitSet FOLLOW_22 = new BitSet(new long[]{0x00000C00800000A0L}); + public static final BitSet FOLLOW_23 = new BitSet(new long[]{0x0000000080040000L}); + public static final BitSet FOLLOW_24 = new BitSet(new long[]{0x0000000100004000L}); + public static final BitSet FOLLOW_25 = new BitSet(new long[]{0x00000C02000000A0L}); + public static final BitSet FOLLOW_26 = new BitSet(new long[]{0x0000000000104000L}); + public static final BitSet FOLLOW_27 = new BitSet(new long[]{0x0000000000040002L}); + public static final BitSet FOLLOW_28 = new BitSet(new long[]{0x0000000440000000L}); + public static final BitSet FOLLOW_29 = new BitSet(new long[]{0x00001C00800001F0L}); + public static final BitSet FOLLOW_30 = new BitSet(new long[]{0x00001C00000001F0L}); + public static final BitSet FOLLOW_31 = new BitSet(new long[]{0x0000000800000000L}); + public static final BitSet FOLLOW_32 = new BitSet(new long[]{0x00002C0000000000L}); public static final BitSet FOLLOW_33 = new BitSet(new long[]{0x0000000000000020L}); - public static final BitSet FOLLOW_34 = new BitSet(new long[]{0x0000000000022000L}); - public static final BitSet FOLLOW_35 = new BitSet(new long[]{0x0000003000000000L}); - public static final BitSet FOLLOW_36 = new BitSet(new long[]{0x0000004000000000L}); - public static final BitSet FOLLOW_37 = new BitSet(new long[]{0x0000008000000040L}); - public static final BitSet FOLLOW_38 = new BitSet(new long[]{0x0000010000000002L}); - public static final BitSet FOLLOW_39 = new BitSet(new long[]{0x0000180000002000L}); - public static final BitSet FOLLOW_40 = new BitSet(new long[]{0x0000180000000000L}); - public static final BitSet FOLLOW_41 = new BitSet(new long[]{0x0000200200000040L}); + public static final BitSet FOLLOW_34 = new BitSet(new long[]{0x0000000000044000L}); + public static final BitSet FOLLOW_35 = new BitSet(new long[]{0x0000006000000000L}); + public static final BitSet FOLLOW_36 = new BitSet(new long[]{0x0000008000000000L}); + public static final BitSet FOLLOW_37 = new BitSet(new long[]{0x0000010000000040L}); + public static final BitSet FOLLOW_38 = new BitSet(new long[]{0x0000020000000002L}); + public static final BitSet FOLLOW_39 = new BitSet(new long[]{0x0000000000000140L}); } \ 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 603f12e3..01188c37 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 @@ -1026,22 +1026,22 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE public class ConstantElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Constant"); private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); - private final RuleCall cIntConstantParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0); - private final RuleCall cRealConstantParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1); + private final RuleCall cRealConstantParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0); + private final RuleCall cIntConstantParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1); private final RuleCall cStringConstantParserRuleCall_2 = (RuleCall)cAlternatives.eContents().get(2); //Constant: - // IntConstant | RealConstant | StringConstant; + // RealConstant | IntConstant | StringConstant; @Override public ParserRule getRule() { return rule; } - //IntConstant | RealConstant | StringConstant + //RealConstant | IntConstant | StringConstant public Alternatives getAlternatives() { return cAlternatives; } - //IntConstant - public RuleCall getIntConstantParserRuleCall_0() { return cIntConstantParserRuleCall_0; } - //RealConstant - public RuleCall getRealConstantParserRuleCall_1() { return cRealConstantParserRuleCall_1; } + public RuleCall getRealConstantParserRuleCall_0() { return cRealConstantParserRuleCall_0; } + + //IntConstant + public RuleCall getIntConstantParserRuleCall_1() { return cIntConstantParserRuleCall_1; } //StringConstant public RuleCall getStringConstantParserRuleCall_2() { return cStringConstantParserRuleCall_2; } @@ -1340,14 +1340,12 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE private final RuleCall cIDTerminalRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0); private final Keyword cTrueKeyword_1 = (Keyword)cAlternatives.eContents().get(1); private final Keyword cFalseKeyword_2 = (Keyword)cAlternatives.eContents().get(2); - private final Keyword cEKeyword_3 = (Keyword)cAlternatives.eContents().get(3); - private final Keyword cEKeyword_4 = (Keyword)cAlternatives.eContents().get(4); //Identifier: - // ID | "true" | "false" | "e" | "E"; + // ID | "true" | "false"; @Override public ParserRule getRule() { return rule; } - //ID | "true" | "false" | "e" | "E" + //ID | "true" | "false" public Alternatives getAlternatives() { return cAlternatives; } //ID @@ -1358,12 +1356,6 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE //"false" public Keyword getFalseKeyword_2() { return cFalseKeyword_2; } - - //"e" - public Keyword getEKeyword_3() { return cEKeyword_3; } - - //"E" - public Keyword getEKeyword_4() { return cEKeyword_4; } } public class IntegerElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Integer"); @@ -1388,80 +1380,48 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.Real"); private final Group cGroup = (Group)rule.eContents().get(1); private final Keyword cHyphenMinusKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final RuleCall cINTTerminalRuleCall_1 = (RuleCall)cGroup.eContents().get(1); - private final Alternatives cAlternatives_2 = (Alternatives)cGroup.eContents().get(2); - private final Group cGroup_2_0 = (Group)cAlternatives_2.eContents().get(0); - private final Keyword cFullStopKeyword_2_0_0 = (Keyword)cGroup_2_0.eContents().get(0); - private final RuleCall cINTTerminalRuleCall_2_0_1 = (RuleCall)cGroup_2_0.eContents().get(1); - private final Group cGroup_2_1 = (Group)cAlternatives_2.eContents().get(1); - private final Group cGroup_2_1_0 = (Group)cGroup_2_1.eContents().get(0); - private final Keyword cFullStopKeyword_2_1_0_0 = (Keyword)cGroup_2_1_0.eContents().get(0); - private final RuleCall cINTTerminalRuleCall_2_1_0_1 = (RuleCall)cGroup_2_1_0.eContents().get(1); - private final Alternatives cAlternatives_2_1_1 = (Alternatives)cGroup_2_1.eContents().get(1); - private final Keyword cEKeyword_2_1_1_0 = (Keyword)cAlternatives_2_1_1.eContents().get(0); - private final Keyword cEKeyword_2_1_1_1 = (Keyword)cAlternatives_2_1_1.eContents().get(1); - private final Alternatives cAlternatives_2_1_2 = (Alternatives)cGroup_2_1.eContents().get(2); - private final Keyword cHyphenMinusKeyword_2_1_2_0 = (Keyword)cAlternatives_2_1_2.eContents().get(0); - private final Keyword cPlusSignKeyword_2_1_2_1 = (Keyword)cAlternatives_2_1_2.eContents().get(1); - private final RuleCall cINTTerminalRuleCall_2_1_3 = (RuleCall)cGroup_2_1.eContents().get(3); - - //Real returns ecore::EDouble hidden(): - // "-"? INT ("." INT | ("." INT)? ("e" | "E") ("-" | "+")? INT); + private final Alternatives cAlternatives_1 = (Alternatives)cGroup.eContents().get(1); + private final RuleCall cEXPONENTIALTerminalRuleCall_1_0 = (RuleCall)cAlternatives_1.eContents().get(0); + private final Group cGroup_1_1 = (Group)cAlternatives_1.eContents().get(1); + private final RuleCall cINTTerminalRuleCall_1_1_0 = (RuleCall)cGroup_1_1.eContents().get(0); + private final Keyword cFullStopKeyword_1_1_1 = (Keyword)cGroup_1_1.eContents().get(1); + private final Alternatives cAlternatives_1_1_2 = (Alternatives)cGroup_1_1.eContents().get(2); + private final RuleCall cINTTerminalRuleCall_1_1_2_0 = (RuleCall)cAlternatives_1_1_2.eContents().get(0); + private final RuleCall cEXPONENTIALTerminalRuleCall_1_1_2_1 = (RuleCall)cAlternatives_1_1_2.eContents().get(1); + + //Real returns ecore::EDouble: + // "-"? (EXPONENTIAL | INT "." (INT | EXPONENTIAL)); @Override public ParserRule getRule() { return rule; } - //"-"? INT ("." INT | ("." INT)? ("e" | "E") ("-" | "+")? INT) + //"-"? (EXPONENTIAL | INT "." (INT | EXPONENTIAL)) public Group getGroup() { return cGroup; } //"-"? public Keyword getHyphenMinusKeyword_0() { return cHyphenMinusKeyword_0; } - //INT - public RuleCall getINTTerminalRuleCall_1() { return cINTTerminalRuleCall_1; } - - //("." INT | ("." INT)? ("e" | "E") ("-" | "+")? INT) - public Alternatives getAlternatives_2() { return cAlternatives_2; } + //(EXPONENTIAL | INT "." (INT | EXPONENTIAL)) + public Alternatives getAlternatives_1() { return cAlternatives_1; } - //"." INT - public Group getGroup_2_0() { return cGroup_2_0; } + //EXPONENTIAL + public RuleCall getEXPONENTIALTerminalRuleCall_1_0() { return cEXPONENTIALTerminalRuleCall_1_0; } - //"." - public Keyword getFullStopKeyword_2_0_0() { return cFullStopKeyword_2_0_0; } + //INT "." (INT | EXPONENTIAL) + public Group getGroup_1_1() { return cGroup_1_1; } //INT - public RuleCall getINTTerminalRuleCall_2_0_1() { return cINTTerminalRuleCall_2_0_1; } - - //("." INT)? ("e" | "E") ("-" | "+")? INT - public Group getGroup_2_1() { return cGroup_2_1; } - - //("." INT)? - public Group getGroup_2_1_0() { return cGroup_2_1_0; } + public RuleCall getINTTerminalRuleCall_1_1_0() { return cINTTerminalRuleCall_1_1_0; } //"." - public Keyword getFullStopKeyword_2_1_0_0() { return cFullStopKeyword_2_1_0_0; } - - //INT - public RuleCall getINTTerminalRuleCall_2_1_0_1() { return cINTTerminalRuleCall_2_1_0_1; } - - //("e" | "E") - public Alternatives getAlternatives_2_1_1() { return cAlternatives_2_1_1; } - - //"e" - public Keyword getEKeyword_2_1_1_0() { return cEKeyword_2_1_1_0; } + public Keyword getFullStopKeyword_1_1_1() { return cFullStopKeyword_1_1_1; } - //"E" - public Keyword getEKeyword_2_1_1_1() { return cEKeyword_2_1_1_1; } - - //("-" | "+")? - public Alternatives getAlternatives_2_1_2() { return cAlternatives_2_1_2; } - - //"-" - public Keyword getHyphenMinusKeyword_2_1_2_0() { return cHyphenMinusKeyword_2_1_2_0; } - - //"+" - public Keyword getPlusSignKeyword_2_1_2_1() { return cPlusSignKeyword_2_1_2_1; } + //(INT | EXPONENTIAL) + public Alternatives getAlternatives_1_1_2() { return cAlternatives_1_1_2; } //INT - public RuleCall getINTTerminalRuleCall_2_1_3() { return cINTTerminalRuleCall_2_1_3; } + public RuleCall getINTTerminalRuleCall_1_1_2_0() { return cINTTerminalRuleCall_1_1_2_0; } + + //EXPONENTIAL + public RuleCall getEXPONENTIALTerminalRuleCall_1_1_2_1() { return cEXPONENTIALTerminalRuleCall_1_1_2_1; } } public class LogicValueElements extends AbstractElementFinder.AbstractEnumRuleElementFinder { @@ -1566,6 +1526,7 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE private final IntegerElements pInteger; private final RealElements pReal; private final TerminalRule tID; + private final TerminalRule tEXPONENTIAL; private final TerminalRule tSTRING; private final TerminalRule tQUOTED_ID; private final TerminalRule tSL_COMMENT; @@ -1618,6 +1579,7 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE this.pInteger = new IntegerElements(); this.pReal = new RealElements(); this.tID = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.ID"); + this.tEXPONENTIAL = (TerminalRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.viatra.solver.language.Problem.EXPONENTIAL"); 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"); @@ -1893,7 +1855,7 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE } //Constant: - // IntConstant | RealConstant | StringConstant; + // RealConstant | IntConstant | StringConstant; public ConstantElements getConstantAccess() { return pConstant; } @@ -2025,7 +1987,7 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE } //Identifier: - // ID | "true" | "false" | "e" | "E"; + // ID | "true" | "false"; public IdentifierElements getIdentifierAccess() { return pIdentifier; } @@ -2044,8 +2006,8 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE return getIntegerAccess().getRule(); } - //Real returns ecore::EDouble hidden(): - // "-"? INT ("." INT | ("." INT)? ("e" | "E") ("-" | "+")? INT); + //Real returns ecore::EDouble: + // "-"? (EXPONENTIAL | INT "." (INT | EXPONENTIAL)); public RealElements getRealAccess() { return pReal; } @@ -2061,6 +2023,12 @@ public class ProblemGrammarAccess extends AbstractElementFinder.AbstractGrammarE return tID; } + //terminal EXPONENTIAL: + // INT ("e" | "E") ("+" | "-")? INT; + public TerminalRule getEXPONENTIALRule() { + return tEXPONENTIAL; + } + //@Override //terminal STRING: // '"' ('\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\' | '"'))* '"'; diff --git a/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend index 9b1bb698..7a6eec6a 100644 --- a/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend +++ b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemParsingTest.xtend @@ -8,23 +8,55 @@ import org.eclipse.viatra.solver.language.model.problem.Problem import org.eclipse.xtext.testing.InjectWith import org.eclipse.xtext.testing.extensions.InjectionExtension import org.eclipse.xtext.testing.util.ParseHelper -import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.junit.jupiter.api.^extension.ExtendWith +import static org.hamcrest.MatcherAssert.assertThat +import static org.hamcrest.Matchers.* + @ExtendWith(InjectionExtension) @InjectWith(ProblemInjectorProvider) class ProblemParsingTest { @Inject ParseHelper parseHelper + @Inject + extension ProblemTestUtil + @Test - def void loadModel() { - val result = parseHelper.parse(''' - Hello Xtext! + def void exampleTest() { + val it = parseHelper.parse(''' + class Family { + contains Person[] members + } + + class Person { + Person[0..*] children opposite parent + Person[0..1] parent opposite children + int age + TaxStatus taxStatus + } + + enum TaxStatus { + child, student, adult, retired + } + + % A child cannot have any dependents. + error invalidTaxStatus(Person p) :- + taxStatus(p, child), children(p, _q). + + Family('family'). + members('family', anne): true. + members('family', bob). + members('family', ciri). + children(anne, ciri). + ?children(bob, ciri). + taxStatus(anne, adult). + age(anne, 35). + bobAge: 27. + age(bob, bobAge). + !age(ciri, bobAge). ''') - Assertions.assertNotNull(result) - val errors = result.eResource.errors - Assertions.assertTrue(errors.isEmpty, '''Unexpected errors: «errors.join(", ")»''') + assertThat(errors, empty) } } diff --git a/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemScopingTest.xtend b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemScopingTest.xtend index 7872b0f7..7686e39e 100644 --- a/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemScopingTest.xtend +++ b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemScopingTest.xtend @@ -27,7 +27,8 @@ class ProblemScopingTest { def void builtInArgumentTypeTest() { val it = parseHelper.parse(''' pred predicate(node a, data b, int c). - ''').assertNoErrors + ''') + assertThat(errors, empty) assertThat(pred('predicate').param(0).parameterType, equalTo(builtin.findClass('node'))) assertThat(pred('predicate').param(1).parameterType, equalTo(builtin.findClass('data'))) assertThat(pred('predicate').param(2).parameterType, equalTo(builtin.findClass('int'))) @@ -37,7 +38,8 @@ class ProblemScopingTest { def void builtiQualifiedArgumentTypeTest() { val it = parseHelper.parse(''' pred predicate(builtin::node a, builtin::data b, builtin::int c). - ''').assertNoErrors + ''') + assertThat(errors, empty) assertThat(pred('predicate').param(0).parameterType, equalTo(builtin.findClass('node'))) assertThat(pred('predicate').param(1).parameterType, equalTo(builtin.findClass('data'))) assertThat(pred('predicate').param(2).parameterType, equalTo(builtin.findClass('int'))) @@ -49,7 +51,8 @@ class ProblemScopingTest { pred predicate(node a, node b). predicate(a, a). ?predicate(a, b). - ''').assertNoErrors + ''') + assertThat(errors, empty) assertThat(nodeNames, hasItems('a', 'b')) assertThat(assertion(0).arg(0).node, equalTo(node('a'))) assertThat(assertion(0).arg(1).node, equalTo(node('a'))) @@ -63,7 +66,8 @@ class ProblemScopingTest { pred predicate(node a, node b). predicate('a', 'a'). ?predicate('a', 'b'). - ''').assertNoErrors + ''') + assertThat(errors, empty) assertThat(nodeNames, hasItems("'a'", "'b'")) assertThat(assertion(0).arg(0).node, equalTo(node("'a'"))) assertThat(assertion(0).arg(1).node, equalTo(node("'a'"))) @@ -76,7 +80,8 @@ class ProblemScopingTest { val it = parseHelper.parse(''' pred predicate(node a). predicate(int::new). - ''').assertNoErrors + ''') + assertThat(errors, empty) assertThat(nodes, empty) assertThat(assertion(0).arg(0).node, equalTo(builtin.findClass('int').newNode)) } @@ -86,7 +91,8 @@ class ProblemScopingTest { val it = parseHelper.parse(''' pred predicate(node a). predicate(builtin::int::new). - ''').assertNoErrors + ''') + assertThat(errors, empty) assertThat(nodes, empty) assertThat(assertion(0).arg(0).node, equalTo(builtin.findClass('int').newNode)) } @@ -97,7 +103,8 @@ class ProblemScopingTest { class Foo. pred predicate(node a). predicate(Foo::new). - ''').assertNoErrors + ''') + assertThat(errors, empty) assertThat(nodes, empty) assertThat(assertion(0).arg(0).node, equalTo(findClass('Foo').newNode)) } @@ -110,7 +117,8 @@ class ProblemScopingTest { class Foo. pred predicate(node a). predicate(test::Foo::new). - ''').assertNoErrors + ''') + assertThat(errors, empty) assertThat(nodes, empty) assertThat(assertion(0).arg(0).node, equalTo(findClass('Foo').newNode)) } @@ -121,7 +129,8 @@ class ProblemScopingTest { class Foo. pred predicate(node a). predicate(new). - ''').assertNoErrors + ''') + assertThat(errors, empty) assertThat(nodeNames, hasItem('new')) assertThat(assertion(0).arg(0).node, not(equalTo(findClass('Foo').newNode))) } @@ -131,7 +140,8 @@ class ProblemScopingTest { val it = parseHelper.parse(''' pred predicate(node a) :- node(b). predicate(b). - ''').assertNoErrors + ''') + assertThat(errors, empty) assertThat(nodeNames, hasItem("b")) assertThat(pred("predicate").conj(0).lit(0).arg(0).node, equalTo(node("b"))) assertThat(assertion(0).arg(0).node, equalTo(node("b"))) @@ -141,7 +151,8 @@ class ProblemScopingTest { def void quotedNodeInPredicateTest() { val it = parseHelper.parse(''' pred predicate(node a) :- node('b'). - ''').assertNoErrors + ''') + assertThat(errors, empty) assertThat(nodeNames, hasItem("'b'")) assertThat(pred("predicate").conj(0).lit(0).arg(0).node, equalTo(node("'b'"))) } diff --git a/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemTestUtil.xtend b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemTestUtil.xtend index 98b53675..b16de2b5 100644 --- a/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemTestUtil.xtend +++ b/language/src/test/java/org/eclipse/viatra/solver/language/tests/ProblemTestUtil.xtend @@ -1,6 +1,5 @@ package org.eclipse.viatra.solver.language.tests -import org.eclipse.emf.ecore.util.EcoreUtil import org.eclipse.viatra.solver.language.ProblemUtil import org.eclipse.viatra.solver.language.model.problem.Argument import org.eclipse.viatra.solver.language.model.problem.Assertion @@ -17,19 +16,14 @@ import org.eclipse.viatra.solver.language.model.problem.PredicateDefinition import org.eclipse.viatra.solver.language.model.problem.Problem import org.eclipse.viatra.solver.language.model.problem.Variable import org.eclipse.viatra.solver.language.model.problem.VariableOrNodeArgument -import org.junit.jupiter.api.Assertions class ProblemTestUtil { def builtin(Problem it) { ProblemUtil.getBuiltInLibrary(it).get } - def assertNoErrors(Problem it) { - Assertions.assertNotNull(it) - EcoreUtil.resolveAll(it) - val errors = eResource.errors - Assertions.assertTrue(errors.isEmpty, '''Unexpected errors: «errors.join(", ")»''') - it + def errors(Problem it) { + eResource.errors } def nodeNames(Problem it) { -- cgit v1.2.3-54-g00ecf