Lr1Parser. More...

#include <pd_parser.h>

Public Member Functions

 Lr1Parser ()
 default constructor
Idx StartState () const
 Getter for mStartState.
std::set< Idx > const & FinalStates () const
 Getter for mFinalState.
void ClrFinalStates ()
std::set< Idx > const & Nonterminals () const
 Getter for mNonterminals.
std::set< Terminal > const & Terminals () const
 Getter for mTerminals.
std::set< Lr1ParserAction > const & Actions () const
 Getter for mActions.
Terminal AugSymbol () const
 Getter for mAugSymbol.
bool SetStartState (Idx start)
 set the parser's start state and add it to the set of nonterminals
bool InsFinalState (Idx final)
 set the parser's final state and add it to the set of nonterminals
bool InsNonterminal (Idx nt)
 Add a new nonterminal to the parser.
void SetAugSymbol (Terminal t)
 TODO description.
bool InsTerminal (const Terminal &t)
 Add a new terminal to the parser.
bool InsAction (const Lr1ParserAction &action)
 Add a new Lr1ParserAction to the parser.
std::string StrFinalStates () const
 To String function for all nonterminals.
std::string StrNonterminals () const
 To String function for all nonterminals.
std::string StrTerminals () const
 To String function for all terminals.
std::string StrActions (std::string separator) const
 To String function for actions.
std::string Str () const
 To String function.

Public Attributes

Idx mStartState
std::set< IdxmFinalStates
std::set< IdxmNonterminals
std::set< TerminalmTerminals
std::set< Lr1ParserActionmActions
Terminal mAugSymbol

Detailed Description

Lr1Parser.

Overview

Overview

Contents

Contents

Definition at line 337 of file pd_parser.h.

Constructor & Destructor Documentation

faudes::Lr1Parser::Lr1Parser ( )
inline

default constructor

Definition at line 351 of file pd_parser.h.

Member Function Documentation

std::set<Lr1ParserAction> const& faudes::Lr1Parser::Actions ( ) const
inline

Getter for mActions.

Returns
mActions

Definition at line 394 of file pd_parser.h.

Terminal faudes::Lr1Parser::AugSymbol ( ) const
inline

Getter for mAugSymbol.

Returns
mAugSymbol

Definition at line 402 of file pd_parser.h.

void faudes::Lr1Parser::ClrFinalStates ( )
inline

Definition at line 370 of file pd_parser.h.

std::set<Idx> const& faudes::Lr1Parser::FinalStates ( ) const
inline

Getter for mFinalState.

Returns
mFinalState

Definition at line 368 of file pd_parser.h.

bool faudes::Lr1Parser::InsAction ( const Lr1ParserAction action)

Add a new Lr1ParserAction to the parser.

Parameters
actionthe action to add
Returns
true if the action did not exist and was successfully added, else false

Definition at line 246 of file pd_parser.cpp.

bool faudes::Lr1Parser::InsFinalState ( Idx  final)

set the parser's final state and add it to the set of nonterminals

Parameters
finalfinal state to set
Returns
true, if nonterminal did not exist in parser, else false

Definition at line 232 of file pd_parser.cpp.

bool faudes::Lr1Parser::InsNonterminal ( Idx  nt)

Add a new nonterminal to the parser.

Parameters
ntthe nonterminal to add
Returns
true if the nonterminal did not exist and was successfully added, else false

Definition at line 238 of file pd_parser.cpp.

bool faudes::Lr1Parser::InsTerminal ( const Terminal t)

Add a new terminal to the parser.

Parameters
tthe terminal to add
Returns
true if the terminal did not exist and was successfully added, else false

Definition at line 242 of file pd_parser.cpp.

std::set<Idx> const& faudes::Lr1Parser::Nonterminals ( ) const
inline

Getter for mNonterminals.

Returns
mNonterminals

Definition at line 378 of file pd_parser.h.

void faudes::Lr1Parser::SetAugSymbol ( Terminal  t)

TODO description.

Parameters
taug symbol

Definition at line 250 of file pd_parser.cpp.

bool faudes::Lr1Parser::SetStartState ( Idx  start)

set the parser's start state and add it to the set of nonterminals

Parameters
startstart state to set
Returns
true, if nonterminal did not exist in parser, else false

Definition at line 227 of file pd_parser.cpp.

Idx faudes::Lr1Parser::StartState ( ) const
inline

Getter for mStartState.

Returns
mStartState

Definition at line 359 of file pd_parser.h.

std::string faudes::Lr1Parser::Str ( void  ) const

To String function.

Definition at line 303 of file pd_parser.cpp.

std::string faudes::Lr1Parser::StrActions ( std::string  separator) const

To String function for actions.

Definition at line 291 of file pd_parser.cpp.

std::string faudes::Lr1Parser::StrFinalStates ( ) const

To String function for all nonterminals.

Definition at line 255 of file pd_parser.cpp.

std::string faudes::Lr1Parser::StrNonterminals ( ) const

To String function for all nonterminals.

Definition at line 267 of file pd_parser.cpp.

std::string faudes::Lr1Parser::StrTerminals ( ) const

To String function for all terminals.

Definition at line 279 of file pd_parser.cpp.

std::set<Terminal> const& faudes::Lr1Parser::Terminals ( ) const
inline

Getter for mTerminals.

Returns
mTerminals

Definition at line 386 of file pd_parser.h.

Member Data Documentation

std::set<Lr1ParserAction> faudes::Lr1Parser::mActions

Definition at line 345 of file pd_parser.h.

Terminal faudes::Lr1Parser::mAugSymbol

Definition at line 346 of file pd_parser.h.

std::set<Idx> faudes::Lr1Parser::mFinalStates

Definition at line 342 of file pd_parser.h.

std::set<Idx> faudes::Lr1Parser::mNonterminals

Definition at line 343 of file pd_parser.h.

Idx faudes::Lr1Parser::mStartState

Definition at line 340 of file pd_parser.h.

std::set<Terminal> faudes::Lr1Parser::mTerminals

Definition at line 344 of file pd_parser.h.


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

libFAUDES 2.28c --- 2016.09.30 --- c++ api documentaion by doxygen