Hi Akim -

On 08/05/2019 20:54, Akim Demaille wrote:

Flex is hardly concerned with this: once it matched the rule
for "identifier", it is *your* action which is in charge whether
to return a "type identifier" or "variable identifier" etc.


I'm not sure that we're taking about the same thing. Sometimes, to make the grammar manageable, the lexer has to *dynamically* return 'typename' instead of 'identifier'. Only semantic analysis can determine what is a user-defined type (say 'foo'), so the lexer must be told at runtime that 'foo' is a 'typename' and not an 'identifier'.

See also the so-called lexical tie-in in the doc.

Thanks - that information is also in the old O'Reilly book, but I'm afraid that it's not enough for this problem.

_______________________________________________
help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to