Compilers - Am I writing one?

Michael Torrie torriem at gmail.com
Mon Jun 30 10:20:58 MDT 2008


Hans Fugal wrote:
> Jacob Fugal wrote:
>> From my understanding, this is one of the major differences between
>> BNF and EBNF. EBNF allows specifying right repetition ala:
>>
>>   expr -> term { addop term }
>>   addop -> "+" | "-"
>>
>> and optionality ala:
>>
>>   if-stmt -> "if" expr "then" stmt-block [ "else" stmt-block ]
>>
>> These constructions covert really easily into both a syntax diagram
>> and a recursive descent implementation. Maybe I'm misremembering,
>> though.
>>
>> Jacob Fugal
> 
> Good point, and I was using EBNF not straight BNF (which only has 
> theoretical value, IMHO).

Good to know.  I'm sure, then, that ANTLR probably uses this kind of
EBNF.  This sounds like the way to go.  Of course unless we can find a
parser generator that can output LISP, this won't directly help Daniel.
   Except that it should be easy, given the syntax diagram, or EBNF, to
create an adhoc parser in LISP that would work quite well.



More information about the PLUG mailing list