[erlang-questions] Parsing C with leex and yecc

Joe Armstrong <>
Tue Jul 20 20:39:47 CEST 2010

On Tue, Jul 20, 2010 at 7:34 PM, Tony Arcieri <> wrote:
> On Tue, Jul 20, 2010 at 3:28 AM, Joe Armstrong <> wrote:
>>   The traditional yacc/lex approach solves this with a context
>>   sensitive lex and feedback between yacc and lex. But the Erlang
>>   leex and yacc seem to be written as separated passes, are there some
>>   internal functions that allow feedback between leex and yacc?
> I've run into the need for lexer/parser feedback myself, specifically
> processing interpolated strings (that contain expressions from the outer
> language) in Reia.  I haven't found a good solution.  Interpolation works
> but only on a subset of expressions... for example you can't nest strings
> within strings.
> Have you thought about using neotoma?

Yes - I've also been playing with my own peg combinator library :-).
The problem is that LALR(1) parsers can give you pretty good automatic error
diagnostics on faulty input. Peg grammars just fail - period - and you
have to write
your own error recovery in the grammar - on the other hand the peg grammar
is much nicer than the yacc grammar


> --
> Tony Arcieri
> Medioh! A Kudelski Brand

More information about the erlang-questions mailing list