help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing user-defined types


From: EML
Subject: Re: Parsing user-defined types
Date: Wed, 8 May 2019 21:30:21 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]