diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:11:14 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:11:14 +1100 |
commit | 697c1c0cd3815eee72b3eedb874fe0e044a69432 (patch) | |
tree | 060ce9577a9651cbcb2f11c6444bc649efc4a468 /impl/EquationSystem.g | |
parent | be1de4be954c80875ad4108e0a33e8e131b2f2c0 (diff) |
Some bug fixes for the solver.
Still doesn't work in clang, though.
Diffstat (limited to 'impl/EquationSystem.g')
-rw-r--r-- | impl/EquationSystem.g | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/impl/EquationSystem.g b/impl/EquationSystem.g index cec400f..4884ca9 100644 --- a/impl/EquationSystem.g +++ b/impl/EquationSystem.g @@ -26,16 +26,19 @@ maxExpr : MAXIMUM^ '('! minExpr ( ','! minExpr )* ')'! | minExpr ; minExpr : MINIMUM^ '('! maxExpr ( ','! maxExpr )* ')'! | expr ; expr : '(' expr GREATER_EQUAL expr QUESTION_MARK expr ')' -> ^(GUARD expr expr expr) + | GUARD^ '('! maxExpr ','! maxExpr ','! maxExpr ')'! + | 'add'^ '('! maxExpr ( ','! maxExpr )* ')'! + | 'sub'^ '('! maxExpr ( ','! maxExpr )* ')'! + | 'mult'^ '('! maxExpr ( ','! maxExpr )* ')'! | term ( (PLUS | MULT | SUB | COMMA)^ expr )* ; term : NUMBER | VARIABLE - | '-'^ term - | '('! maxExpr ')'! ; + | '-'^ term ; NUMBER : (DIGIT)+ ; -VARIABLE: (LETTER) (LETTER | DIGIT)* ; +VARIABLE: (LETTER) (LETTER | DIGIT | '-' | '\[' | ']' )* ; WHITESPACE : ( '\t' | ' ' | '\u000C' )+ { $channel = HIDDEN; |