Aprepro 5.0x

Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SEAMS::Parser Class Reference

A Bison parser. More...

`#include <aprepro_parser.h>`

Collaboration diagram for SEAMS::Parser:
[legend]

## Classes
struct | basic_symbol
struct | by_state
| Type access provider for state based symbols. More...
struct | by_type
| Type access provider for token (enum) based symbols. More...
union | semantic_type
| Symbol semantic values. More...
class | stack
| A stack with random access from its top. More...
struct | stack_symbol_type
| "Internal" symbol: element of the stack. More...
struct | symbol_type
| "External" symbols: returned by the scanner. More...
struct | syntax_error
| Syntax errors thrown from user actions. More...
struct | token
| Tokens. More...

## Public Types
enum | { empty_symbol = -2 }
| The symbol type number to denote an empty symbol. More...
typedef token::yytokentype | token_type
| (External) token type, as returned by yylex. More...
typedef int | symbol_number_type
| Symbol type: an internal symbol number. More...
typedef unsigned char | token_number_type
| Internal symbol number for tokens (subsumed by symbol_number_type). More...
typedef int | debug_level_type
| Type for debugging levels. More...

## Public Member Functions
| Parser (class Aprepro &aprepro_yyarg)
| Build a parser object. More...
virtual | ~Parser ()
int | operator() ()
virtual int | parse ()
std::ostream & | debug_stream () const YY_ATTRIBUTE_PURE
| The current debugging stream. More...
void | set_debug_stream (std::ostream &)
| Set the current debugging stream. More...
debug_level_type | debug_level () const YY_ATTRIBUTE_PURE
| The current debugging level. More...
void | set_debug_level (debug_level_type l)
| Set the current debugging level. More...
virtual void | error (const std::string &msg)
void | error (const syntax_error &err)
| Report a syntax error. More...

## Private Types
enum | { yyeof_ = 0, yylast_ = 1299, yynnts_ = 7, yyfinal_ = 2, yyterror_ = 1, yyerrcode_ = 256, yyntokens_ = 50 }
| Constants. More...
typedef int | state_type
| State numbers. More...
typedef stack< stack_symbol_type > | stack_type
| Stack type. More...

## Private Member Functions
| Parser (const Parser &)
| This class is not copyable. More...
Parser & | operator= (const Parser &)
virtual std::string | yysyntax_error_ (state_type yystate, const symbol_type &yyla) const
state_type | yy_lr_goto_state_ (state_type yystate, int yysym)
virtual void | yy_reduce_print_ (int r)
| Report on the debug stream that the rule r is going to be reduced. More...
virtual void | yystack_print_ ()
| Print the state stack on the debug stream. More...
template<typename Base >
void | yy_print_ (std::ostream &yyo, const basic_symbol< Base > &yysym) const
| Display a symbol type, value and location. More...
template<typename Base >
void | yy_destroy_ (const char *yymsg, basic_symbol< Base > &yysym) const
| Reclaim the memory associated to a symbol. More...
void | yypush_ (const char *m, YY_MOVE_REF(stack_symbol_type) sym)
void | yypush_ (const char *m, state_type s, YY_MOVE_REF(symbol_type) sym)
void | yypop_ (int n=1)
| Pop n symbols from the stack. More...

## Static Private Member Functions
static bool | yy_pact_value_is_default_ (int yyvalue)
static bool | yy_table_value_is_error_ (int yyvalue)
static token_number_type | yytranslate_ (int t)
| Convert a scanner token number t to a symbol number. More...
static std::string | yytnamerr_ (const char *n)
| Convert the symbol name n to a form suitable for a diagnostic. More...

## Private Attributes
int | yydebug_
| Debugging level. More...
std::ostream * | yycdebug_
| Debug stream. More...
stack_type | yystack_
| The stack. More...
class Aprepro & | aprepro

