First page Back Continue Last page Summary Graphic
Scanner Implementation
Example: We have 6 different token classes
NUM ["-" | "+"] Digit { Digit }
LT <
LTEQ <=
EQ ==
NEQ /=
EOF \uFFFF
A valid token sequence would be:
12<117<===<-3==/==
Task: Implement a scanner, which prints out the
sequence of token classes for a given input
NUM, <, NUM, <=, ==, <, -3, ==, /=