The codes for all tokens are defined in the file cool-parse.h . All of the single character tokens are listed in the grammar for Cool in CoolAid. The semantic values or attributes of a token are different depending on the token being passed. For example, for integer constants, the numeric value of the constant is passed. For identifiers, an integer uniquely identifying the identifier is passed.
Programs tend to have many occurrences of the same lexemes.
To save space and time, a common compiler practice is to store lexemes in a string table . We provide you with a string table package, which is discussed in detail in A Tour of the Cool Support Code and documentation in the code. For the moment, we only need to know that the type of string table entries is Symbol . The default action simply copies the string to stdout . Your final scanner should have no default actions.