## Static Private Attributes
static const signed char | yypact_ninf_ = -34
static const signed char | yytable_ninf_ = -1
static const short | yypact_ []
static const unsigned char | yydefact_ []
static const signed char | yypgoto_ [] = {-34, -34, -34, -18, 95, 81, -4}
static const short | yydefgoto_ [] = {-1, 1, 6, 27, 28, 66, 161}
static const unsigned short | yytable_ []
static const short | yycheck_ []
static const unsigned char | yystos_ []
static const unsigned char | yyr1_ []
static const unsigned char | yyr2_ []
static const char *const | yytname_ []
| For a symbol, its name in clear. More...
static const unsigned short | yyrline_ []

## Detailed Description

A Bison parser.

## Member Typedef Documentation

## ◆ debug_level_type

typedef int SEAMS::Parser::debug_level_type

Type for debugging levels.

## ◆ stack_type

typedef stack<stack_symbol_type> SEAMS::Parser::stack_type
| private

Stack type.

## ◆ state_type

typedef int SEAMS::Parser::state_type
| private

State numbers.

## ◆ symbol_number_type

typedef int SEAMS::Parser::symbol_number_type

Symbol type: an internal symbol number.

## ◆ token_number_type

typedef unsigned char SEAMS::Parser::token_number_type

Internal symbol number for tokens (subsumed by symbol_number_type).

## ◆ token_type

typedef token::yytokentype SEAMS::Parser::token_type

(External) token type, as returned by yylex.

## Member Enumeration Documentation

## ◆ anonymous enum

anonymous enum

The symbol type number to denote an empty symbol.

Enumerator
empty_symbol |

## ◆ anonymous enum

anonymous enum
| private

Constants.

Enumerator
yyeof_ |
yylast_ | Last index in yytable_.
yynnts_ | Number of nonterminal symbols.
yyfinal_ | Termination state number.
yyterror_ |
yyerrcode_ |
yyntokens_ | Number of tokens.

## Constructor & Destructor Documentation

## ◆ Parser() [1/2]

SEAMS::Parser::Parser | ( | class Aprepro & | aprepro_yyarg | ) |

Build a parser object.

## ◆ ~Parser()

SEAMS::Parser::~Parser | ( |  | ) |
| virtual

## ◆ Parser() [2/2]

SEAMS::Parser::Parser | ( | const Parser & |  | ) |
| private

This class is not copyable.

## Member Function Documentation

## ◆ debug_level()

Parser::debug_level_type SEAMS::Parser::debug_level | ( |  | ) | const

The current debugging level.

## ◆ debug_stream()

std::ostream & SEAMS::Parser::debug_stream | ( |  | ) | const

The current debugging stream.

## ◆ error() [1/2]

void SEAMS::Parser::error | ( | const std::string & | msg | ) |
| virtual

Report a syntax error.

Parameters

  msg | a description of the syntax error.

## ◆ error() [2/2]

void SEAMS::Parser::error | ( | const syntax_error & | err | ) |

Report a syntax error.

## ◆ operator()()

int SEAMS::Parser::operator() | ( |  | ) |

Parse. An alias for parse ().

Returns
  0 iff parsing succeeded.

## ◆ operator=()

Parser& SEAMS::Parser::operator= | ( | const Parser & |  | ) |
| private

## ◆ parse()

int SEAMS::Parser::parse | ( |  | ) |
| virtual

Parse.

Returns
  0 iff parsing succeeded.

Length of the RHS of the rule being reduced.

The lookahead symbol.

The return value of parse ().

## ◆ set_debug_level()

void SEAMS::Parser::set_debug_level | ( | debug_level_type | l | ) |

Set the current debugging level.

## ◆ set_debug_stream()

void SEAMS::Parser::set_debug_stream | ( | std::ostream & | o | ) |

Set the current debugging stream.

## ◆ yy_destroy_()

template<typename Base >

void SEAMS::Parser::yy_destroy_ | ( | const char * | yymsg,
|  | basic_symbol< Base > & | yysym
| ) |  | const
| private

Reclaim the memory associated to a symbol.

Parameters

  yymsg | Why this token is reclaimed. If null, print nothing.
  yysym | The symbol.

## ◆ yy_lr_goto_state_()

