Computer Science, asked by Anonymous, 7 months ago

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 shivaramcvm
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