ANSWERS GRADED A+ (LATEST
UPDATE 2026)
Syntax - answer-specifies how program in the language are built up
Semantic - answer-specifies what the program means
Lexical Syntax - answer-spelling of words notation:
regular expression, ex) a*, ab+, (a|b)+
sample words: a, aa, aaa, ab, abb, abab,.
grammar (CFG) Context Free Grammar - answer-notation: BNF (Backus-Naur Form)
EBNF (extended Backus-Naur Form) syntax chart (graphical)
What are the 3 expression notations? - answer-Prefix, easy to decode
Infix, user friendly (easy to read)
-Needs precedence and associativity
-Only infix uses ( )
Postfix, evaluated by stack
Abstract Syntax Tree (AST) - answer-Uses op(+,-,*,/) , id(a,b,c), num(1,2,3)
Parse Tree - answer-Built from grammar
Unambiguous Grammar - answer-1. Keep precedence (Lower precedence up)