Parser::state_type SEAMS::Parser::yy_lr_goto_state_ | ( | state_type | yystate,
|  | int | yysym
| ) |  |
| private

Compute post-reduction state.

Parameters

  yystate | the current state
  yysym | the nonterminal to push on the stack

## ◆ yy_pact_value_is_default_()

bool SEAMS::Parser::yy_pact_value_is_default_ | ( | int | yyvalue | ) |
| static private

Whether the given `yypact_` value indicates a defaulted state.

Parameters

  yyvalue | the value to check

## ◆ yy_print_()

template<typename Base >

void SEAMS::Parser::yy_print_ | ( | std::ostream & | yyo,
|  | const basic_symbol< Base > & | yysym
| ) |  | const
| private

Display a symbol type, value and location.

Parameters

  yyo | The output stream.
  yysym | The symbol.

## ◆ yy_reduce_print_()

void SEAMS::Parser::yy_reduce_print_ | ( | int | r | ) |
| private virtual

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

## ◆ yy_table_value_is_error_()

bool SEAMS::Parser::yy_table_value_is_error_ | ( | int | yyvalue | ) |
| static private

Whether the given `yytable_` value indicates a syntax error.

Parameters

  yyvalue | the value to check

## ◆ yypop_()

void SEAMS::Parser::yypop_ | ( | int | n = `1` | ) |
| private

Pop n symbols from the stack.

## ◆ yypush_() [1/2]

void SEAMS::Parser::yypush_ | ( | const char * | m,
|  | YY_MOVE_REF(stack_symbol_type) | sym
| ) |  |
| private

Push a new state on the stack.

Parameters

  m | a debug message to display if null, no trace is output.
  sym | the symbol

Warning
  the contents of s.value is stolen.

## ◆ yypush_() [2/2]

void SEAMS::Parser::yypush_ | ( | const char * | m,
|  | state_type | s,
|  | YY_MOVE_REF(symbol_type) | sym
| ) |  |
| private

Push a new look ahead token on the state on the stack.

Parameters

  m | a debug message to display if null, no trace is output.
  s | the state
  sym | the symbol (for its value and location).

Warning
  the contents of sym.value is stolen.

## ◆ yystack_print_()

void SEAMS::Parser::yystack_print_ | ( |  | ) |
| private virtual

Print the state stack on the debug stream.

## ◆ yysyntax_error_()

std::string SEAMS::Parser::yysyntax_error_ | ( | state_type | yystate,
|  | const symbol_type & | yyla
| ) |  | const
| private virtual

Generate an error message.

Parameters

  yystate | the state where the error occurred.
  yyla | the lookahead token.

## ◆ yytnamerr_()

std::string SEAMS::Parser::yytnamerr_ | ( | const char * | n | ) |
| static private

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

## ◆ yytranslate_()

Parser::token_number_type SEAMS::Parser::yytranslate_ | ( | int | t | ) |
| static private

Convert a scanner token number t to a symbol number.

## Member Data Documentation

## ◆ aprepro

class Aprepro& SEAMS::Parser::aprepro
| private

## ◆ yycdebug_

std::ostream* SEAMS::Parser::yycdebug_
| private

Debug stream.

## ◆ yycheck_

const short SEAMS::Parser::yycheck_
| static private

## ◆ yydebug_

int SEAMS::Parser::yydebug_
| private

Debugging level.

## ◆ yydefact_

const unsigned char SEAMS::Parser::yydefact_
| static private

