{int a = 1;int b = a + 1;if(1 < a) { b = 1; }}
(SCOPE(DECLARATIONS(DECLARATION a int 1)(DECLARATION b int (BINARY int + a 1)))(STATEMENTS(IF (BINARY bool < 1 a)(SCOPE(DECLARATIONS)(STATEMENTS(ASSIGN int b 1))))))
--
Some non-terminals map to AST nodes; this is expected.
Sent from my mobile device.
--
--
--
(ASSIGN int (INDEX int a 1) 10)
--
Is there precedence on semantic errors to be reported? Does it have to follow line#, col# as in bonus?
--
No, as stated in the assignment spec, whitespace is mostly ignored in the printing format.
Sent from my mobile device.
--
(ASSIGN type variable-name new-value) where new-value is an expression form, and
type is the type form corresponding to the type of the variable.
--