help-bison
[Top][All Lists]
Advanced

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

RE: y.output format


From: Bernard Granier
Subject: RE: y.output format
Date: Thu, 10 Jan 2002 18:19:10 +0100

Hi,

Thanks for your response.

I still get some questions.

The line :
 << $default    reduce using rule 7 (command)>> explains that the default
action is to reduce using rule 7 (?)

 Which is the state of the states machine after the reduction ?

In my output file I get lines like :
 rule 359  @31 ->               /* empty */

 What does the @31 means ?


Bernard Granier
Mr Ted
115 rue du Fbg Poissonniere
75009 Paris
www.MrTed.com
Tel : 33 1 55 31 02 65
mail : address@hidden


-----Original Message-----
From: Hans Aberg [mailto:address@hidden
Sent: jeudi 10 janvier 2002 11:49
To: Bernard Granier
Cc: address@hidden Org
Subject: Re: y.output format


At 18:54 +0100 2002/01/09, Bernard Granier wrote:
> Where can I find a  simple tutorial which explains the y.output file
format ?

It follows the standard format of bottom up parsing (Bison uses LALR(1)),
son one can look into standard books describing that method. For example,
Aho, Sethi & Ullman, "Compilers...".

Bison generates code for a stack machine, which uses a lookahead token to
determine what action to take, and to find the next state. For example, in
state 11
    command  ->  "rule" expression_list .   (rule 7)
    expression_list  ->  expression_list . production   (rule 10)

    "nonterminal"       shift, and go to state 12

    $default    reduce using rule 7 (command)

    production  go to state 13

the dot "." on the RHS means that this is the point the state machine has
parsed so far, and the list below tells which action to take, and which is
the next state after that.





reply via email to

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