torc::generic::Parser Class Reference

A Bison parser. More...

#include <Parser.h>

Collaboration diagram for torc::generic::Parser:

Collaboration graph
[legend]

List of all members.

Public Types

typedef location location_type
 Symbol locations.
typedef token::yytokentype token_type
 Token type.
typedef int debug_level_type
 Type for debugging levels.

Public Member Functions

 Parser (class Driver &inDriver_yyarg)
 Build a parser object.
virtual int parse ()
std::ostream & debug_stream () const
 The current debugging stream.
void set_debug_stream (std::ostream &)
 Set the current debugging stream.
debug_level_type debug_level () const
 The current debugging level.
void set_debug_level (debug_level_type l)
 Set the current debugging level.

Private Types

typedef int state_type
 State numbers.
typedef stack< state_typestate_stack_type
 State stack type.
typedef stack< semantic_typesemantic_stack_type
 Semantic value stack type.
typedef stack< location_typelocation_stack_type
 location stack type.
typedef unsigned short int token_number_type
 Internal symbol numbers.
typedef short int rhs_number_type
 A type to store symbol numbers and -1.

Private Member Functions

virtual void error (const location_type &loc, const std::string &msg)
virtual std::string yysyntax_error_ (int yystate, int tok)
virtual void yy_symbol_value_print_ (int yytype, const semantic_type *yyvaluep, const location_type *yylocationp)
 Report a symbol value on the debug stream.
virtual void yy_symbol_print_ (int yytype, const semantic_type *yyvaluep, const location_type *yylocationp)
 Report a symbol on the debug stream.
virtual std::string yytnamerr_ (const char *n)
 Convert the symbol name n to a form suitable for a diagnostic.
virtual void yy_reduce_print_ (int r)
 Report on the debug stream that the rule r is going to be reduced.
virtual void yystack_print_ ()
 Print the state stack on the debug stream.
token_number_type yytranslate_ (int t)
 Convert a scanner token number t to a symbol number.
void yydestruct_ (const char *yymsg, int yytype, semantic_type *yyvaluep, location_type *yylocationp)
 Reclaim the memory associated to a symbol.
void yypop_ (unsigned int n=1)
 Pop n symbols the three stacks.

Private Attributes

state_stack_type yystate_stack_
 The state stack.
semantic_stack_type yysemantic_stack_
 The semantic value stack.
location_stack_type yylocation_stack_
 The location stack.
int yydebug_
std::ostream * yycdebug_
class DriverinDriver

Static Private Attributes

static const short int yypact_ []
 For a state, the index in yytable_ of its portion.
static const short int yypact_ninf_ = -1561
static const unsigned short int yydefact_ []
static const short int yypgoto_ []
static const short int yydefgoto_ []
static const unsigned short int yytable_ []
static const signed char yytable_ninf_ = -1
static const short int yycheck_ []
static const unsigned short int yystos_ []
 For a state, its accessing symbol.
static const unsigned short int yyr1_ []
 For a rule, its LHS.
static const unsigned char yyr2_ []
 For a rule, its RHS length.
static const char *const yytname_ []
 For a symbol, its name in clear.
