help-bison
[Top][All Lists]
Advanced

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

Re: How to decide what to put in the lexer and the grammar respectively?


From: Peng Yu
Subject: Re: How to decide what to put in the lexer and the grammar respectively?
Date: Sun, 17 Feb 2019 16:10:40 -0600

This lexical tie-in creates feedback from the parser to the lexer. So
the lexer cannot be tested standalone.

But the principle of separating lexer and parser is to make parser
builtin on top of the parser. Is there something that can avoid the
feedback yet still allow context-dependent parsing? Alternatively, how
to just testing the lexer without having to get the parser involved?

> There is one reason that could have driven to this architecture:
> the fact that the lexical structure in strings is very different.
> There are no comments, spaces matter, etc.  So that's a case
> where the parser state controls the type of scanning you need,
> which is called lexical tie-in in Bison's documentation.  It's
> doable, but not very elegant.

-- 
Regards,
Peng



reply via email to

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