This commit is contained in:
NikolajDanger
2022-06-09 12:41:00 +02:00
parent 5ff8dd409a
commit 7c20bc1c2c
5 changed files with 1 additions and 162 deletions

View File

@ -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 }