top | up | prev | next

GrammarParser Class

Definition at line 297 of Parser.hpp

Constructors

GrammarParser(const std::u32string& name_, const std::u32string& api_)

Member Functions

void Accept(Visitor& visitor) override
void AddRule(RuleParser* rule)
void AddRuleInfo(const std::u32string& ruleName, const std::u32string& ruleInfo)
void AddUsing(const std::u32string& using_)
const std::u32string& Api() const
RuleParser* GetRule(const std::u32string& ruleName) const
bool IsGrammar() const override
const std::u32string& Lexer() const
bool Main() const
void MapRule(RuleParser* rule)
const std::vector<std::pair<std::u32string, std::u32string>>& RuleInfos() const
const std::vector<std::unique_ptr<RuleParser>>& Rules() const
void SetLexer(const std::u32string& lexer_)
void SetMain()
const std::vector<std::u32string>& Usings() const

Member Variables

std::u32string api
std::u32string lexer
bool main
std::vector<std::pair<std::u32string, std::u32string>> ruleInfos
std::map<std::u32string, RuleParser*> ruleMap
std::vector<std::unique_ptr<RuleParser>> rules
std::vector<std::u32string> usings

Constructor Details

GrammarParser Constructor

sng2html::sng2html::GrammarParser::GrammarParser(const std::u32string& name_, const std::u32string& api_)

Definition at line 406 of Parser.cpp :
406 : Parser(name_)api(api_)main(false)
407 {
408 }


Declaration at line 300 of Parser.hpp


Member Function Details

Accept Member Function

void sng2html::sng2html::GrammarParser::Accept(Visitor & visitor) override

Definition at line 410 of Parser.cpp :
411 {
412     visitor.Visit(*this);
413 }


Declaration at line 302 of Parser.hpp

Base class overridden functions: sng2html::sng2html::Parser::Accept

Calls: sng2html::sng2html::Visitor::Visit


AddRule Member Function

void sng2html::sng2html::GrammarParser::AddRule(RuleParser * rule)

Definition at line 420 of Parser.cpp :
421 {
422     rule->SetParent(this);
423     rules.push_back(std::unique_ptr<RuleParser>(rule));
424     ruleMap[rule->Name()] = rule;
425 }


Declaration at line 310 of Parser.hpp

Calls: sng2html::sng2html::Parser::Name , sng2html::sng2html::Parser::SetParent

Called by: ParserFileParser::RuleStatement


AddRuleInfo Member Function

void sng2html::sng2html::GrammarParser::AddRuleInfo(const std::u32string& ruleName, const std::u32string& ruleInfo)

Definition at line 445 of Parser.cpp :
446 {
447     ruleInfos.push_back(std::make_pair(ruleNameruleInfo));
448 }


Declaration at line 314 of Parser.hpp

Called by: ParserFileParser::RuleInfo


AddUsing Member Function

void sng2html::sng2html::GrammarParser::AddUsing(const std::u32string& using_)

Definition at line 415 of Parser.cpp :
416 {
417     usings.push_back(using_);
418 }


Declaration at line 306 of Parser.hpp

Called by: ParserFileParser::UsingStatement


Api Member Function

const std::u32string& sng2html::sng2html::GrammarParser::Api() const

Definition at line 303 of Parser.hpp :
303 { return api; }


GetRule Member Function

RuleParser * sng2html::sng2html::GrammarParser::GetRule(const std::u32string& ruleName) const

Definition at line 432 of Parser.cpp
Declaration at line 312 of Parser.hpp

Calls: sng2html::sng2html::Parser::Name

Called by: sng2html::sng2html::LinkerVisitor::Visit , sng2html::sng2html::LinkerVisitor::Visit , sng2html::sng2html::Project::ReadGrammarFiles


IsGrammar Member Function

bool sng2html::sng2html::GrammarParser::IsGrammar() const override

Definition at line 301 of Parser.hpp :
301 { return true; }

Base class overridden functions: sng2html::sng2html::Parser::IsGrammar


Lexer Member Function

const std::u32string& sng2html::sng2html::GrammarParser::Lexer() const

Definition at line 309 of Parser.hpp :
309 { return lexer; }

Called by: sng2html::sng2html::GrammarHtmlGeneratorVisitor::Visit


Main Member Function

bool sng2html::sng2html::GrammarParser::Main() const

Definition at line 305 of Parser.hpp :
305 { return main; }


MapRule Member Function

void sng2html::sng2html::GrammarParser::MapRule(RuleParser * rule)

Definition at line 427 of Parser.cpp :
428 {
429     ruleMap[rule->Name()] = rule;
430 }


Declaration at line 311 of Parser.hpp

Calls: sng2html::sng2html::Parser::Name

Called by: sng2html::sng2html::LinkerVisitor::Visit


RuleInfos Member Function

const std::vector<std::pair<std::u32string, std::u32string>>& sng2html::sng2html::GrammarParser::RuleInfos() const

Definition at line 315 of Parser.hpp :
315 { return ruleInfos; }

Called by: sng2html::sng2html::LinkerVisitor::Visit


Rules Member Function

const std::vector<std::unique_ptr<RuleParser >>& sng2html::sng2html::GrammarParser::Rules() const

Definition at line 313 of Parser.hpp :
313 { return rules; }

Called by: sng2html::sng2html::GrammarHtmlGeneratorVisitor::Visit , sng2html::sng2html::LinkerVisitor::Visit


SetLexer Member Function

void sng2html::sng2html::GrammarParser::SetLexer(const std::u32string& lexer_)

Definition at line 308 of Parser.hpp :
308 { lexer = lexer_; }

Called by: ParserFileParser::LexerStatement


SetMain Member Function

void sng2html::sng2html::GrammarParser::SetMain()

Definition at line 304 of Parser.hpp :
304 { main = true; }

Called by: ParserFileParser::MainStatement


Usings Member Function

const std::vector<std::u32string>& sng2html::sng2html::GrammarParser::Usings() const

Definition at line 307 of Parser.hpp :
307 { return usings; }

Called by: sng2html::sng2html::LinkerVisitor::Visit


top | up | prev | next