summaryrefslogtreecommitdiff
path: root/Jennisys/Parser.fsy
diff options
context:
space:
mode:
Diffstat (limited to 'Jennisys/Parser.fsy')
-rw-r--r--Jennisys/Parser.fsy27
1 files changed, 16 insertions, 11 deletions
diff --git a/Jennisys/Parser.fsy b/Jennisys/Parser.fsy
index c683e84c..e854d749 100644
--- a/Jennisys/Parser.fsy
+++ b/Jennisys/Parser.fsy
@@ -21,6 +21,7 @@ let rec MyFold ee acc =
%token NOT
%token STAR DIV MOD
%token PLUS MINUS
+%token DOTDOT
%token EQ NEQ LESS ATMOST ATLEAST GREATER IN NOTIN
%token AND OR
%token IMPLIES
@@ -141,16 +142,16 @@ Expr25:
| Expr30 { $1 }
| Expr30 QMARK Expr25 COLON Expr25 { IteExpr($1,$3,$5) }
Expr30:
- | Expr40 { $1 }
- | Expr40 AND Expr30and { BinaryAnd $1 $3 }
- | Expr40 OR Expr30or { BinaryOr $1 $3 }
+ | Expr40 { $1 }
+ | Expr40 AND Expr30and { BinaryAnd $1 $3 }
+ | Expr40 OR Expr30or { BinaryOr $1 $3 }
Expr30and:
- | Expr40 { $1 }
- | Expr40 AND Expr30and { BinaryAnd $1 $3 }
+ | Expr40 { $1 }
+ | Expr40 AND Expr30and { BinaryAnd $1 $3 }
Expr30or:
- | Expr40 { $1 }
- | Expr40 AND Expr30or { BinaryOr $1 $3 }
-
+ | Expr40 { $1 }
+ | Expr40 AND Expr30or { BinaryOr $1 $3 }
+
Expr40:
| Expr50 { $1 }
| Expr50 EQ Expr50 { BinaryExpr(40,"=",$1,$3) }
@@ -161,11 +162,15 @@ Expr40:
| Expr50 GREATER Expr50 { BinaryExpr(40,">",$1,$3) }
| Expr50 IN Expr50 { BinaryExpr(40,"in",$1,$3) }
| Expr50 NOTIN Expr50 { BinaryExpr(40,"!in",$1,$3) }
-
+
Expr50:
+ | Expr55 { $1 }
+ | Expr55 DOTDOT Expr55 { BinaryExpr(50,"..",$1,$3) }
+
+Expr55:
| Expr60 { $1 }
- | Expr50 PLUS Expr60 { BinaryExpr(50,"+",$1,$3) }
- | Expr50 MINUS Expr60 { BinaryExpr(50,"-",$1,$3) }
+ | Expr55 PLUS Expr60 { BinaryExpr(55,"+",$1,$3) }
+ | Expr55 MINUS Expr60 { BinaryExpr(55,"-",$1,$3) }
Expr60:
| Expr90 { $1 }