Give value of the following WAE expressions [with * and / included]. In other words, if I ran (calc (parse ... on these, what would DrRacket print? Explain your answers. {with {x 5} {with {x {+ x x}} {+ x {* x x}} } } {+ {/ 7 2} {- 8 3}} {with {a {with {b 2} {+ b 3}} } {with {b {- a 1}} {* a b} } }
Answers
Answered by
0
terminal SEMICOLON, IF, THEN, ELSE, ELIF, FI, WHILE, DO, DONE, ERROR;
terminal String WORD;
non terminal
StmtList, Stmt, ElseOpt, WordList;
start with StmtList;
StmtList::=
Stmt
|
StmtList Stmt
;
Stmt::=
WordList SEMICOLON
|
IF WordList THEN StmtList ElseOpt FI
|
WHILE WordList DO StmtList DONE
;
ElseOpt::=
/* Empty */
|
ELIF WordList THEN StmtList ElseOpt
|
ELSE StmtList
;
WordList::=
WORD
|
WORD WordList
;
Assume
Similar questions
Social Sciences,
3 months ago
Math,
3 months ago
Environmental Sciences,
7 months ago
Math,
7 months ago
Physics,
1 year ago
Biology,
1 year ago
English,
1 year ago