Re: ANNOUNCE: Tiny, a parser generator for context sensitive grammars

"Maurice Gittens" <maurice@gittens.nl>
2 Aug 2001 02:33:17 -0400

          From comp.compilers

Related articles
ANNOUNCE: Tiny, a parser generator for context sensitive grammars maurice@gittens.nl (Maurice Gittens) (2001-07-23)
Re: ANNOUNCE: Tiny, a parser generator for context sensitive gram eodell@c1220335-a.potlnd1.or.home.com (2001-07-27)
Re: ANNOUNCE: Tiny, a parser generator for context sensitive grammars wb@vestein.arb-phys.uni-dortmund.de (2001-07-30)
Re: ANNOUNCE: Tiny, a parser generator for context sensitive grammar maurice@gittens.nl (Maurice Gittens) (2001-08-02)
| List of all articles for this month |

From: "Maurice Gittens" <maurice@gittens.nl>
Newsgroups: comp.compilers
Date: 2 Aug 2001 02:33:17 -0400
Organization: XS4ALL Internet BV
References: 01-07-128 01-07-149 01-07-154
Keywords: parse
Posted-Date: 02 Aug 2001 02:33:17 EDT

"Wilhelm B. Kloke" <wb@vestein.arb-phys.uni-dortmund.de> wrote:
> IMHO the a^nb^nc^n example is one such example. What I would like to see
> is some explicit advice how to convert a YACC grammar to Tiny.


Let A->@ be a production rule in a YACC grammar.


For a dotted grammar this might be replaced by:


.A->.@ A and @.A -> A.


So the single YACC production rule is replaced by two dotted production
rules.


So dotted grammars would seem to be at a disadvantage because according to
the recipe above the number of production rules in the dotted variant
is twice as many.


On the positive side dotted grammars do offer more flexibility where
semantic actions are concered.


Tiny allows semantic actions to be used for:
- selection of left hand sides
- selection of right hand sides
- execution of arbitrary code after rewritting has taken place


The YACC based grammar only allows one semantic action and
these actions cannot (as for as I know) influence parsing decisions.


> Some other thought is related to vanWijngarden 2level grammars. Could
> Tiny be used to convert the Algol68 grammar given in the Revised Report
> to a working parser?


I've given some thought to this and I currently expect that (some form of)
two level grammars will be able to be translated into dotted
grammars but this is currently just a hunch.


Cheers,
Maurice.


Post a followup to this message

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