]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/parser/SCL.grammar
(refs #7601) Wildcard syntax for SCL records
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / internal / parsing / parser / SCL.grammar
index ea3df9722456cec4163ee9694498ea7b5e7716fb..01a66a9ee2fa844722624ce664bcd19e332c2a68 100644 (file)
@@ -133,7 +133,7 @@ lexp
     = faexp+                                                 # Apply, shift ID, shift LAMBDA, shift LAMBDA_MATCH,
                                                                shift LET, shift INTEGER, shift BEGIN_STRING,
                                                                shift IF, shift MATCH, shift DO,
-                                                               shift MDO, shift ENFORCE, shift BLANK,
+                                                               shift MDO, shift EDO, shift ENFORCE, shift BLANK,
                                                                shift FLOAT, shift LPAREN, shift LBRACKET,
                                                                shift ESCAPED_SYMBOL, shift CHAR, shift LBRACE,
                                                                shift WHEN, shift ATTACHED_HASH,
@@ -158,7 +158,7 @@ aexp
     | IF exp THEN exp (ELSE exp)?                            # If, shift HASTYPE, shift ELSE
     | MATCH exp WITH
       LBRACE case (SEMICOLON case)* RBRACE                   # Match
-    | (DO | MDO) statements                                  # Do
+    | (DO | MDO | EDO) statements                            # Do
     | (SELECT | SELECT_FIRST | SELECT_DISTINCT) 
       exp WHERE queryBlock                                   # Select
     | CHR_SELECT 
@@ -206,12 +206,19 @@ statement
     | INCLUDE ID aexp                                        # LocalInclude
     ;
 
+verboseChrQuery
+    = LBRACE chrQuery (SEMICOLON chrQuery)* RBRACE           # VerboseCHRConjunction
+    ;
+    
+
 chrQuery 
-    = listQualifier (COMMA listQualifier)*                   # CHRQuery
+    = chrQueryPart (COMMA chrQueryPart)*                     # CHRConjunction
     ;
 
-verboseChrQuery
-    = LBRACE listQualifier (SEMICOLON listQualifier)* RBRACE # VerboseCHRQuery
+chrQueryPart
+    = exp                                                    # CHRAtom
+    | exp EQUALS exp                                         # CHREquals
+    | exp BINDS exp                                          # CHRBinds
     ;
 
 listQualifier
@@ -237,6 +244,7 @@ guardedExpArrow
 field
     = ID EQUALS exp                                          # Field
     | ID                                                     # FieldShorthand
+    | DOTDOT                                                 # Wildcard
     ;
 
 /******************************************************************************