Contents
Page-10
Prev
Next
Page+10
Index
Token Data Structure
Converting lexical items into tokens simplifies
later processing
by reducing the input to a few standard kinds of tokens: reserved words,
identifiers, numbers, operators, strings, delimiters.
The tokens serve as the terminal symbols of the parser grammar.
A token will contain:
- token type (identifier, operator, etc.)
- basic data type basicdt: a numeric code indicating integer,
real, pointer
- pointers to the symbol table
- pointers for making trees from tokens
- value of the token (identifier name, number value, numeric code
indicating which operator).