Re: coupling LALR with a scanner?

"Armel" <armelasselin@hotmail.com>
Thu, 7 Jul 2011 10:28:46 +0200

          From comp.compilers

Related articles
coupling LALR with a scanner? armelasselin@hotmail.com (Armel) (2011-07-05)
Re: coupling LALR with a scanner? armelasselin@hotmail.com (Armel) (2011-07-07)
coupling LALR with a scanner? uu3kw29sb7@snkmail.com (Karsten Nyblad) (2011-07-07)
Re: coupling LALR with a scanner? uu3kw29sb7@snkmail.com (Karsten Nyblad) (2011-07-08)
Re: coupling LALR with a scanner? armelasselin@hotmail.com (Armel) (2011-08-04)
Re: coupling LALR with a scanner? paul@paulbmann.com (Paul B Mann) (2011-09-13)
Re: coupling LALR with a scanner? armelasselin@hotmail.com (Armel) (2011-09-16)
Re: coupling LALR with a scanner? paul@paulbmann.com (Paul B Mann) (2011-09-17)
[8 later articles]
| List of all articles for this month |

From: "Armel" <armelasselin@hotmail.com>
Newsgroups: comp.compilers
Date: Thu, 7 Jul 2011 10:28:46 +0200
Organization: les newsgroups par Orange
References: 11-07-013
Keywords: parse, lex
Posted-Date: 07 Jul 2011 13:46:33 EDT

>[The usual approach is to set flex start states in your yacc or bison
>parser. >-John]


the LALR generator is one of mine and the idea here would be to select
automatically the right lexer from the currently accepted tokens. I have the
feeling that it must be doable. The target is to be able to write grammars
with such dependencies naturally without any (user level) grammar actions
and very minimal lexer meta-information (such as which lexer produces which
tokens).


Armel
[I think you will find that users hate a compiler where in each state the
lexer only recognizes the tokens valid in that state, since the only error
message it could produce is "invalid token." Also remember that the LA in
LALR stands for Look Ahead, and the lexer is often one token ahead of the
parser. -John]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.