[Top][All Lists]

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

Re: Stack overflow

From: Waldek Hebisch
Subject: Re: Stack overflow
Date: Thu, 6 Apr 2006 18:38:50 +0200 (CEST)

> >>> "Paul" == Paul Eggert <address@hidden> writes:
>  > Waldek Hebisch <address@hidden> writes:
>  >> bison-2.1 fails to detect stack overflow in GLR parser.
>  >    * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
>  >    led to a segmentation fault in GNU Pascal.  Problem reported
>  >    by Waldek Hebisch.
> How come GNU Pascal wishes to use GLR?  I thought Pascal's syntax was
> clean.

Clean syntax is long forgotten. Look at Extended Pascal standard (ISO-10206)
and at Borland Delphi. Both have large and hairy grammars. Especially
Borland add a bunch of constructs that are pretty tricky to parse. 
GNU Pascal wants to compatible to both of them (and to a few less popular
dialects). So GNU Pascal accepts legal constructs of _both_ dialects,
but keeps as reserved words only original Pascal reserved words. For
details look at GNU Pascal manual, internals part contains nice examples
of constructs which are beyond capabilities of LL(1) and LR(1) parsers.

Using GLR has both advantages (grammar is simpler and handles more
constructs than old non-GLR grammar) and disadvantages (debugging
parser is harder), but the balace is very positive.

                              Waldek Hebisch

reply via email to

[Prev in Thread] Current Thread [Next in Thread]