|[2 earlier articles]|
|Re: Precedence based parsing firstname.lastname@example.org (John McEnerney) (2003-12-08)|
|Re: Precedence based parsing email@example.com (2003-12-08)|
|Re: Precedence based parsing firstname.lastname@example.org (Andi Kleen) (2003-12-08)|
|Re: Precedence based parsing email@example.com (2003-12-13)|
|Re: Precedence based parsing firstname.lastname@example.org (Rob Thorpe) (2003-12-13)|
|Re: Precedence based parsing email@example.com (Clint Olsen) (2003-12-20)|
|Re: Precedence based parsing firstname.lastname@example.org (Steve Meyer) (2003-12-23)|
|Re: Precedence based parsing email@example.com (Joachim Durchholz) (2003-12-27)|
|Re: Precedence based parsing firstname.lastname@example.org (2003-12-27)|
|Re: Precedence based parsing derkgwen@HotPOP.com (Derk Gwen) (2004-01-02)|
|From:||Steve Meyer <email@example.com>|
|Date:||23 Dec 2003 00:21:02 -0500|
|Organization:||Global Network Services - Remote Access Mail & News Services|
|References:||03-12-035 03-12-056 03-12-097 03-12-113|
|Posted-Date:||23 Dec 2003 00:21:02 EST|
Our open source Verilog simulator uses operator precedence to parse
Verilog expressions as a separate section of a hand coded recursive
descent parser. The operator precedence code uses procedure calls
following algorithm in Gries' old compiler book (Gries, D. "Compiler
construction for digital computers").
GPL Cver home page is www.pragmatic-c.com/gpl-cver. You can see the code
in the v_src2.c file.
Verilog expressions are complex and language is irregular and non context
free. For example, scanner requires information from state of parser to
distinguish tokens. Such language constructs are what hardware designers
In a more general sense, I have never understood why people insist
on using weak push down autamata (PDA) machine parsing tables when
programming languages provide the full power of Turing Machines.
On 20 Dec 2003 11:49:33 -0500, Clint Olsen <firstname.lastname@example.org> wrote:
> On 2003-12-14, Rob Thorpe <email@example.com> wrote:
>> Especially where the larger parser was top-down. This was done to
>> make the parser faster, but today a top-down parser is normally fast
>> enough anyway when you can use one.
> Perhaps I'm missing something obvious, but you can do efficient
> precedence-based top-down parsing, so I don't quite know what's so
> great about this method. Using a precedence table, you can decide
> whether or not a recursive call is necessary to parse a higher
> precedence operator. Hanson and Fraser cover this in their book, "A
> Retargetable C Compiler : Design and Implementation."
> [It probably made more difference when the whole compiler had to fit
> into 24K bytes. -John]
Steve Meyer Phone: (612) 371-2023
Pragmatic C Software Corp. email: firstname.lastname@example.org
520 Marquette Ave. So., Suite 900
Minneapolis, MN 55402
Return to the
Search the comp.compilers archives again.