Академический Документы
Профессиональный Документы
Культура Документы
NOTICE!!
Make sure your outputs are identical to that
of the *.correct files.
Part 1 - Scanner
Purpose of scanner
Break down the input string into tokens
In this part, Scanner prints out all tokens it finds
Scanner: TODO
Read and understand Scan.scan() function
Provide code in Scan.java and TK.java for
omitted tokens:
e.g. =, ~, >
Part 2: Parser
Purpose of a parser:
Accept or reject given strings (recognizer)
Build parse tree
other operations, e.g. expression evaluation
Example
@a
a = 999
!a+a
[a:!1111 % @a a=8888 !a]
!a
ArrayList<ArrayList<Variable>>
class Variable{ public String name; public int
val;...}