|
WSF
|
#include <Parser.h>

Public Types | |
| enum | { _EOF = 0 , _string_literal = 1 , _label = 2 , _word = 3 , _gt = 4 , _lt = 5 , _star = 6 , _question = 7 , _plus = 8 , _alternate = 9 , _colon = 10 , _comma = 11 , _assign = 12 , _dot = 13 } |
| typedef std::vector< std::string > | StringVector |
Public Member Functions | |
| void | SynErr (int n) |
| void | Get () |
| void | Expect (int n) |
| bool | StartOf (int s) |
| void | ExpectWeak (int n, int follow) |
| bool | WeakSeparator (int n, int syFol, int repFol) |
| bool | HasVarAssign () |
| std::string | Str (Token *t) |
| void | Unescape (std::string &s) |
| std::string | Strlit (Token *t) |
| void | Clear () |
| Parser (Scanner *scanner) | |
| ~Parser () | |
| void | SemErr (const wchar_t *msg) |
| void | StringLiteral (std::string &s) |
| void | PlainWord (std::string &s) |
| void | Parameter (M::Expr &p) |
| void | Rule (M::Expr &r) |
| void | SequencePart (M::Expr &s) |
| void | Sequence (M::Expr &s) |
| void | Action (M::Expr &r) |
| void | Alternates (M::Expr &a) |
| void | Recurrence (M::Expr &lhs) |
| void | RuleExpr (M::Expr &r) |
| void | ActionRHS (M::Expr &rhsRule) |
| void | ActionExpr (M::Expr &r) |
| void | WsfGrammar () |
| void | Parse () |
| void | InitParse () |
Public Attributes | |
| int | maxT |
| Scanner * | scanner |
| Errors * | errors |
| Token * | t |
| Token * | la |
| M::Expr | mRootRule |
| float | mPriority |
Static Public Attributes | |
| static const int | cLARGE_NUMBER = 0x7fffffff |
| typedef std::vector<std::string> WsfGrammar::Parser::StringVector |
| anonymous enum |
| WsfGrammar::Parser::~Parser | ( | ) |
References errors.
| void WsfGrammar::Parser::Action | ( | M::Expr & | r | ) |
References ActionExpr(), WsfGrammar::M::Expr::Clear(), WsfGrammar::M::cRT_ACTION, Expect(), Get(), la, WsfGrammar::M::Expr::mRuleType, and WsfGrammar::M::Expr::PushMove().
Referenced by Sequence().
| void WsfGrammar::Parser::ActionExpr | ( | M::Expr & | r | ) |
| void WsfGrammar::Parser::ActionRHS | ( | M::Expr & | rhsRule | ) |
References _comma, _string_literal, _word, ActionRHS(), WsfGrammar::M::Expr::Clear(), Expect(), Get(), la, WsfGrammar::M::Expr::mRuleType, WsfGrammar::M::Expr::mText, PlainWord(), WsfGrammar::M::Expr::PushMove(), and WsfGrammar::M::Expr::SetLiteral().
Referenced by ActionExpr(), and ActionRHS().
| void WsfGrammar::Parser::Alternates | ( | M::Expr & | a | ) |
References _alternate, WsfGrammar::M::Expr::Clear(), WsfGrammar::M::cRT_ALTERNATE, Get(), la, WsfGrammar::M::Expr::mRuleType, WsfGrammar::M::Expr::PushMove(), and Sequence().
Referenced by Rule().
|
inline |
References WsfGrammar::M::cRT_ROOT, mPriority, and mRootRule.
| void WsfGrammar::Parser::Expect | ( | int | n | ) |
References Get(), la, and SynErr().
Referenced by Action(), ActionExpr(), ActionRHS(), Parse(), Rule(), RuleExpr(), and StringLiteral().
| void WsfGrammar::Parser::ExpectWeak | ( | int | n, |
| int | follow ) |
| void WsfGrammar::Parser::Get | ( | ) |
References WsfGrammar::coco_string_create(), WsfGrammar::coco_string_delete(), la, maxT, scanner, and t.
Referenced by Action(), ActionRHS(), Alternates(), Expect(), ExpectWeak(), InitParse(), Parameter(), PlainWord(), Recurrence(), Rule(), SynErr(), and WeakSeparator().
|
inline |
References _assign, WsfGrammar::Token::kind, and scanner.
Referenced by ActionExpr().
| void WsfGrammar::Parser::InitParse | ( | ) |
References WsfGrammar::coco_string_create(), Get(), la, and t.
Referenced by Parse().
| void WsfGrammar::Parser::Parameter | ( | M::Expr & | p | ) |
References _label, Get(), la, WsfGrammar::M::Expr::mLabel, Rule(), Str(), and t.
Referenced by Rule(), and RuleExpr().
| void WsfGrammar::Parser::Parse | ( | ) |
References Expect(), InitParse(), and WsfGrammar().
Referenced by WsfParseDefinitions::AddGrammar().
| void WsfGrammar::Parser::PlainWord | ( | std::string & | s | ) |
References _string_literal, _word, Get(), la, StringLiteral(), Strlit(), SynErr(), and t.
Referenced by ActionExpr(), ActionRHS(), and Rule().
| void WsfGrammar::Parser::Recurrence | ( | M::Expr & | lhs | ) |
References _plus, _question, _star, WsfGrammar::M::cRT_EXPRESSION, Get(), la, WsfGrammar::M::Expr::Literal(), WsfGrammar::M::Expr::mRuleType, WsfGrammar::M::Expr::mType, Strlit(), SynErr(), and t.
Referenced by Rule().
| void WsfGrammar::Parser::Rule | ( | M::Expr & | r | ) |
References _gt, _label, _lt, _plus, _question, _star, _string_literal, _word, Alternates(), WsfGrammar::M::cRT_EXPRESSION, Expect(), Get(), la, Parameter(), PlainWord(), Recurrence(), RuleExpr(), WsfGrammar::M::Expr::SetLiteral(), StartOf(), Strlit(), WsfGrammar::M::Expr::Swap(), SynErr(), and t.
Referenced by Parameter(), and SequencePart().
| void WsfGrammar::Parser::RuleExpr | ( | M::Expr & | r | ) |
References _word, WsfGrammar::M::cRT_EXPRESSION, Expect(), Parameter(), StartOf(), Strlit(), and t.
Referenced by Rule(), and WsfGrammar().
| void WsfGrammar::Parser::Sequence | ( | M::Expr & | s | ) |
References Action(), WsfGrammar::M::cRT_SEQUENCE, la, SequencePart(), and StartOf().
Referenced by Alternates().
| void WsfGrammar::Parser::SequencePart | ( | M::Expr & | s | ) |
References Rule().
Referenced by Sequence().
| bool WsfGrammar::Parser::StartOf | ( | int | s | ) |
References la.
Referenced by ExpectWeak(), Rule(), RuleExpr(), Sequence(), and WeakSeparator().
|
inline |
References t.
Referenced by Parameter(), and Strlit().
| void WsfGrammar::Parser::StringLiteral | ( | std::string & | s | ) |
References _string_literal, Expect(), Strlit(), and t.
Referenced by PlainWord().
|
inline |
References Str(), t, and Unescape().
Referenced by PlainWord(), Recurrence(), Rule(), RuleExpr(), and StringLiteral().
| void WsfGrammar::Parser::SynErr | ( | int | n | ) |
References errors, Get(), and la.
Referenced by ActionExpr(), Expect(), ExpectWeak(), PlainWord(), Recurrence(), Rule(), and WeakSeparator().
|
inline |
Referenced by Strlit().
| bool WsfGrammar::Parser::WeakSeparator | ( | int | n, |
| int | syFol, | ||
| int | repFol ) |
| void WsfGrammar::Parser::WsfGrammar | ( | ) |
References WsfGrammar::M::cRT_ROOT, la, mRootRule, and RuleExpr().
Referenced by Parse().
|
static |
| Errors* WsfGrammar::Parser::errors |
Referenced by WsfParseDefinitions::AddGrammar(), Parser(), SemErr(), SynErr(), and ~Parser().
| Token* WsfGrammar::Parser::la |
Referenced by Action(), ActionExpr(), ActionRHS(), Alternates(), Expect(), ExpectWeak(), Get(), InitParse(), Parameter(), Parser(), PlainWord(), Recurrence(), Rule(), Sequence(), StartOf(), SynErr(), WeakSeparator(), and WsfGrammar().
| float WsfGrammar::Parser::mPriority |
Referenced by Clear().
| M::Expr WsfGrammar::Parser::mRootRule |
Referenced by WsfParseDefinitions::AddGrammar(), Clear(), and WsfGrammar().
| Scanner* WsfGrammar::Parser::scanner |
Referenced by Get(), HasVarAssign(), and Parser().
| Token* WsfGrammar::Parser::t |
Referenced by Get(), InitParse(), Parameter(), Parser(), PlainWord(), Recurrence(), Rule(), RuleExpr(), SemErr(), Str(), StringLiteral(), and Strlit().