Quote:
|
Originally Posted by DaWei
For completeness, you have to have a definition of a statement list, which requires a definition of a statement. The definition of a statement may require additional definitions. Then, if you have one, and only one, 'begin', followed by any number of valid statements, followed by an "end", then the expression is okay. There may be some definition of whether or not zero statements is acceptable. I don't think you'll find that the evaluation of that expression is going to qualify for your assignment, but I may be wrong.
|
you're right, but right now, considering i'm so confused, i wanted just to evaluate the expression rather than generate the parser trees, if thats what you were talkin abt.
consider that my program is supposed to have only two rules given below (and only <, <> and integer tokens)
<type> ::= integer
<relation> ::= = | <> | < | >
now, consider the statement below
<55> <>
my scanner would return < as a token, and then return 55 as integer token etc
i think ... the problem i am facing is i dont know how to connect the parser part with my scanner that i already have