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>`

## 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...
struct | stack_symbol_type
| "Internal" symbol: element of the stack. 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 basic_symbol< by_type > | symbol_type
| "External" symbols: returned by the scanner. 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 ()
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_ = 1237, 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, stack_symbol_type &s)
void | yypush_ (const char *m, state_type s, symbol_type &sym)
void | yypop_ (unsigned int n=1)
| Pop n symbols the three stacks. 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_
std::ostream * | yycdebug_
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 int | yypact_ []
static const unsigned char | yydefact_ []
static const signed char | yypgoto_ [] = {-34, -34, -34, -18, 95, 81, -4}
static const short int | yydefgoto_ [] = {-1, 1, 6, 27, 28, 66, 161}
static const unsigned short int | yytable_ []
static const short int | 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 int | 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.

## ◆ symbol_type

typedef basic_symbol<by_type> SEAMS::Parser::symbol_type

"External" symbols: returned by the scanner.

## ◆ 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=()

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
| inline 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
| ) |  |
| inline 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 | ) |
| inline 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 | ) |
| inline static private

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

Parameters

  yyvalue | the value to check

## ◆ yypop_()

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

Pop n symbols the three stacks.

## ◆ yypush_() [1/2]

void SEAMS::Parser::yypush_ | ( | const char * | m,
|  | stack_symbol_type & | s
| ) |  |
| inline private

Push a new state on the stack.

Parameters

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

Warning
  the contents of s.value is stolen.

## ◆ yypush_() [2/2]

void SEAMS::Parser::yypush_ | ( | const char * | m,
|  | state_type | s,
|  | symbol_type & | sym
| ) |  |
| inline 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 s.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 | ) |
| inline 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

## ◆ yycheck_

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

## ◆ yydebug_

int SEAMS::Parser::yydebug_
| private

## ◆ yydefact_

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

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

## ◆ yydefgoto_

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

## ◆ yypact_

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

Initial value:
= {
-34, 2, -34, -3, 315, -34, -34, -34, -34, -34, -13, 585, 4, 615, 28,
45, 44, 46, 53, 420, 420, -34, 420, 207, 420, 111, 179, 48, -16, 38,
1081, 207, 420, 420, 420, 420, 420, -34, -34, 420, 420, 420, 420, 420, 420,
-34, -34, 420, 420, 420, 420, 420, 420, 420, -34, -34, 420, 420, 207, 360,
375, 207, 645, 52, 420, 93, 268, 819, 1033, 18, -34, 18, 18, -34, -34,
-34, -34, -34, -34, -34, -34, 420, 420, 420, -34, 207, 207, 420, 207, -34,
420, 420, 420, 420, 420, 420, 420, -34, 420, 420, 420, 420, 420, 420, 420,
420, 420, 420, 420, 207, 420, 420, -33, 268, 1131, 1147, 1147, 1147, 1147, 1147,
268, 1147, 1147, 1147, 1147, 1147, 1147, 268, 1147, 268, 1147, 1147, 1147, 1147, 1147,
1147, 268, 1147, 584, -33, 1131, -34, 50, 99, 614, -34, 154, 225, 644, 247,
234, 674, 420, 18, -34, -34, 420, -34, 1095, 1115, 49, 1147, -34, 1, 1,
1163, -34, 1163, 39, 39, 39, 39, 39, 39, -34, 1178, 1192, 307, 307, 307,
307, 307, 307, 190, 190, 18, -34, 18, 18, 18, 420, 70, -34, 420, -34,
420, -34, -34, 420, -34, 420, -34, -34, 420, -34, 420, -34, 1147, 18, 420,
420, 1058, 420, 261, 846, 469, 555, 436, 131, 873, 475, 900, 927, 268, 1147,
71, 1147, 420, -34, -34, -34, 420, -34, 420, 420, -34, 420, -34, -34, -34,
-34, 420, 497, 954, 704, 763, 503, 446, 1147, -34, -34, 420, -34, 420, -34,
420, -34, 734, 981, 406, 420, -34, -34, 420, 525, 792, 531, -34, 420, -34,
1008, -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,
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, 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 int SEAMS::Parser::yyrline_
| static private

Initial value:
= {
0, 146, 146, 147, 150, 151, 158, 162, 163, 164, 167, 168, 169, 170, 171, 172, 173, 174, 175,
176, 177, 178, 181, 182, 183, 184, 185, 186, 188, 189, 195, 201, 207, 213, 219, 225, 228, 230,
238, 240, 248, 249, 250, 251, 260, 261, 262, 263, 265, 268, 272, 273, 274, 280, 286, 292, 298,
299, 305, 311, 317, 323, 329, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 342, 345, 346,
347, 348, 349, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 366, 368, 371, 374, 377,
380, 382, 385, 388, 391, 394, 401, 408, 415, 422, 429, 436, 443, 450, 457, 463, 469, 475, 481,
487, 493, 499, 500, 501, 502, 509, 516, 517, 518, 521, 522, 525, 526, 527, 528, 529, 551}

## ◆ 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, 16, 22, 55, 56, 56, 56, 55, 55, 56, 16, 16, 14, 16,
14, 16, 14, 16, 56, 56, 55, 14, 16, 16, 14, 55, 56, 55, 16, 14, 16, 56, 16}

## ◆ yytable_

const unsigned short int 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