help-bison
[Top][All Lists]
Advanced

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

Re: y.output format


From: Hans Aberg
Subject: Re: y.output format
Date: Thu, 10 Jan 2002 11:48:50 +0100

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]