static const rhs_number_type yyrhs_ []
 A `-1'-separated list of the rules' RHS.
static const unsigned short int yyprhs_ []
 For each rule, the index of the first RHS symbol in yyrhs_.
static const unsigned short int yyrline_ []
 For each rule, its source line number.
static const unsigned short int yytoken_number_ []
 For each scanner token number, its symbol number.
static const int yyeof_ = 0
static const int yylast_ = 2272
static const int yynnts_ = 553
static const int yyempty_ = -2
static const int yyfinal_ = 4
static const int yyterror_ = 1
static const int yyerrcode_ = 256
static const int yyntokens_ = 296
static const unsigned int yyuser_token_number_max_ = 550
static const token_number_type yyundef_token_ = 2

Classes

union  semantic_type
 Symbol semantic values. More...
struct  token
 Tokens. More...


Detailed Description

A Bison parser.

Definition at line 111 of file Parser.h.


Member Typedef Documentation

Symbol locations.

Definition at line 159 of file Parser.h.

typedef token::yytokentype torc::generic::Parser::token_type

Token type.

Definition at line 463 of file Parser.h.

Type for debugging levels.

Definition at line 480 of file Parser.h.

typedef int torc::generic::Parser::state_type [private]

State numbers.

Definition at line 517 of file Parser.h.

State stack type.

Definition at line 519 of file Parser.h.

Semantic value stack type.

Definition at line 521 of file Parser.h.

location stack type.

Definition at line 523 of file Parser.h.

typedef unsigned short int torc::generic::Parser::token_number_type [private]

Internal symbol numbers.

Definition at line 533 of file Parser.h.

typedef short int torc::generic::Parser::rhs_number_type [private]

A type to store symbol numbers and -1.

Definition at line 577 of file Parser.h.


Constructor & Destructor Documentation

torc::generic::Parser::Parser ( class Driver inDriver_yyarg  ) 

Build a parser object.

Definition at line 545 of file Parser.cc.


Member Function Documentation

int torc::generic::Parser::parse (  )  [virtual]

Parse.

Returns:
0 iff parsing succeeded.

Lookahead and lookahead in internal form.

Semantic value of the lookahead.

Location of the lookahead.

The locations where the error started and ended.

$$.

$.

Definition at line 2120 of file Parser.cc.

std::ostream & torc::generic::Parser::debug_stream (  )  const

The current debugging stream.

Definition at line 2094 of file Parser.cc.

void torc::generic::Parser::set_debug_stream ( std::ostream &  o  ) 

Set the current debugging stream.

Definition at line 2100 of file Parser.cc.

Parser::debug_level_type torc::generic::Parser::debug_level (  )  const

The current debugging level.

Definition at line 2107 of file Parser.cc.

void torc::generic::Parser::set_debug_level ( debug_level_type  l  ) 

Set the current debugging level.

Definition at line 2113 of file Parser.cc.

void torc::generic::Parser::error ( const location_type loc,
const std::string &  msg 
) [private, virtual]

Report a syntax error.

Parameters:
loc where the syntax error is found.
msg a description of the syntax error.

Definition at line 16544 of file Parser.cc.

std::string torc::generic::Parser::yysyntax_error_ ( int  yystate,
int  tok 
) [private, virtual]

Generate an error message.

Parameters:
state the state where the error occurred.
tok the lookahead token.

Definition at line 14056 of file Parser.cc.

void torc::generic::Parser::yy_symbol_value_print_ ( int  yytype,
const semantic_type yyvaluep,
const location_type yylocationp 
) [inline, private, virtual]

Report a symbol value on the debug stream.

Parameters:
yytype The token type.
yyvaluep Its semantic value.
yylocationp Its location.

Definition at line 565 of file Parser.cc.

void torc::generic::Parser::yy_symbol_print_ ( int  yytype,
const semantic_type yyvaluep,
const location_type yylocationp 
) [private, virtual]

Report a symbol on the debug stream.

Parameters:
yytype The token type.
yyvaluep Its semantic value.
yylocationp Its location.

Definition at line 579 of file Parser.cc.

std::string torc::generic::Parser::yytnamerr_ ( const char *  n  )  [private, virtual]

Convert the symbol name n to a form suitable for a diagnostic.

Definition at line 511 of file Parser.cc.

void torc::generic::Parser::yy_reduce_print_ ( int  r  )  [private, virtual]

Report on the debug stream that the rule r is going to be reduced.

Definition at line 16431 of file Parser.cc.

void torc::generic::Parser::yystack_print_ (  )  [private, virtual]

Print the state stack on the debug stream.

Definition at line 16420 of file Parser.cc.

Parser::token_number_type torc::generic::Parser::yytranslate_ ( int  t  )  [private]

Convert a scanner token number t to a symbol number.

Definition at line 16449 of file Parser.cc.

void torc::generic::Parser::yydestruct_ ( const char *  yymsg,
int  yytype,
semantic_type yyvaluep,
location_type yylocationp 
) [inline, private]

Reclaim the memory associated to a symbol.

Parameters:
yymsg Why this token is reclaimed.
yytype The symbol type.
yyvaluep Its semantic value.
yylocationp Its location.

Definition at line 591 of file Parser.cc.

void torc::generic::Parser::yypop_ ( unsigned int  n = 1  )  [inline, private]

Pop n symbols the three stacks.

Definition at line 2085 of file Parser.cc.


Member Data Documentation

The state stack.

Definition at line 526 of file Parser.h.

The semantic value stack.

Definition at line 528 of file Parser.h.

The location stack.

Definition at line 530 of file Parser.h.

const short int torc::generic::Parser::yypact_ [static, private]

For a state, the index in yytable_ of its portion.

Definition at line 536 of file Parser.h.

const unsigned short int torc::generic::Parser::yydefact_ [static, private]

For a state, default rule to reduce. Unlessyytable_ specifies something else to do. Zero means the default is an error.

Definition at line 542 of file Parser.h.

const unsigned short int torc::generic::Parser::yytable_ [static, private]

What to do in a state. yytable_[yypact_[s]]: what to do in state s.

  • if positive, shift that token.
  • if negative, reduce the rule which number is the opposite.
  • if zero, do what YYDEFACT says.

Definition at line 552 of file Parser.h.

const unsigned short int torc::generic::Parser::yystos_ [static, private]

For a state, its accessing symbol.

Definition at line 558 of file Parser.h.

const unsigned short int torc::generic::Parser::yyr1_ [static, private]

For a rule, its LHS.

Definition at line 561 of file Parser.h.

const unsigned char torc::generic::Parser::yyr2_ [static, private]

For a rule, its RHS length.

Definition at line 563 of file Parser.h.

const char *const torc::generic::Parser::yytname_ [static, private]

For a symbol, its name in clear.

Definition at line 567 of file Parser.h.

A `-1'-separated list of the rules' RHS.

Definition at line 579 of file Parser.h.

const unsigned short int torc::generic::Parser::yyprhs_ [static, private]

For each rule, the index of the first RHS symbol in yyrhs_.

Definition at line 581 of file Parser.h.

const unsigned short int torc::generic::Parser::yyrline_ [static, private]

For each rule, its source line number.

Definition at line 583 of file Parser.h.

const unsigned short int torc::generic::Parser::yytoken_number_ [static, private]

For each scanner token number, its symbol number.

Definition at line 585 of file Parser.h.


The documentation for this class was generated from the following files:

Generated on Thu Oct 13 16:50:40 2011 for TORC by  doxygen 1.5.6