]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCL.grammar
(refs #7250) Support for record syntax for CHR relations
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / internal / parsing / parser / SCL.grammar
index 0312cf6f8819658e0a88b41a88e86565e63acc71..f7ea1b263617cee6eae8dbc4e5dda34139e10e45 100644 (file)
@@ -33,7 +33,8 @@ declarations
     ;
 
 declaration
-    = var (COMMA var)* HASTYPE type                          # TypeAnnotation
+    = MODULE LBRACE (field (COMMA field)*)? RBRACE           # ModuleHeader
+    | var (COMMA var)* HASTYPE type                          # TypeAnnotation
     | bexp rhs                                               # ValueDefinition
     | DATA ID+ (EQUALS constructor (BAR constructor)*)?      # DataDefinition
     | TYPE ID+ EQUALS type                                   # TypeDefinition
@@ -54,6 +55,7 @@ declaration
       WHERE ruleDeclarations                                 # RuleDefinition
     | MAPPING_RELATION ID atype*                             # MappingRelationDefinition
     | bexp FOLLOWS ruleDeclarations                          # RelationDefinition
+    | RULESET ID WHERE statements                            # RulesetDefinition
     ;
 
 import
@@ -119,7 +121,6 @@ ruleDeclaration
  */
  
 exp = bexp (HASTYPE type)?                                   # LocalTypeAnnotation, shift HASTYPE, shift COLON
-    | bexp COLON ID WITH? queryBlock?                        # EntityTypeAnnotation, shift LBRACE, shift WITH
     ;
 
 bexp 
@@ -199,7 +200,8 @@ statement
     | exp FOLLOWS queryBlock                                 # RuleStatement
     | chrQuery IMPLIES chrQuery                              # CHRStatement
     | WHEN verboseChrQuery THEN_AFTER_WHEN verboseChrQuery   # VerboseCHRStatement
-    | CONSTRAINT ID atype*                                   # ConstraintStatement
+    | CONSTRAINT constructor                                 # ConstraintStatement
+    | INCLUDE ID aexp                                        # LocalInclude
     ;
 
 chrQuery 
@@ -323,4 +325,5 @@ symbolWithoutMinus
 /******************************************************************************
  * Auxiliary tokens
  */
-dummy = COMMENT EOL ;
\ No newline at end of file
+dummy = COMMENT EOL                                          # Dummy 
+      ;
\ No newline at end of file