Re: Advice for recursive descent parser

jamin.hanson@googlemail.com
Wed, 1 Apr 2009 14:09:28 -0700 (PDT)

          From comp.compilers

Related articles
Advice for recursive descent parser pk@pk.invalid (pk) (2009-03-31)
Re: Advice for recursive descent parser jamin.hanson@googlemail.com (2009-04-01)
Re: Advice for recursive descent parser cfc@shell01.TheWorld.com (Chris F Clark) (2009-04-01)
| List of all articles for this month |
From: jamin.hanson@googlemail.com
Newsgroups: comp.compilers
Date: Wed, 1 Apr 2009 14:09:28 -0700 (PDT)
Organization: Compilers Central
References: 09-03-126
Keywords: parse, LL(1)
Posted-Date: 04 Apr 2009 09:45:16 EDT

On 31 Mar, 16:32, pk <p...@pk.invalid> wrote:
> I'm trying to write a recursive descent parser for this grammar


I use the following grammar for lexertl (http://www.benhanson.net/
lexertl.html):


<REGEX> -> <OREXP>
<OREXP> -> <SEQUENCE> | <OREXP>'|'<SEQUENCE>
<SEQUENCE> -> <SUB>
<SUB> -> <EXPRESSION> | <SUB><EXPRESSION>
<EXPRESSION> -> <REPEAT>
<REPEAT> -> charset | macro | '('<REGEX>')' | <REPEAT><DUPLICATE>
<DUPLICATE> -> '?' | '*' | '+' | '{n[,[m]]}'


The rules <REGEX> and <SEQUENCE> were only introduced to simplify the
processing, as I use a bottom up parser.


I hope that helps.


Regards,


Ben



Post a followup to this message

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