import System.Collections;
import CUP.runtime;
/* Terminals (tokens returned by the scanner). */
terminal SEMI, PLUS, MINUS, TIMES, DIVIDE, MOD;
terminal UMINUS, LPAREN, RPAREN, COMMA, ROUND;
terminal AND, OR, EQ, NEQ, LT_EQ, LT, GT_EQ, GT;
terminal NEGATE;
terminal int INTEGER;
terminal double REAL;
terminal string FUNCTION, LITERAL;
/* Non terminals */
non terminal Formula expr_part;
non terminal ArrayList param_list;
non terminal Formula expr;
/* Precedences */
precedence left EQ, NEQ, LT_EQ, LT, GT_EQ, GT;
precedence left ROUND;
precedence left PLUS, MINUS, OR, NEGATE;
precedence left TIMES, DIVIDE, MOD, AND;
precedence left UMINUS, LPAREN, RPAREN;
/* The grammar */
expr_part ::= expr:e SEMI
{: RESULT = e;
:}
| error
;
|
This is also a command-line tool that is standalone. There is no integration with
Visual Studio .NET planned at this time (what a great open-source project idea!)