✨
This commit is contained in:
@ -19,23 +19,6 @@ let parse_error_rich =
|
||||
|
||||
%}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// TODO: Add new (lexer) token definitions:
|
||||
//
|
||||
// TODO: project task 1 :
|
||||
// - multiplication (*), division (/), numerical negation (~),
|
||||
// logical negation (not), logical and (&&), logical or (||),
|
||||
// boolean literals (true, false)
|
||||
// - add the required precedence and associativity rules for
|
||||
// *, /, ~, not, &&, ||
|
||||
// - generalize the syntax of let-expressions to allow
|
||||
// multiple variable declarations
|
||||
//
|
||||
// TODO: project task 2: replicate, filter, scan
|
||||
//
|
||||
// TODO: project task 4: array comprehension
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
%token <int * Position> NUM
|
||||
%token <char * Position> CHARLIT
|
||||
%token <string * Position> ID STRINGLIT
|
||||
@ -68,7 +51,7 @@ let parse_error_rich =
|
||||
%type <AbSyn.UntypedExp> Exp
|
||||
%type <AbSyn.UntypedExp list> Exps
|
||||
%type <AbSyn.UntypedFunArg> FunArg
|
||||
// TODO: Task 1(b): add any new nonterminals here
|
||||
|
||||
%type <AbSyn.UntypedExp> MultiLet
|
||||
|
||||
%%
|
||||
@ -106,11 +89,6 @@ BinOp : PLUS { (Lambda
|
||||
$1) ,$1))}
|
||||
;
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
// TODO: project tasks 1,2,4:
|
||||
// add grammer rules for the new expressions
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
Exp : NUM { Constant (IntVal (fst $1), snd $1) }
|
||||
| CHARLIT { Constant (CharVal (fst $1), snd $1) }
|
||||
| ID { Var $1 }
|
||||
|
Reference in New Issue
Block a user