Initial value:
= {
2, 0, 1, 0, 0, 4, 3, 9, 64, 45, 91, 67, 46, 68, 47, 28, 0, 0, 0,
0, 0, 8, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94,
95, 0, 0, 0, 0, 0, 0, 71, 72, 0, 0, 0, 0, 0, 0, 0, 82, 83, 0,
0, 0, 0, 0, 0, 91, 0, 0, 127, 0, 0, 0, 123, 39, 122, 12, 65, 92, 69,
80, 66, 93, 70, 81, 0, 0, 0, 7, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 48,
96, 97, 98, 99, 100, 101, 50, 73, 75, 76, 77, 78, 79, 49, 74, 52, 84, 86, 87,
88, 89, 90, 51, 85, 0, 36, 0, 102, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0,
0, 122, 21, 125, 0, 126, 0, 0, 19, 0, 20, 38, 40, 42, 44, 41, 22, 23, 24,
25, 26, 27, 57, 17, 18, 10, 11, 13, 14, 15, 16, 117, 118, 120, 43, 119, 121, 124,
0, 129, 105, 0, 104, 0, 103, 56, 0, 53, 0, 55, 35, 0, 29, 0, 34, 96, 119,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 128, 130, 131, 0,
108, 106, 107, 0, 110, 0, 0, 62, 0, 58, 31, 30, 0, 33, 0, 0, 0, 0, 0,
0, 0, 0, 132, 109, 112, 0, 111, 0, 61, 0, 60, 32, 0, 0, 0, 0, 114, 113,
0, 0, 0, 0, 115, 0, 59, 0, 116}

## ◆ yydefgoto_

const short SEAMS::Parser::yydefgoto_ = {-1, 1, 6, 27, 28, 66, 161}
| static private

## ◆ yypact_

const short SEAMS::Parser::yypact_
| static private

Initial value:
= {
-34, 2, -34, -3, 289, -34, -34, -34, -34, -34, -13, 296, 4, 600, 28,
45, 44, 46, 53, 405, 405, -34, 405, 360, 405, 111, 179, 48, -16, 38,
1126, 360, 405, 405, 405, 405, 405, -34, -34, 405, 405, 405, 405, 405, 405,
-34, -34, 405, 405, 405, 405, 405, 405, 405, -34, -34, 405, 405, 360, 209,
345, 360, 630, 52, 405, 93, 1174, 864, 1078, 18, -34, 18, 18, -34, -34,
-34, -34, -34, -34, -34, -34, 405, 405, 405, -34, 360, 360, 405, 360, -34,
405, 405, 405, 405, 405, 405, 405, -34, 405, 405, 405, 405, 405, 405, 405,
405, 405, 405, 405, 360, 405, 405, -33, 1174, 1193, 1209, 1209, 1209, 1209, 1209,
1174, 1209, 1209, 1209, 1209, 1209, 1209, 1174, 1209, 1174, 1209, 1209, 1209, 1209, 1209,
1209, 1174, 1209, 599, -33, 1193, -34, 50, 99, 629, -34, 154, 229, 659, 230,
421, 689, 405, 18, -34, -34, 405, -34, 1140, 1160, 49, 1209, -34, 1, 1,
1225, -34, 1225, 39, 39, 39, 39, 39, 39, -34, 1240, 1254, 340, 340, 340,
340, 340, 340, 190, 190, 18, -34, 18, 18, 18, 405, 70, -34, 405, -34,
405, -34, -34, 405, -34, 405, -34, -34, 405, -34, 405, -34, 1209, 18, 405,
405, 1103, 405, 431, 891, 484, 570, 456, 131, 918, 490, 945, 719, 1174, 1209,
71, 1209, 405, -34, -34, -34, 405, -34, 405, 405, -34, 405, -34, -34, -34,
405, -34, 405, 512, 972, 749, 808, 518, 462, 999, 1209, -34, -34, 405, -34,
405, -34, 405, -34, -34, 779, 1026, 391, 405, -34, -34, 405, 540, 837, 546,
-34, 405, -34, 1053, -34}

## ◆ yypact_ninf_

const signed char SEAMS::Parser::yypact_ninf_ = -34
| static private

## ◆ yypgoto_

const signed char SEAMS::Parser::yypgoto_ = {-34, -34, -34, -18, 95, 81, -4}
| static private

## ◆ yyr1_

const unsigned char SEAMS::Parser::yyr1_
| static private

Initial value:
= {
0, 50, 51, 51, 52, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56}

## ◆ yyr2_

const unsigned char SEAMS::Parser::yyr2_
| static private

