Previous: The basic models of input, Up: Input [Contents][Index]
Traditionally, a terminal symbol is a symbol that may appear in the input. Traditional grammars divide all symbols sharply into terminals and non-terminals: A terminal symbol must always be used as a terminal. A non-terminal symbol can never be used as a terminal.
In Libmarpa, by default, a symbol is a terminal, and therefore may appear in the input iff both of the following are true:
Marpa’s default behavior follows tradition. A now-deprecated feature of Marpa allowed for LHS terminals. See LHS terminals. Most readers will want to stick to Marpa’s default behavior, and can and should ignore the possibility of LHS terminals. Even when LHS terminals are allowed, terminals can never be zero length.
In Libmarpa,
every terminal instance has a token value associated with it.
Token values are int
’s.
Libmarpa does nothing with token values except accept
them from the application and return them during
parse evaluation.