/[bison]/bison/data/bison.c++
ViewVC logotype

Diff of /bison/data/bison.c++

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by ra, Thu Feb 7 16:41:23 2002 UTC revision 1.9 by ra, Fri Feb 8 14:07:10 2002 UTC
# Line 30  Line 30 
30  #include "stack.hh"  #include "stack.hh"
31  #include "location.hh"  #include "location.hh"
32    
33  b4_prologue  #include <string>
34    
35  /* Enabling traces.  */  /* Enabling traces.  */
36  #ifndef YYDEBUG  #ifndef YYDEBUG
# Line 45  b4_prologue Line 45  b4_prologue
45  /* Using locations.  */  /* Using locations.  */
46  #define YYLSP_NEEDED b4_locations_flag  #define YYLSP_NEEDED b4_locations_flag
47    
48    b4_prologue
49    
50  // FIXME: This should be defined in traits, not here.  // FIXME: This should be defined in traits, not here.
51  typedef b4_stype yystype;  typedef b4_stype yystype;
52    
# Line 80  namespace yy Line 82  namespace yy
82      typedef Stack< SemanticType > SemanticStack;      typedef Stack< SemanticType > SemanticStack;
83      typedef Stack< LocationType > LocationStack;      typedef Stack< LocationType > LocationStack;
84    
85    #if YYLSP_NEEDED
86        b4_name (bool debug,
87                 LocationType initlocation) : debug_ (debug),
88                                              initlocation_ (initlocation)
89    #else
90      b4_name (bool debug) : debug_ (debug)      b4_name (bool debug) : debug_ (debug)
91    #endif
92      {      {
93      }      }
94    
# Line 155  namespace yy Line 163  namespace yy
163      /* @$ and $$.  */      /* @$ and $$.  */
164      SemanticType value;      SemanticType value;
165      LocationType location;      LocationType location;
166    
167        /* Initial location.  */
168        LocationType initlocation_;
169    };    };
170  }  }
171    
# Line 197  yy::b4_name::parse () Line 208  yy::b4_name::parse ()
208    /* Start.  */    /* Start.  */
209    state_ = 0;    state_ = 0;
210    looka_ = empty_;    looka_ = empty_;
211    #if YYLSP_NEEDED
212      location = initlocation_;
213    #endif
214    YYDPRINTF ((stderr, "Starting parse\n"));    YYDPRINTF ((stderr, "Starting parse\n"));
215    
216    /* New state.  */    /* New state.  */
# Line 272  yy::b4_name::parse () Line 286  yy::b4_name::parse ()
286    
287    semantic_stack_.push (value);    semantic_stack_.push (value);
288    location_stack_.push (location);    location_stack_.push (location);
289    
290      /* Count tokens shifted since error; after three, turn off error
291         status.  */
292      if (errstatus)
293        --errstatus;
294    
295    state_ = n_;    state_ = n_;
296    goto yynewstate;    goto yynewstate;
297    
# Line 379  yy::b4_name::parse () Line 399  yy::b4_name::parse ()
399        else        else
400  #endif  #endif
401          message = "parse error";          message = "parse error";
402          error_ ();
403      }      }
   error_ ();  
404    goto yyerrlab1;    goto yyerrlab1;
405        
406    /* Error raised explicitly by an action.  */    /* Error raised explicitly by an action.  */

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26