Name: ____________________________________________________ Alpha: _____________________
Describe help received: _________________________________________________________________
Consider the simple arithmetic grammer below:
exp -> exp OPA term | term
term -> term OPM factor | sfactor <-- NOTE: "sfactor" stands for "signed-factor", it handles unary "-"
sfactor -> OPA factor | factor
factor -> NUM | LP exp RP
where OPA = +|-, OPM = *|/, LP = (, RP = ), and NUM = digit+.
-34*(16-27/2), and next to it
what you think the abstract syntax tree should be (I realize
this has not been precisely defined, so there's lattitude here).
(11:23:2019-10:14:2019)/2 + 10:14:2007... make sense. Try to extend/modify the grammar at the top of the page to make this happen. Show me the modified grammar as well as a parse tree for
11:23:2019+6 using your extended grammar.
Would it be a problem to use / instead of : for delimiting
dates? why?