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

Fw: Re: shortcut



It seems that the message didn't get through the first time...

----
Why not do it in the lexer? It would simplify the grammar:

Tokens
  begin = 'b' ('e' ('g' ('i' 'n'?)?)?)?;
  mc11 = 'mc1' '1'?;
  mc2 = 'mc2';

Productions
  ... begin ...
  ... mc11 ...
  ... mc2 ...

Etienne
----

Now, to Archie: You are mostly right. A small point, though... grammars
described using the BNF notation are "context-free". A context-sensitive
grammar is obtained when the parser uses semantic informations to make
reduce/shift decisions;-).

Etienne