Initial value:
= {
0, 2, 0, 2, 1, 3, 3, 3, 2, 2, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 1, 4, 6, 6, 8, 6, 4, 4, 3, 3, 3, 2, 3, 3, 3, 3, 3, 1, 1, 1, 3, 3, 3, 3, 3, 4,
3, 4, 4, 3, 6, 12, 8, 8, 6, 5, 1, 2, 2, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 2,
2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 6, 6,
6, 8, 6, 8, 8, 10, 10, 12, 14, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 1, 5, 4, 6, 6, 8}

## ◆ yyrline_

const unsigned short SEAMS::Parser::yyrline_
| static private

Initial value:
= {
0, 145, 145, 146, 149, 150, 157, 161, 162, 163, 166, 167, 168, 169, 170, 171, 172,
173, 174, 175, 176, 177, 180, 181, 182, 183, 184, 185, 187, 188, 194, 200, 206, 212,
218, 224, 230, 233, 235, 243, 245, 253, 254, 255, 256, 265, 266, 267, 268, 270, 273,
277, 278, 279, 285, 291, 297, 303, 304, 310, 316, 322, 328, 334, 336, 337, 338, 339,
340, 341, 342, 343, 344, 345, 347, 350, 351, 352, 353, 354, 359, 360, 361, 362, 363,
364, 365, 366, 367, 368, 369, 371, 373, 376, 379, 382, 385, 387, 390, 393, 396, 399,
406, 413, 420, 427, 434, 441, 448, 455, 462, 468, 474, 480, 486, 492, 498, 504, 505,
506, 507, 514, 521, 522, 523, 526, 527, 530, 531, 532, 533, 534, 556}

## ◆ yystack_

stack_type SEAMS::Parser::yystack_
| private

The stack.

## ◆ yystos_

const unsigned char SEAMS::Parser::yystos_
| static private

Initial value:
= {
0, 51, 0, 1, 19, 49, 52, 20, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 17, 20, 38,
39, 44, 46, 47, 53, 54, 55, 56, 22, 23, 24, 25, 26, 27, 46, 47, 22, 23, 24, 25, 26, 27, 46,
47, 22, 22, 23, 24, 25, 26, 27, 46, 47, 22, 17, 22, 15, 15, 15, 5, 10, 39, 53, 55, 56, 56,
56, 54, 56, 56, 3, 5, 6, 8, 3, 5, 6, 8, 28, 30, 31, 20, 38, 39, 40, 41, 20, 32, 33,
34, 35, 36, 37, 48, 20, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 54, 55, 56,
56, 56, 56, 56, 56, 55, 56, 56, 56, 56, 56, 56, 55, 56, 55, 56, 56, 56, 56, 56, 56, 55, 56,
56, 54, 56, 16, 54, 55, 56, 16, 54, 55, 56, 54, 55, 56, 22, 56, 16, 16, 41, 18, 55, 56, 53,
56, 53, 54, 54, 56, 54, 56, 55, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 56, 54, 56, 56, 56, 14, 18, 16, 14, 16, 14, 16, 16, 14, 16, 14, 16, 16, 14, 16, 14, 16,
56, 56, 29, 29, 56, 22, 55, 56, 55, 56, 55, 55, 56, 55, 56, 56, 55, 56, 18, 56, 14, 16, 16,
16, 14, 16, 21, 14, 16, 14, 16, 16, 16, 14, 16, 22, 55, 56, 56, 56, 55, 55, 56, 56, 16, 16,
14, 16, 14, 16, 14, 16, 16, 56, 56, 55, 14, 16, 16, 14, 55, 56, 55, 16, 14, 16, 56, 16}

## ◆ yytable_

const unsigned short SEAMS::Parser::yytable_
| static private

## ◆ yytable_ninf_

const signed char SEAMS::Parser::yytable_ninf_ = -1
| static private

## ◆ yytname_

const char *const SEAMS::Parser::yytname_
| static private

For a symbol, its name in clear.

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

- aprepro_parser.h
- apr_parser.cc