From: Hannu Niemistö Date: Wed, 31 May 2017 07:33:42 +0000 (+0300) Subject: (refs #7250) Added new grammar rules for modular CHR rules X-Git-Tag: v1.31.0~339^2~5 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F84%2F584%2F1;p=simantics%2Fplatform.git (refs #7250) Added new grammar rules for modular CHR rules Change-Id: I55851a496fda5b1bc135a17d37f28770b36f5007 --- diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCL.grammar b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCL.grammar index 7551271af..b0911febe 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCL.grammar +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCL.grammar @@ -55,6 +55,7 @@ declaration WHERE ruleDeclarations # RuleDefinition | MAPPING_RELATION ID atype* # MappingRelationDefinition | bexp FOLLOWS ruleDeclarations # RelationDefinition + | RULESET ID WHERE statements # RulesetDefinition ; import @@ -200,6 +201,7 @@ statement | chrQuery IMPLIES chrQuery # CHRStatement | WHEN verboseChrQuery THEN_AFTER_WHEN verboseChrQuery # VerboseCHRStatement | CONSTRAINT ID atype* # ConstraintStatement + | INCLUDE ID aexp # LocalInclude ; chrQuery diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.flex b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.flex index b064a07ae..e673b294b 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.flex +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.flex @@ -84,6 +84,7 @@ char_literal = "'" ([^'\\\ufffd] | "\\" [^\ufffd]) "'" else { return sym(SCLTerminals.ELSE); } where { return sym(SCLTerminals.WHERE); } when { return sym(SCLTerminals.WHEN); } + ruleset { return sym(SCLTerminals.RULESET); } rule { return sym(SCLTerminals.RULE); } abstract{whitespace}rule { return sym(SCLTerminals.ABSTRACT_RULE); } extends { return sym(SCLTerminals.EXTENDS); } diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.java index a717005bc..5aad5eefe 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.java @@ -11,7 +11,7 @@ import gnu.trove.list.array.TIntArrayList; /** * This class is a scanner generated by * JFlex 1.6.1 - * from the specification file C:/Users/hannu/git/scl/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.flex + * from the specification file C:/GamsGui/git/platform/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLLexer.flex */ public class SCLLexer { @@ -76,17 +76,17 @@ public class SCLLexer { "\1\74\1\75\1\0\1\76\2\0\1\46\1\0\1\2"+ "\1\77\6\2\1\100\1\101\2\2\1\102\3\2\1\103"+ "\1\2\1\104\2\2\1\105\3\2\1\0\1\46\1\0"+ - "\2\2\1\106\11\2\1\107\1\2\1\110\1\2\1\111"+ - "\1\2\1\0\1\112\1\113\1\2\1\114\1\115\2\2"+ + "\3\2\1\106\11\2\1\107\1\2\1\110\1\2\1\111"+ + "\1\2\1\0\1\112\1\113\2\2\1\114\1\115\2\2"+ "\1\116\1\2\1\117\1\120\2\2\1\121\3\2\1\122"+ - "\2\2\1\123\2\2\1\124\1\125\1\0\4\2\1\126"+ - "\2\2\2\0\1\2\1\127\2\0\2\2\2\0\1\2"+ - "\2\0\1\130\1\2\2\0\1\131\2\0\1\2\4\0"+ - "\1\2\1\132\2\0\1\133\1\2\2\0\1\134\2\0"+ - "\1\135\1\0\1\136"; + "\1\123\2\2\1\124\2\2\1\125\1\126\1\0\4\2"+ + "\1\127\2\2\2\0\1\2\1\130\2\0\2\2\2\0"+ + "\1\2\2\0\1\131\1\2\2\0\1\132\2\0\1\2"+ + "\4\0\1\2\1\133\2\0\1\134\1\2\2\0\1\135"+ + "\2\0\1\136\1\0\1\137"; private static int [] zzUnpackAction() { - int [] result = new int[293]; + int [] result = new int[296]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -132,25 +132,25 @@ public class SCLLexer { "\0\370\0\u1876\0\u18b4\0\u18f2\0\u1930\0\u196e\0\u19ac\0\u19ea"+ "\0\u1a28\0\u1a66\0\u1aa4\0\u1ae2\0\u1b20\0\u1b5e\0\u1b9c\0\u1bda"+ "\0\u1c18\0\u1c56\0\u1c94\0\u1cd2\0\u1d10\0\u1d4e\0\370\0\272"+ - "\0\u1d8c\0\272\0\u1dca\0\u1e08\0\u01b2\0\u1e46\0\u1e84\0\370"+ - "\0\u1ec2\0\u1f00\0\u1f3e\0\u1f7c\0\u1fba\0\u1ff8\0\370\0\370"+ - "\0\u2036\0\u2074\0\370\0\u20b2\0\u20f0\0\u212e\0\370\0\u216c"+ - "\0\370\0\u21aa\0\u21e8\0\370\0\u2226\0\u2264\0\u22a2\0\u22e0"+ - "\0\272\0\u231e\0\u235c\0\u239a\0\u23d8\0\u2416\0\u2454\0\u2492"+ - "\0\u24d0\0\u250e\0\u254c\0\u258a\0\u25c8\0\u2606\0\370\0\u2644"+ - "\0\370\0\u2682\0\370\0\u26c0\0\u26fe\0\272\0\370\0\u273c"+ - "\0\370\0\370\0\u277a\0\u27b8\0\u27f6\0\u2834\0\370\0\370"+ - "\0\u2872\0\u28b0\0\u28ee\0\u292c\0\u296a\0\u29a8\0\272\0\u29e6"+ - "\0\u2a24\0\370\0\u2a62\0\u2aa0\0\370\0\370\0\u2ade\0\u2b1c"+ - "\0\u2b5a\0\u2b98\0\u2bd6\0\370\0\u2c14\0\u2c52\0\u2c90\0\u2cce"+ - "\0\u2d0c\0\370\0\u2d4a\0\u2d88\0\u2dc6\0\u2e04\0\u2e42\0\u2e80"+ - "\0\u2ebe\0\u2efc\0\u2f3a\0\370\0\u2f78\0\u2fb6\0\u2ff4\0\370"+ - "\0\u3032\0\u3070\0\u30ae\0\u30ec\0\u312a\0\u3168\0\u31a6\0\u31e4"+ - "\0\272\0\u3222\0\u3260\0\272\0\u329e\0\u32dc\0\u331a\0\370"+ - "\0\u3358\0\u3396\0\272\0\u33d4\0\272"; + "\0\u1d8c\0\272\0\u1dca\0\u1e08\0\u01b2\0\u1e46\0\u1e84\0\u1ec2"+ + "\0\u1f00\0\u1f3e\0\u1f7c\0\u1fba\0\u1ff8\0\u2036\0\370\0\370"+ + "\0\u2074\0\u20b2\0\370\0\u20f0\0\u212e\0\u216c\0\370\0\u21aa"+ + "\0\370\0\u21e8\0\u2226\0\370\0\u2264\0\u22a2\0\u22e0\0\u231e"+ + "\0\272\0\u235c\0\u239a\0\u23d8\0\u2416\0\u2454\0\u2492\0\u24d0"+ + "\0\u250e\0\u254c\0\u258a\0\u25c8\0\u2606\0\u2644\0\u2682\0\370"+ + "\0\u26c0\0\370\0\u26fe\0\370\0\u273c\0\u277a\0\272\0\370"+ + "\0\u27b8\0\u27f6\0\370\0\370\0\u2834\0\u2872\0\u28b0\0\u28ee"+ + "\0\370\0\370\0\u292c\0\u296a\0\u29a8\0\u29e6\0\u2a24\0\u2a62"+ + "\0\272\0\370\0\u2aa0\0\u2ade\0\370\0\u2b1c\0\u2b5a\0\370"+ + "\0\370\0\u2b98\0\u2bd6\0\u2c14\0\u2c52\0\u2c90\0\370\0\u2cce"+ + "\0\u2d0c\0\u2d4a\0\u2d88\0\u2dc6\0\370\0\u2e04\0\u2e42\0\u2e80"+ + "\0\u2ebe\0\u2efc\0\u2f3a\0\u2f78\0\u2fb6\0\u2ff4\0\370\0\u3032"+ + "\0\u3070\0\u30ae\0\370\0\u30ec\0\u312a\0\u3168\0\u31a6\0\u31e4"+ + "\0\u3222\0\u3260\0\u329e\0\272\0\u32dc\0\u331a\0\272\0\u3358"+ + "\0\u3396\0\u33d4\0\370\0\u3412\0\u3450\0\272\0\u348e\0\272"; private static int [] zzUnpackRowMap() { - int [] result = new int[293]; + int [] result = new int[296]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -346,112 +346,116 @@ public class SCLLexer { "\1\310\42\0\1\206\57\0\25\213\1\311\1\254\47\213"+ "\47\0\1\312\27\0\4\6\2\0\1\76\12\0\1\6"+ "\6\0\4\6\1\313\23\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\2\6\1\314\25\6"+ + "\2\0\1\76\12\0\1\6\6\0\12\6\1\314\15\6"+ "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\17\6\1\315\10\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\3\6\1\316\24\6"+ + "\6\0\2\6\1\315\25\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\17\6\1\316\10\6"+ "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\14\6\1\317\13\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\2\6\1\320\25\6"+ + "\6\0\3\6\1\317\24\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\14\6\1\320\13\6"+ "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\12\6\1\321\15\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\11\6\1\322\16\6"+ + "\6\0\2\6\1\321\25\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\12\6\1\322\15\6"+ "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\16\6\1\323\11\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\2\6\1\324\25\6"+ + "\6\0\11\6\1\323\16\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\16\6\1\324\11\6"+ "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\11\6\1\325\16\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\16\6\1\326\11\6"+ + "\6\0\2\6\1\325\25\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\11\6\1\326\16\6"+ "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\10\6\1\327\17\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\6\6\1\330\21\6"+ + "\6\0\16\6\1\327\11\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\10\6\1\330\17\6"+ "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\12\6\1\331\15\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\25\6\1\332\2\6"+ + "\6\0\6\6\1\331\21\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\12\6\1\332\15\6"+ "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\7\6\1\333\20\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\5\6\1\334\22\6"+ - "\11\0\1\6\5\0\2\335\16\0\1\335\6\0\1\335"+ - "\2\0\1\335\4\0\1\335\4\0\2\335\1\0\1\335"+ - "\64\0\1\336\36\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\4\6\1\337\23\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\3\6\1\340\24\6"+ + "\6\0\25\6\1\333\2\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\7\6\1\334\20\6"+ "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\2\6\1\341\1\6\1\342\23\6\11\0\1\6"+ + "\6\0\5\6\1\335\22\6\11\0\1\6\5\0\2\336"+ + "\16\0\1\336\6\0\1\336\2\0\1\336\4\0\1\336"+ + "\4\0\2\336\1\0\1\336\64\0\1\337\36\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\4\6\1\340\23\6"+ + "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ + "\6\0\10\6\1\341\17\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\3\6\1\342\24\6"+ + "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ + "\6\0\2\6\1\343\1\6\1\344\23\6\11\0\1\6"+ "\4\0\4\6\2\0\1\76\12\0\1\6\6\0\11\6"+ - "\1\343\16\6\11\0\1\6\4\0\4\6\2\0\1\76"+ - "\12\0\1\6\6\0\20\6\1\344\7\6\11\0\1\6"+ + "\1\345\16\6\11\0\1\6\4\0\4\6\2\0\1\76"+ + "\12\0\1\6\6\0\20\6\1\346\7\6\11\0\1\6"+ "\4\0\4\6\2\0\1\76\12\0\1\6\6\0\6\6"+ - "\1\345\21\6\11\0\1\6\4\0\4\6\2\0\1\76"+ - "\12\0\1\6\6\0\1\346\27\6\11\0\1\6\4\0"+ - "\4\6\2\0\1\76\12\0\1\6\6\0\23\6\1\347"+ + "\1\347\21\6\11\0\1\6\4\0\4\6\2\0\1\76"+ + "\12\0\1\6\6\0\1\350\27\6\11\0\1\6\4\0"+ + "\4\6\2\0\1\76\12\0\1\6\6\0\23\6\1\351"+ "\4\6\11\0\1\6\4\0\4\6\2\0\1\76\12\0"+ - "\1\6\6\0\6\6\1\350\21\6\11\0\1\6\4\0"+ - "\4\6\2\0\1\76\12\0\1\6\6\0\16\6\1\351"+ + "\1\6\6\0\6\6\1\352\21\6\11\0\1\6\4\0"+ + "\4\6\2\0\1\76\12\0\1\6\6\0\16\6\1\353"+ "\11\6\11\0\1\6\4\0\4\6\2\0\1\76\12\0"+ - "\1\6\6\0\20\6\1\352\7\6\11\0\1\6\4\0"+ - "\4\6\2\0\1\76\12\0\1\6\6\0\6\6\1\353"+ + "\1\6\6\0\20\6\1\354\7\6\11\0\1\6\4\0"+ + "\4\6\2\0\1\76\12\0\1\6\6\0\6\6\1\355"+ "\21\6\11\0\1\6\4\0\4\6\2\0\1\76\12\0"+ - "\1\6\6\0\2\6\1\354\25\6\11\0\1\6\4\0"+ - "\4\6\2\0\1\76\12\0\1\6\6\0\5\6\1\355"+ + "\1\6\6\0\2\6\1\356\25\6\11\0\1\6\4\0"+ + "\4\6\2\0\1\76\12\0\1\6\6\0\5\6\1\357"+ "\22\6\11\0\1\6\4\0\4\6\2\0\1\76\12\0"+ - "\1\6\6\0\11\6\1\356\16\6\11\0\1\6\5\0"+ - "\2\357\16\0\1\357\6\0\1\357\2\0\1\357\4\0"+ - "\1\357\4\0\2\357\1\0\1\357\25\0\4\6\2\0"+ - "\1\76\12\0\1\6\6\0\16\6\1\360\11\6\11\0"+ + "\1\6\6\0\11\6\1\360\16\6\11\0\1\6\5\0"+ + "\2\361\16\0\1\361\6\0\1\361\2\0\1\361\4\0"+ + "\1\361\4\0\2\361\1\0\1\361\25\0\4\6\2\0"+ + "\1\76\12\0\1\6\6\0\6\6\1\362\21\6\11\0"+ "\1\6\4\0\4\6\2\0\1\76\12\0\1\6\6\0"+ - "\16\6\1\361\11\6\11\0\1\6\4\0\4\6\2\0"+ - "\1\76\12\0\1\6\6\0\10\6\1\362\17\6\11\0"+ + "\16\6\1\363\11\6\11\0\1\6\4\0\4\6\2\0"+ + "\1\76\12\0\1\6\6\0\16\6\1\364\11\6\11\0"+ "\1\6\4\0\4\6\2\0\1\76\12\0\1\6\6\0"+ - "\27\6\1\363\11\0\1\6\4\0\4\6\2\0\1\76"+ - "\12\0\1\6\6\0\1\6\1\364\26\6\11\0\1\6"+ - "\4\0\4\6\2\0\1\76\12\0\1\6\6\0\10\6"+ - "\1\365\17\6\11\0\1\6\4\0\4\6\2\0\1\76"+ - "\12\0\1\6\6\0\12\6\1\366\15\6\11\0\1\6"+ - "\4\0\4\6\2\0\1\76\12\0\1\6\1\0\1\367"+ - "\4\0\30\6\11\0\1\6\4\0\4\6\2\0\1\76"+ - "\12\0\1\6\6\0\3\6\1\370\24\6\11\0\1\6"+ - "\4\0\4\6\2\0\1\76\12\0\1\6\6\0\11\6"+ - "\1\371\16\6\11\0\1\6\4\0\4\6\2\0\1\76"+ - "\12\0\1\6\6\0\23\6\1\372\4\6\11\0\1\6"+ - "\4\0\4\6\2\0\1\76\12\0\1\6\6\0\6\6"+ - "\1\373\21\6\11\0\1\6\4\0\4\6\2\0\1\76"+ - "\12\0\1\6\6\0\10\6\1\374\17\6\11\0\1\6"+ + "\10\6\1\365\17\6\11\0\1\6\4\0\4\6\2\0"+ + "\1\76\12\0\1\6\6\0\27\6\1\366\11\0\1\6"+ + "\4\0\4\6\2\0\1\76\12\0\1\6\6\0\1\6"+ + "\1\367\26\6\11\0\1\6\4\0\4\6\2\0\1\76"+ + "\12\0\1\6\6\0\10\6\1\370\17\6\11\0\1\6"+ + "\4\0\4\6\2\0\1\76\12\0\1\6\6\0\12\6"+ + "\1\371\15\6\11\0\1\6\4\0\4\6\2\0\1\76"+ + "\12\0\1\6\1\0\1\372\4\0\30\6\11\0\1\6"+ "\4\0\4\6\2\0\1\76\12\0\1\6\6\0\3\6"+ - "\1\375\24\6\11\0\1\6\4\0\4\6\2\0\1\76"+ - "\12\0\1\6\6\0\2\6\1\376\25\6\11\0\1\6"+ - "\27\0\1\367\4\0\1\377\17\0\1\u0100\25\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\5\6\1\u0101\22\6"+ - "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\23\6\1\u0102\4\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\1\0\1\u0103\4\0\30\6"+ - "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\1\0\1\u0104\4\0\30\6\11\0\1\6\4\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\25\6\1\u0105\2\6"+ + "\1\373\24\6\11\0\1\6\4\0\4\6\2\0\1\76"+ + "\12\0\1\6\6\0\11\6\1\374\16\6\11\0\1\6"+ + "\4\0\4\6\2\0\1\76\12\0\1\6\6\0\23\6"+ + "\1\375\4\6\11\0\1\6\4\0\4\6\2\0\1\76"+ + "\12\0\1\6\6\0\6\6\1\376\21\6\11\0\1\6"+ + "\4\0\4\6\2\0\1\76\12\0\1\6\6\0\10\6"+ + "\1\377\17\6\11\0\1\6\4\0\4\6\2\0\1\76"+ + "\12\0\1\6\6\0\3\6\1\u0100\24\6\11\0\1\6"+ + "\4\0\4\6\2\0\1\76\12\0\1\6\6\0\2\6"+ + "\1\u0101\25\6\11\0\1\6\27\0\1\372\4\0\1\u0102"+ + "\17\0\1\u0103\25\0\4\6\2\0\1\76\12\0\1\6"+ + "\6\0\5\6\1\u0104\22\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\23\6\1\u0105\4\6"+ "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\21\6\1\u0106\6\6\11\0\1\6\41\0\1\u0107"+ - "\75\0\1\u0108\40\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\11\6\1\u0109\16\6\11\0\1\6\27\0\1\u0103"+ - "\6\0\1\u010a\66\0\1\u0104\6\0\1\u010b\43\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\3\6\1\u010c\24\6"+ + "\1\0\1\u0106\4\0\30\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\1\0\1\u0107\4\0\30\6"+ "\11\0\1\6\4\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\3\6\1\u010d\24\6\11\0\1\6\36\0\1\u010e"+ - "\105\0\1\u010f\33\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\6\6\1\u0110\21\6\11\0\1\6\44\0\1\u0111"+ - "\101\0\1\u0112\31\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\6\6\1\u0113\21\6\11\0\1\6\46\0\1\u0114"+ - "\71\0\1\u0115\73\0\1\u0116\75\0\1\u0117\41\0\4\6"+ - "\2\0\1\76\12\0\1\6\6\0\5\6\1\u0118\22\6"+ - "\11\0\1\6\42\0\1\u0119\74\0\1\u011a\73\0\1\u011b"+ - "\102\0\1\u011c\35\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\1\6\1\u011d\26\6\11\0\1\6\45\0\1\u011e"+ - "\72\0\1\u011f\37\0\4\6\2\0\1\76\12\0\1\6"+ - "\6\0\11\6\1\u0120\16\6\11\0\1\6\52\0\1\u0121"+ - "\64\0\1\u0122\76\0\1\u0123\70\0\1\u0124\105\0\1\u0125"+ - "\33\0"; + "\6\0\25\6\1\u0108\2\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\21\6\1\u0109\6\6"+ + "\11\0\1\6\41\0\1\u010a\75\0\1\u010b\40\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\11\6\1\u010c\16\6"+ + "\11\0\1\6\27\0\1\u0106\6\0\1\u010d\66\0\1\u0107"+ + "\6\0\1\u010e\43\0\4\6\2\0\1\76\12\0\1\6"+ + "\6\0\3\6\1\u010f\24\6\11\0\1\6\4\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\3\6\1\u0110\24\6"+ + "\11\0\1\6\36\0\1\u0111\105\0\1\u0112\33\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\6\6\1\u0113\21\6"+ + "\11\0\1\6\44\0\1\u0114\101\0\1\u0115\31\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\6\6\1\u0116\21\6"+ + "\11\0\1\6\46\0\1\u0117\71\0\1\u0118\73\0\1\u0119"+ + "\75\0\1\u011a\41\0\4\6\2\0\1\76\12\0\1\6"+ + "\6\0\5\6\1\u011b\22\6\11\0\1\6\42\0\1\u011c"+ + "\74\0\1\u011d\73\0\1\u011e\102\0\1\u011f\35\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\1\6\1\u0120\26\6"+ + "\11\0\1\6\45\0\1\u0121\72\0\1\u0122\37\0\4\6"+ + "\2\0\1\76\12\0\1\6\6\0\11\6\1\u0123\16\6"+ + "\11\0\1\6\52\0\1\u0124\64\0\1\u0125\76\0\1\u0126"+ + "\70\0\1\u0127\105\0\1\u0128\33\0"; private static int [] zzUnpackTrans() { - int [] result = new int[13330]; + int [] result = new int[13516]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -495,14 +499,14 @@ public class SCLLexer { "\4\0\5\1\2\0\37\1\1\0\5\11\1\1\1\11"+ "\2\0\2\1\1\0\3\11\1\0\1\11\2\0\1\11"+ "\1\1\1\0\1\1\1\0\32\1\1\11\1\0\1\11"+ - "\2\0\1\1\1\0\31\1\1\0\1\11\1\0\22\1"+ - "\1\0\1\11\20\1\1\11\7\1\1\0\7\1\2\0"+ + "\2\0\1\1\1\0\31\1\1\0\1\11\1\0\23\1"+ + "\1\0\1\11\21\1\1\11\10\1\1\0\7\1\2\0"+ "\2\1\2\0\2\1\2\0\1\1\2\0\2\1\2\0"+ "\1\1\2\0\1\1\4\0\1\1\1\11\2\0\1\11"+ "\1\1\2\0\1\1\2\0\1\11\1\0\1\11"; private static int [] zzUnpackAttribute() { - int [] result = new int[293]; + int [] result = new int[296]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -910,11 +914,11 @@ public class SCLLexer { case STRING: { throw new SCLSyntaxErrorException(Locations.location(stringStart, yychar), "Unclosed string literal."); } - case 294: break; + case 297: break; case LONG_STRING: { throw new SCLSyntaxErrorException(Locations.location(stringStart, yychar), "Unclosed string literal."); } - case 295: break; + case 298: break; default: { return sym(SCLTerminals.EOF); } @@ -925,39 +929,39 @@ public class SCLLexer { case 1: { throw new SCLSyntaxErrorException(Locations.location(yychar, yychar+1), "Illegal character '" + yytext() + "'."); } - case 95: break; + case 96: break; case 2: { return sym(SCLTerminals.ID); } - case 96: break; + case 97: break; case 3: { return sym(SCLTerminals.INTEGER); } - case 97: break; + case 98: break; case 4: { return sym(SCLTerminals.SYMBOL, yytext().trim()); } - case 98: break; + case 99: break; case 5: { return sym(SCLTerminals.ATTACHED_HASH, "#"); } - case 99: break; + case 100: break; case 6: { return sym(SCLTerminals.ATTACHED_DOT, "."); } - case 100: break; + case 101: break; case 7: { return sym(SCLTerminals.AT); } - case 101: break; + case 102: break; case 8: { ++parenCount; return sym(SCLTerminals.LPAREN); } - case 102: break; + case 103: break; case 9: { return sym(SCLTerminals.COMMA); } - case 103: break; + case 104: break; case 10: { --parenCount; if(parenCount == 0 && !parenCountStack.isEmpty()) { @@ -970,164 +974,164 @@ public class SCLLexer { else return sym(SCLTerminals.RPAREN); } - case 104: break; + case 105: break; case 11: { return new Token(SCLTerminals.EOL, yychar, yychar+yylength(), ""); } - case 105: break; + case 106: break; case 12: { return sym(SCLTerminals.LESS, "<"); } - case 106: break; + case 107: break; case 13: { return sym(SCLTerminals.GREATER, ">"); } - case 107: break; + case 108: break; case 14: { return sym(SCLTerminals.MINUS, "-"); } - case 108: break; + case 109: break; case 15: { } - case 109: break; + case 110: break; case 16: { throw new SCLSyntaxErrorException(Locations.location(yychar, yychar+1), "Character does not conform to UTF-8 encoding."); } - case 110: break; + case 111: break; case 17: { return sym(SCLTerminals.LAMBDA); } - case 111: break; + case 112: break; case 18: { return sym(SCLTerminals.LBRACE); } - case 112: break; + case 113: break; case 19: { return sym(SCLTerminals.RBRACE); } - case 113: break; + case 114: break; case 20: { return sym(SCLTerminals.LBRACKET); } - case 114: break; + case 115: break; case 21: { return sym(SCLTerminals.RBRACKET); } - case 115: break; + case 116: break; case 22: { return sym(SCLTerminals.EQUALS); } - case 116: break; + case 117: break; case 23: { return sym(SCLTerminals.COLON); } - case 117: break; + case 118: break; case 24: { return sym(SCLTerminals.SEMICOLON); } - case 118: break; + case 119: break; case 25: { return sym(SCLTerminals.BAR); } - case 119: break; + case 120: break; case 26: { string.setLength(0); stringStart=yychar; yybegin(STRING); return sym(SCLTerminals.BEGIN_STRING); } - case 120: break; + case 121: break; case 27: { return sym(SCLTerminals.BLANK); } - case 121: break; + case 122: break; case 28: { throw new SCLSyntaxErrorException(Locations.location(yychar, yychar+1), "Tabulator is not allowed except inside string literals."); } - case 122: break; + case 123: break; case 29: { string.append( yytext() ); } - case 123: break; + case 124: break; case 30: { throw new SCLSyntaxErrorException(Locations.location(stringStart, yychar), "Unclosed string literal."); } - case 124: break; + case 125: break; case 31: { yybegin(YYINITIAL); return new Token(SCLTerminals.END_STRING, stringStart, yychar+1, string.toString()); } - case 125: break; + case 126: break; case 32: { string.append('\n'); } - case 126: break; + case 127: break; case 33: { return sym(SCLTerminals.DOTDOT, "."); } - case 127: break; + case 128: break; case 34: { return sym(SCLTerminals.SEPARATED_DOT, "."); } - case 128: break; + case 129: break; case 35: { return sym(SCLTerminals.ANNOTATION_ID); } - case 129: break; + case 130: break; case 36: { return sym(SCLTerminals.BINDS); } - case 130: break; + case 131: break; case 37: { return sym(SCLTerminals.ARROW); } - case 131: break; + case 132: break; case 38: { return sym(SCLTerminals.COMMENT); } - case 132: break; + case 133: break; case 39: { return sym(SCLTerminals.AS); } - case 133: break; + case 134: break; case 40: { return sym(SCLTerminals.IF); } - case 134: break; + case 135: break; case 41: { return sym(SCLTerminals.IN); } - case 135: break; + case 136: break; case 42: { return sym(options.supportEq ? SCLTerminals.EQ : SCLTerminals.ID); } - case 136: break; + case 137: break; case 43: { return sym(SCLTerminals.BY); } - case 137: break; + case 138: break; case 44: { return sym(SCLTerminals.DO); } - case 138: break; + case 139: break; case 45: { return sym(SCLTerminals.IMPLIES); } - case 139: break; + case 140: break; case 46: { return sym(SCLTerminals.FOLLOWS); } - case 140: break; + case 141: break; case 47: { return sym(SCLTerminals.HASTYPE); } - case 141: break; + case 142: break; case 48: { throw new SCLSyntaxErrorException(Locations.location(stringStart, yychar), "Illegal string escape character."); } - case 142: break; + case 143: break; case 49: { string.append(yytext().substring(1)); } - case 143: break; + case 144: break; case 50: { parenCountStack.add(parenCount); parenCount = 1; @@ -1135,15 +1139,15 @@ public class SCLLexer { yybegin(YYINITIAL); return new Token(SCLTerminals.SUSPEND_STRING, stringStart, yychar+1, string.toString()); } - case 144: break; + case 145: break; case 51: { string.append('\r'); } - case 145: break; + case 146: break; case 52: { string.append('\t'); } - case 146: break; + case 147: break; case 53: { parenCountStack.add(parenCount); parenCount = 1; @@ -1151,174 +1155,178 @@ public class SCLLexer { yybegin(YYINITIAL); return new Token(SCLTerminals.SUSPEND_STRING, stringStart, yychar+1, string.toString()); } - case 147: break; + case 148: break; case 54: { return sym(SCLTerminals.FLOAT); } - case 148: break; + case 149: break; case 55: { return sym(SCLTerminals.CHAR); } - case 149: break; + case 150: break; case 56: { String text = yytext(); return sym(SCLTerminals.ID, text.substring(1, text.length()-1)); } - case 150: break; + case 151: break; case 57: { String text = yytext(); return sym(SCLTerminals.SYMBOL, text.substring(1, text.length()-1)); } - case 151: break; + case 152: break; case 58: { return sym(SCLTerminals.QUERY_OP); } - case 152: break; + case 153: break; case 59: { return sym(SCLTerminals.LET); } - case 153: break; + case 154: break; case 60: { return sym(SCLTerminals.MDO); } - case 154: break; + case 155: break; case 61: { string.setLength(0); stringStart=yychar; yybegin(LONG_STRING); return sym(SCLTerminals.BEGIN_STRING); } - case 155: break; + case 156: break; case 62: { yybegin(YYINITIAL); return new Token(SCLTerminals.END_STRING, stringStart, yychar+3, string.toString()); } - case 156: break; + case 157: break; case 63: { return sym(SCLTerminals.RULE); } - case 157: break; + case 158: break; case 64: { return sym(SCLTerminals.THEN); } - case 158: break; + case 159: break; case 65: { return sym(SCLTerminals.TYPE); } - case 159: break; + case 160: break; case 66: { return sym(SCLTerminals.ELSE); } - case 160: break; + case 161: break; case 67: { return sym(SCLTerminals.WITH); } - case 161: break; + case 162: break; case 68: { return sym(SCLTerminals.WHEN); } - case 162: break; + case 163: break; case 69: { return sym(SCLTerminals.DATA); } - case 163: break; + case 164: break; case 70: { return sym(SCLTerminals.INFIX); } - case 164: break; + case 165: break; case 71: { return sym(SCLTerminals.WHERE); } - case 165: break; + case 166: break; case 72: { return sym(SCLTerminals.CLASS); } - case 166: break; + case 167: break; case 73: { return sym(SCLTerminals.MATCH); } - case 167: break; + case 168: break; case 74: { return sym(SCLTerminals.LAMBDA_MATCH); } - case 168: break; + case 169: break; case 75: { return sym(SCLTerminals.FORALL); } - case 169: break; + case 170: break; case 76: { return sym(SCLTerminals.INFIXR); } - case 170: break; + case 171: break; case 77: { return sym(SCLTerminals.INFIXL); } - case 171: break; + case 172: break; case 78: { return sym(SCLTerminals.IMPORT); } - case 172: break; + case 173: break; case 79: { return sym(SCLTerminals.HIDING); } - case 173: break; + case 174: break; case 80: { return sym(SCLTerminals.EFFECT); } - case 174: break; + case 175: break; case 81: { return sym(SCLTerminals.SELECT); } - case 175: break; + case 176: break; case 82: { string.append((char)Integer.parseInt(yytext().substring(2), 16)); } - case 176: break; + case 177: break; case 83: - { return sym(SCLTerminals.INCLUDE); + { return sym(SCLTerminals.RULESET); } - case 177: break; + case 178: break; case 84: - { return sym(SCLTerminals.ENFORCE); + { return sym(SCLTerminals.INCLUDE); } - case 178: break; + case 179: break; case 85: - { return sym(SCLTerminals.EXTENDS); + { return sym(SCLTerminals.ENFORCE); } - case 179: break; + case 180: break; case 86: - { return sym(SCLTerminals.INSTANCE); + { return sym(SCLTerminals.EXTENDS); } - case 180: break; + case 181: break; case 87: - { return sym(SCLTerminals.DERIVING); + { return sym(SCLTerminals.INSTANCE); } - case 181: break; + case 182: break; case 88: - { return sym(SCLTerminals.IMPORTJAVA); + { return sym(SCLTerminals.DERIVING); } - case 182: break; + case 183: break; case 89: - { return sym(SCLTerminals.CONSTRAINT); + { return sym(SCLTerminals.IMPORTJAVA); } - case 183: break; + case 184: break; case 90: - { return sym(SCLTerminals.SELECT_FIRST); + { return sym(SCLTerminals.CONSTRAINT); } - case 184: break; + case 185: break; case 91: - { return sym(SCLTerminals.ABSTRACT_RULE); + { return sym(SCLTerminals.SELECT_FIRST); } - case 185: break; + case 186: break; case 92: - { return sym(SCLTerminals.TRANSFORMATION); + { return sym(SCLTerminals.ABSTRACT_RULE); } - case 186: break; + case 187: break; case 93: - { return sym(SCLTerminals.SELECT_DISTINCT); + { return sym(SCLTerminals.TRANSFORMATION); } - case 187: break; + case 188: break; case 94: + { return sym(SCLTerminals.SELECT_DISTINCT); + } + case 189: break; + case 95: { return sym(SCLTerminals.MAPPING_RELATION); } - case 188: break; + case 190: break; default: zzScanError(ZZ_NO_MATCH); } diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParser.dat b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParser.dat index 51eafba3c..3b8a4c400 100644 Binary files a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParser.dat and b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParser.dat differ diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParser.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParser.java index 735974868..527c66f5d 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParser.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParser.java @@ -13,18 +13,18 @@ public abstract class SCLParser { public static final boolean TRACE = false; private static final int INITIAL_CAPACITY = 16; - private static final int STATE_COUNT = 345; - private static final int TERMINAL_COUNT = 83; + private static final int STATE_COUNT = 353; + private static final int TERMINAL_COUNT = 84; private static final int NONTERMINAL_COUNT = 51; - private static final int PRODUCT_COUNT = 132; + private static final int PRODUCT_COUNT = 134; private static final int[] ACTION_ROW_ID = new int[STATE_COUNT]; private static final int[] ACTION_COLUMN_ID = new int[TERMINAL_COUNT]; - private static final short[] ACTION_TABLE = new short[6360]; - private static final int[] ERROR_TABLE = new int[895]; + private static final short[] ACTION_TABLE = new short[6588]; + private static final int[] ERROR_TABLE = new int[927]; private static final int[] GOTO_ROW_ID = new int[STATE_COUNT]; private static final int[] GOTO_COLUMN_ID = new int[NONTERMINAL_COUNT]; - private static final short[] GOTO_TABLE = new short[1711]; + private static final short[] GOTO_TABLE = new short[1620]; private static final int[] PRODUCT_LHS = new int[PRODUCT_COUNT]; private static final short STATE_MASK = (short)0x0fff; @@ -64,6 +64,7 @@ public abstract class SCLParser { "EXTENDS", "MAPPING_RELATION", "FOLLOWS", + "RULESET", "IMPORT", "INCLUDE", "AS", @@ -141,10 +142,10 @@ public abstract class SCLParser { "atype", "aexp", "ruleDeclarations", + "statements", "importSpec", "importItem", "fieldDeclaration", - "statements", "guardedExpEq", "fundep", "ruleDeclaration", @@ -393,19 +394,19 @@ public abstract class SCLParser { return parse(0); } public Object parseCommands() { - return parse(330); + return parse(337); } public Object parseImport() { - return parse(337); + return parse(345); } public Object parseType() { - return parse(339); + return parse(347); } public Object parseExp() { - return parse(341); + return parse(349); } public Object parseEquationBlock() { - return parse(343); + return parse(351); } @@ -461,208 +462,212 @@ public abstract class SCLParser { case 23: return reduceRelationDefinition(); case 24: - return reduceStatementCommand(); + return reduceRulesetDefinition(); case 25: - return reduceImportCommand(); + return reduceStatementCommand(); case 26: - return reduceGuardStatement(); + return reduceImportCommand(); case 27: - return reduceLetStatement(); + return reduceGuardStatement(); case 28: - return reduceBindStatement(); + return reduceLetStatement(); case 29: - return reduceRuleStatement(); + return reduceBindStatement(); case 30: - return reduceCHRStatement(); + return reduceRuleStatement(); case 31: - return reduceVerboseCHRStatement(); + return reduceCHRStatement(); case 32: - return reduceConstraintStatement(); + return reduceVerboseCHRStatement(); case 33: - return reduceDeclarations(); + return reduceConstraintStatement(); case 34: - return reduceField(); + return reduceLocalInclude(); case 35: - return reduceFieldShorthand(); + return reduceDeclarations(); case 36: - return reduceVarId(); + return reduceField(); case 37: - return reduceEscapedSymbol(); + return reduceFieldShorthand(); case 38: - return reduceTupleConstructor(); + return reduceVarId(); case 39: - return reduceBinary(); + return reduceEscapedSymbol(); case 40: - return reduceSimpleRhs(); + return reduceTupleConstructor(); case 41: - return reduceGuardedRhs(); + return reduceBinary(); case 42: - return reduceConstructor(); + return reduceSimpleRhs(); case 43: - return reduceRecordConstructor(); + return reduceGuardedRhs(); case 44: - return reduceContext(); + return reduceConstructor(); case 45: - return reduceFundeps(); + return reduceRecordConstructor(); case 46: - return reduceTypeVar(); + return reduceContext(); case 47: - return reduceTupleType(); + return reduceFundeps(); case 48: - return reduceListType(); + return reduceTypeVar(); case 49: - return reduceListTypeConstructor(); + return reduceTupleType(); case 50: - return reduceTupleTypeConstructor(); + return reduceListType(); case 51: - return reduceLambda(); + return reduceListTypeConstructor(); case 52: - return reduceLambdaMatch(); + return reduceTupleTypeConstructor(); case 53: - return reduceLet(); + return reduceLambda(); case 54: - return reduceIf(); + return reduceLambdaMatch(); case 55: - return reduceMatch(); + return reduceLet(); case 56: - return reduceDo(); + return reduceIf(); case 57: - return reduceSelect(); + return reduceMatch(); case 58: - return reduceEnforce(); + return reduceDo(); case 59: - return reduceVar(); + return reduceSelect(); case 60: - return reduceHashedId(); + return reduceEnforce(); case 61: - return reduceBlank(); + return reduceVar(); case 62: - return reduceInteger(); + return reduceHashedId(); case 63: - return reduceFloat(); + return reduceBlank(); case 64: - return reduceString(); + return reduceInteger(); case 65: - return reduceChar(); + return reduceFloat(); case 66: - return reduceTuple(); + return reduceString(); case 67: - return reduceViewPattern(); + return reduceChar(); case 68: - return reduceRightSection(); + return reduceTuple(); case 69: - return reduceLeftSection(); + return reduceViewPattern(); case 70: - return reduceListLiteral(); + return reduceRightSection(); case 71: - return reduceRange(); + return reduceLeftSection(); case 72: - return reduceListComprehension(); + return reduceListLiteral(); case 73: - return reduceAs(); + return reduceRange(); case 74: - return reduceRecord(); + return reduceListComprehension(); case 75: - return reduceTransformation(); + return reduceAs(); case 76: - return reduceEq(); + return reduceRecord(); case 77: - return reduceRuleDeclarations(); + return reduceTransformation(); case 78: - return reduceImportShowing(); + return reduceEq(); case 79: - return reduceImportHiding(); + return reduceRuleDeclarations(); case 80: - return reduceImportValueItem(); + return reduceStatements(); case 81: - return reduceFieldDescription(); + return reduceImportShowing(); case 82: - return reduceStatements(); + return reduceImportHiding(); case 83: - return reduceGuardedExpEq(); + return reduceImportValueItem(); case 84: - return reduceFundep(); + return reduceFieldDescription(); case 85: - return reduceQueryRuleDeclaration(); + return reduceGuardedExpEq(); case 86: - return reduceAnnotation(); + return reduceFundep(); case 87: - return reduceGuardQuery(); + return reduceQueryRuleDeclaration(); case 88: - return reduceEqualsQuery(); + return reduceAnnotation(); case 89: - return reduceBindQuery(); + return reduceGuardQuery(); case 90: - return reduceCompositeQuery(); + return reduceEqualsQuery(); case 91: - return reduceApply(); + return reduceBindQuery(); case 92: - return reduceSymbol(); + return reduceCompositeQuery(); case 93: - return reduceEscapedId(); + return reduceApply(); case 94: - return reduceMinus(); + return reduceSymbol(); case 95: - return reduceLess(); + return reduceEscapedId(); case 96: - return reduceGreater(); + return reduceMinus(); case 97: - return reduceDot(); + return reduceLess(); case 98: - return reduceFieldAccess(); + return reduceGreater(); case 99: - return reduceIdAccessor(); + return reduceDot(); case 100: - return reduceStringAccessor(); + return reduceFieldAccess(); case 101: - return reduceExpAccessor(); + return reduceIdAccessor(); case 102: - return reduceCase(); + return reduceStringAccessor(); case 103: - return reduceQueryBlock(); + return reduceExpAccessor(); case 104: - return reduceStringLiteral(); + return reduceCase(); case 105: - return reduceSymbol(); + return reduceQueryBlock(); case 106: - return reduceEscapedId(); + return reduceStringLiteral(); case 107: - return reduceLess(); + return reduceSymbol(); case 108: - return reduceGreater(); + return reduceEscapedId(); case 109: - return reduceDot(); + return reduceLess(); case 110: - return reduceGuardQualifier(); + return reduceGreater(); case 111: - return reduceLetQualifier(); + return reduceDot(); case 112: - return reduceBindQualifier(); + return reduceGuardQualifier(); case 113: - return reduceThenQualifier(); + return reduceLetQualifier(); case 114: - return reduceCHRQuery(); + return reduceBindQualifier(); case 115: - return reduceVerboseCHRQuery(); + return reduceThenQualifier(); case 116: - return reduceSimpleCaseRhs(); + return reduceCHRQuery(); case 117: - return reduceGuardedCaseRhs(); + return reduceVerboseCHRQuery(); case 118: - return reduceGuardedExpArrow(); + return reduceSimpleCaseRhs(); case 119: - return reduceGuardEquation(); + return reduceGuardedCaseRhs(); case 120: - return reduceBasicEquation(); + return reduceGuardedExpArrow(); case 121: - return reduceEffect(); + return reduceGuardEquation(); case 122: - return reduceJustEtype(); + return reduceBasicEquation(); case 123: - return reduceForAll(); + return reduceEffect(); case 124: - return reduceApplyType(); + return reduceJustEtype(); case 125: + return reduceForAll(); + case 126: + return reduceApplyType(); + case 127: return reduceDummy(); default: @@ -779,6 +784,10 @@ public abstract class SCLParser { * declaration ::= bexp FOLLOWS ruleDeclarations */ protected abstract Object reduceRelationDefinition(); + /** + * declaration ::= RULESET ID WHERE statements + */ + protected abstract Object reduceRulesetDefinition(); /** * command ::= statement */ @@ -815,6 +824,10 @@ public abstract class SCLParser { * statement ::= CONSTRAINT ID atype* */ protected abstract Object reduceConstraintStatement(); + /** + * statement ::= INCLUDE ID aexp + */ + protected abstract Object reduceLocalInclude(); /** * declarations ::= LBRACE (declaration (SEMICOLON (declaration SEMICOLON)* declaration)?)? RBRACE */ @@ -995,6 +1008,10 @@ public abstract class SCLParser { * ruleDeclarations ::= LBRACE (ruleDeclaration (SEMICOLON (ruleDeclaration SEMICOLON)* ruleDeclaration)?)? RBRACE */ protected abstract Object reduceRuleDeclarations(); + /** + * statements ::= LBRACE (statement (SEMICOLON (statement SEMICOLON)* statement)?)? RBRACE + */ + protected abstract Object reduceStatements(); /** * importSpec ::= LPAREN (importItem (COMMA (importItem COMMA)* importItem)?)? RPAREN */ @@ -1011,10 +1028,6 @@ public abstract class SCLParser { * fieldDeclaration ::= ID HASTYPE type */ protected abstract Object reduceFieldDescription(); - /** - * statements ::= LBRACE (statement (SEMICOLON (statement SEMICOLON)* statement)?)? RBRACE - */ - protected abstract Object reduceStatements(); /** * guardedExpEq ::= BAR exp (COMMA exp)* EQUALS exp */ diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParserImpl.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParserImpl.java index 799e59099..08e6a4f2d 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParserImpl.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLParserImpl.java @@ -1283,4 +1283,16 @@ public class SCLParserImpl extends SCLParser { throw new UnsupportedOperationException(); } + @Override + protected Object reduceRulesetDefinition() { + // TODO Auto-generated method stub + return null; + } + + @Override + protected Object reduceLocalInclude() { + // TODO Auto-generated method stub + return null; + } + } diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLTerminals.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLTerminals.java index c7723eea8..58a40f61e 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLTerminals.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCLTerminals.java @@ -30,58 +30,59 @@ public interface SCLTerminals { public static final int EXTENDS = 26; public static final int MAPPING_RELATION = 27; public static final int FOLLOWS = 28; - public static final int IMPORT = 29; - public static final int INCLUDE = 30; - public static final int AS = 31; - public static final int LPAREN = 32; - public static final int RPAREN = 33; - public static final int HIDING = 34; - public static final int ARROW = 35; - public static final int COLON = 36; - public static final int MINUS = 37; - public static final int SYMBOL = 38; - public static final int LESS = 39; - public static final int GREATER = 40; - public static final int SEPARATED_DOT = 41; - public static final int ESCAPED_ID = 42; - public static final int LAMBDA = 43; - public static final int LAMBDA_MATCH = 44; - public static final int LET = 45; - public static final int IF = 46; - public static final int MATCH = 47; - public static final int DO = 48; - public static final int MDO = 49; - public static final int ENFORCE = 50; - public static final int BLANK = 51; - public static final int FLOAT = 52; - public static final int LBRACKET = 53; - public static final int ESCAPED_SYMBOL = 54; - public static final int CHAR = 55; - public static final int WHEN = 56; - public static final int ATTACHED_HASH = 57; - public static final int SELECT = 58; - public static final int SELECT_FIRST = 59; - public static final int SELECT_DISTINCT = 60; - public static final int TRANSFORMATION = 61; - public static final int EQ = 62; - public static final int ATTACHED_DOT = 63; - public static final int IN = 64; - public static final int THEN = 65; - public static final int ELSE = 66; - public static final int WITH = 67; - public static final int RBRACKET = 68; - public static final int DOTDOT = 69; - public static final int AT = 70; - public static final int SUSPEND_STRING = 71; - public static final int CONTINUE_STRING = 72; - public static final int BINDS = 73; - public static final int IMPLIES = 74; - public static final int THEN_AFTER_WHEN = 75; - public static final int CONSTRAINT = 76; - public static final int BY = 77; - public static final int QUERY_OP = 78; - public static final int FORALL = 79; - public static final int COMMENT = 80; - public static final int EOL = 81; - public static final int EOF = 82; + public static final int RULESET = 29; + public static final int IMPORT = 30; + public static final int INCLUDE = 31; + public static final int AS = 32; + public static final int LPAREN = 33; + public static final int RPAREN = 34; + public static final int HIDING = 35; + public static final int ARROW = 36; + public static final int COLON = 37; + public static final int MINUS = 38; + public static final int SYMBOL = 39; + public static final int LESS = 40; + public static final int GREATER = 41; + public static final int SEPARATED_DOT = 42; + public static final int ESCAPED_ID = 43; + public static final int LAMBDA = 44; + public static final int LAMBDA_MATCH = 45; + public static final int LET = 46; + public static final int IF = 47; + public static final int MATCH = 48; + public static final int DO = 49; + public static final int MDO = 50; + public static final int ENFORCE = 51; + public static final int BLANK = 52; + public static final int FLOAT = 53; + public static final int LBRACKET = 54; + public static final int ESCAPED_SYMBOL = 55; + public static final int CHAR = 56; + public static final int WHEN = 57; + public static final int ATTACHED_HASH = 58; + public static final int SELECT = 59; + public static final int SELECT_FIRST = 60; + public static final int SELECT_DISTINCT = 61; + public static final int TRANSFORMATION = 62; + public static final int EQ = 63; + public static final int ATTACHED_DOT = 64; + public static final int IN = 65; + public static final int THEN = 66; + public static final int ELSE = 67; + public static final int WITH = 68; + public static final int RBRACKET = 69; + public static final int DOTDOT = 70; + public static final int AT = 71; + public static final int SUSPEND_STRING = 72; + public static final int CONTINUE_STRING = 73; + public static final int BINDS = 74; + public static final int IMPLIES = 75; + public static final int THEN_AFTER_WHEN = 76; + public static final int CONSTRAINT = 77; + public static final int BY = 78; + public static final int QUERY_OP = 79; + public static final int FORALL = 80; + public static final int COMMENT = 81; + public static final int EOL = 82; + public static final int EOF = 83; }