-
CS 421/521: Compilers and Interpreters Spring 2017, Yale University. Appel and SML.
- https://github.com/fsprojects/zzarchive-powerpack Where are FsLex and FsYacc?
It is a C function that returns an integer, which is a code for one of the possible token names. The attribute value, whether it be another numeric code, a pointer to the symbol table, or nothing, is placed in a global variable
yylval
(in our case —cool_yylval
), which is shared between the lexical analyzer and parser, thereby making it simple to return both the name and an attribute value of a token.