|
WSF
|
#include <Parser.h>

Public Types | |
| enum | { _EOF = 0 , _ident = 1 , _number = 2 , _real_number = 3 , _string_literal = 4 , _char_literal = 5 , _dot = 6 , _semicolon = 7 , _lparen = 8 , _rparen = 9 , _assign = 10 , _eq = 11 , _ne = 12 , _ge = 13 , _le = 14 , _plus = 15 , _minus = 16 , _and = 17 , _or = 18 , _rbrace = 19 , _comma = 20 , _plus_assign = 21 , _minus_assign = 22 , _times_assign = 23 , _div_assign = 24 , _r_arrow = 25 , _do = 26 , _if = 27 , _for = 28 , _foreach = 29 , _in = 30 , _else = 31 , _while = 32 , _break = 33 , _continue = 34 , _return = 35 , _null = 36 , _null2 = 37 , _true = 38 , _false = 39 , _string = 40 , _int = 41 , _double = 42 , _char = 43 , _bool = 44 , _global = 45 , _static = 46 , _extern = 47 , _ppvar = 59 , _ppvarEnd = 60 } |
| using | Cx = Us::UsCtx |
| using | Ty = UsType |
| using | Fn = UsFunction |
| using | Val = Us::UsVal |
| using | ValList = Us::UsValList |
| using | Sy = UsSymbol |
Public Member Functions | |
| bool | IsAssignment () |
| bool | IsCast (Cx &c) |
| bool | IsInitializerEntry () |
| bool | IsScript (Cx &c) |
| bool | IsType (Cx &c, Token *tok) |
| bool | IsType (Cx &c) |
| bool | IsVarDecl (Cx &c) |
| void | EOF_Token () |
| Parser (Scanner *aScannerPtr) | |
| Parser (const Parser &aSrc)=delete | |
| Parser & | operator= (const Parser &aRhs)=delete |
| virtual | ~Parser () |
| void | InitParse () |
| void | Parse () |
| void | SemErr (const cocochar_t *msg) |
| void | Script () |
| void | func_def (Cx &c) |
| void | basic_type () |
| void | type (Cx &c, Ty *&ty) |
| void | identifier (Cx &c, Val &v) |
| void | static_exp (Cx &c, Val &v) |
| void | arg_list (Cx &c, ValList &args) |
| void | exp (Cx &c, Val &v) |
| void | block (Cx &c) |
| void | stat (Cx &c) |
| void | block_func (Cx &c) |
| void | extern_stat (Cx &c) |
| void | var_decl_expr (Cx &c, Val &v) |
| void | var_decl (Cx &c) |
| void | do_stat (Cx &c) |
| void | bool_exp (Cx &c, Val &v) |
| void | while_stat (Cx &c) |
| void | assign_expr (Cx &c, Val &v) |
| void | stat2 (Cx &c) |
| void | initializer_list (Cx &c, Val &v) |
| void | AssignOp (int &op) |
| void | exp1 (Cx &c, Val &v) |
| void | exp2 (Cx &c, Val &v) |
| void | exp3 (Cx &c, Val &v) |
| void | exp_eq (Cx &c, Val &v) |
| void | EqOp (int &op) |
| void | exp_test (Cx &c, Val &v) |
| void | TestOp (int &op) |
| void | exp_add (Cx &c, Val &v) |
| void | AddOp (int &op) |
| void | exp_mult (Cx &c, Val &v) |
| void | MulOp (int &op) |
| void | exp5 (Cx &c, Val &v) |
| void | exp6 (Cx &c, Val &v) |
| void | exp7 (Cx &c, Val &v) |
| void | atom (Cx &c, Val &v) |
| void | trailer (Cx &c, Val &v) |
| void | formal_param_list (Cx &c, Fn &f) |
Public Attributes | |
| int | maxT |
| Cx * | mRootCx |
| Scanner * | mScannerPtr {nullptr} |
| Errors * | mErrorsPtr {nullptr} |
| Token * | t {nullptr} |
| Token * | la {nullptr} |
| using Us::Parser::Cx = Us::UsCtx |
| using Us::Parser::Fn = UsFunction |
| using Us::Parser::Sy = UsSymbol |
| using Us::Parser::Ty = UsType |
| using Us::Parser::Val = Us::UsVal |
| using Us::Parser::ValList = Us::UsValList |
| anonymous enum |
|
explicit |
References maxT, mErrorsPtr, and mScannerPtr.
Referenced by operator=(), and Parser().
|
delete |
References Parser().
|
virtual |
References mErrorsPtr.
| void Us::Parser::AddOp | ( | int & | op | ) |
References _minus, _plus, Us::UsCtx::cADD, Us::UsCtx::cSUBTRACT, and la.
Referenced by exp_add().
References AssignOp(), exp(), identifier(), and Us::UsCtx::Op().
| void Us::Parser::AssignOp | ( | int & | op | ) |
References _assign, _div_assign, _minus_assign, _plus_assign, _times_assign, Us::UsCtx::cASSIGN, Us::UsCtx::cASSIGN_DIV, Us::UsCtx::cASSIGN_MINUS, Us::UsCtx::cASSIGN_PLUS, Us::UsCtx::cASSIGN_TIMES, and la.
Referenced by assign_expr(), and trailer().
References _dot, _ident, _lparen, _rparen, arg_list(), Us::UsCtx::AtDot(), Us::UsCtx::Call(), Us::UsCtx::Ctor(), exp1(), Us::UsCtx::GetAttribute(), identifier(), initializer_list(), IsScript(), IsType(), la, static_exp(), t, and type().
Referenced by exp7().
| void Us::Parser::basic_type | ( | ) |
| void Us::Parser::block_func | ( | Cx & | c | ) |
Referenced by func_def(), and wizard::WsfScriptParser::ProcessScript().
References exp().
Referenced by do_stat(), stat(), and while_stat().
| void Us::Parser::do_stat | ( | Cx & | c | ) |
References _do, _lparen, _rparen, _semicolon, _while, bool_exp(), Us::UsCtx::cDO_BLOCK, Us::UsCtx::DoCond(), Us::UsCtx::DoWhileStart(), Us::UsCtx::SetBlockType(), and stat().
Referenced by stat().
|
inline |
References mRootCx.
| void Us::Parser::EqOp | ( | int & | op | ) |
References _eq, _ne, Us::UsCtx::cEQ, Us::UsCtx::cNE, and la.
Referenced by exp_eq().
References exp1().
Referenced by arg_list(), assign_expr(), bool_exp(), initializer_list(), stat(), stat2(), trailer(), and var_decl().
References _or, exp2(), la, Us::UsCtx::OrCheck(), and Us::UsCtx::OrComplete().
References _and, Us::UsCtx::AndCheck(), Us::UsCtx::AndComplete(), exp3(), and la.
Referenced by exp1().
References _lparen, _rparen, Us::UsCtx::Cast(), Us::UsCtx::cNOT, exp5(), exp6(), IsCast(), la, Us::UsCtx::Op(), and type().
Referenced by exp5(), and exp_mult().
References _minus, _plus, Us::UsCtx::cUNARY_MINUS, Us::UsCtx::cUNARY_PLUS, exp7(), la, and Us::UsCtx::Op().
Referenced by exp5().
References _minus, _plus, AddOp(), exp_mult(), la, and Us::UsCtx::Op().
Referenced by exp_test().
References _eq, _ne, EqOp(), exp_test(), la, and Us::UsCtx::Op().
Referenced by exp3().
References exp5(), la, MulOp(), and Us::UsCtx::Op().
Referenced by exp_add().
References exp_add(), Us::UsCtx::Op(), and TestOp().
Referenced by exp_eq().
| void Us::Parser::extern_stat | ( | Cx & | c | ) |
References _comma, _extern, _ident, _lparen, _rparen, _semicolon, Us::UsCtx::AddEntry(), Us::UsCtx::AddParam(), Us::UsVal::cEXTERN_VARIABLE, la, Us::UsCtx::SetRType(), t, type(), and Us::UsCtx::VarDecl().
Referenced by stat().
References _comma, _ident, _lparen, _rparen, Us::UsCtx::AddParam(), la, t, and type().
Referenced by func_def().
| void Us::Parser::func_def | ( | Cx & | c | ) |
References _ident, Us::UsCtx::AddEntry(), block_func(), Us::UsCtx::cSCRIPT_BLOCK, formal_param_list(), Us::UsCtx::FuncComplete(), Us::UsCtx::FuncDefStart(), Us::UsCtx::SetBlockType(), Us::UsCtx::SetRType(), t, and type().
Referenced by Script().
References _ident, Us::UsCtx::Identifier(), and t.
Referenced by assign_expr(), and atom().
References _comma, _rbrace, Us::UsCtx::AddToInitializerList(), exp(), IsInitializerEntry(), la, and Us::UsCtx::NewInitializerList().
Referenced by atom().
| void Us::Parser::InitParse | ( | ) |
References COCO_STR, Us::coco_string_create(), la, and t.
Referenced by Parse(), and wizard::WsfScriptParser::ProcessScript().
|
inline |
References _assign, _div_assign, _ident, _minus_assign, _plus_assign, _times_assign, Us::Token::kind, la, and mScannerPtr.
Referenced by stat2().
|
inline |
References _dot, _lparen, IsType(), Us::Token::kind, la, and mScannerPtr.
Referenced by exp5().
|
inline |
References _comma, _rbrace, Us::Token::kind, la, and mScannerPtr.
Referenced by initializer_list().
|
inline |
References Us::UsVal::IsAppMethod(), Us::UsVal::IsScript(), la, and Us::UsCtx::Search().
Referenced by atom().
|
inline |
References la, and Us::UsCtx::qType().
References Us::UsCtx::qType().
Referenced by atom(), IsCast(), and IsVarDecl().
|
inline |
| void Us::Parser::MulOp | ( | int & | op | ) |
References Us::UsCtx::cDIVIDE, Us::UsCtx::cMULTIPLY, and la.
Referenced by exp_mult().
| void Us::Parser::Parse | ( | ) |
References InitParse(), and Script().
Referenced by wizard::WsfScriptParser::ProcessScript().
| void Us::Parser::Script | ( | ) |
References func_def(), and mRootCx.
Referenced by Parse().
| void Us::Parser::SemErr | ( | const cocochar_t * | msg | ) |
References mErrorsPtr, and t.
| void Us::Parser::stat | ( | Cx & | c | ) |
References _break, _continue, _do, _else, _EOF, _extern, _for, _foreach, _ident, _if, _in, _lparen, _return, _rparen, _semicolon, _while, assign_expr(), Us::UsCtx::BeginStat(), block(), bool_exp(), Us::UsCtx::Break(), c1, Us::UsCtx::cFOR_BLOCK, Us::UsCtx::Continue(), do_stat(), Us::UsCtx::EndContext(), Us::UsCtx::EndStat(), exp(), extern_stat(), Us::UsCtx::ForCond(), Us::UsCtx::ForEachBegin(), Us::UsCtx::ForInc(), Us::UsCtx::IfCond(), Us::UsCtx::IfElseEnd(), Us::UsCtx::IfTrueEnd(), IsVarDecl(), la, Us::UsCtx::Return(), Us::UsCtx::SetBlockType(), stat(), stat2(), var_decl(), var_decl_expr(), and while_stat().
Referenced by block(), block_func(), do_stat(), stat(), and while_stat().
| void Us::Parser::stat2 | ( | Cx & | c | ) |
References _EOF, _semicolon, assign_expr(), exp(), IsAssignment(), IsVarDecl(), la, and var_decl().
Referenced by stat().
References _char_literal, _false, _null, _null2, _number, _real_number, _string_literal, _true, Us::UsCtx::BoolLiteral(), Us::UsCtx::DoubleLiteral(), Us::UsCtx::IntLiteral(), la, Us::UsCtx::NullLiteral(), Us::UsCtx::StringLiteral(), and t.
Referenced by atom().
| void Us::Parser::TestOp | ( | int & | op | ) |
References _ge, _le, Us::UsCtx::cGE, Us::UsCtx::cGT, Us::UsCtx::cLE, Us::UsCtx::cLT, and la.
Referenced by exp_test().
References _assign, _dot, _ident, _lparen, _r_arrow, _rparen, arg_list(), AssignOp(), Us::UsCtx::AtDot(), Us::UsCtx::Call(), Us::UsCtx::cINDEX, exp(), exp1(), Us::UsCtx::GetClassMethod(), Us::UsCtx::GetClassVariable(), Us::UsCtx::GetDynAttribute(), la, Us::UsCtx::Op(), and t.
Referenced by exp7().
References _comma, _ident, basic_type(), la, Us::UsCtx::qType(), t, Us::UsCtx::Type(), and type().
Referenced by atom(), exp5(), extern_stat(), formal_param_list(), func_def(), type(), var_decl(), and var_decl_expr().
| void Us::Parser::var_decl | ( | Cx & | c | ) |
References _ident, t, type(), and Us::UsCtx::VarDecl().
Referenced by stat().
| void Us::Parser::while_stat | ( | Cx & | c | ) |
References _lparen, _rparen, _while, bool_exp(), Us::UsCtx::cWHILE_BLOCK, Us::UsCtx::EndContext(), Us::UsCtx::SetBlockType(), stat(), and Us::UsCtx::WhileCond().
Referenced by stat().
| Token* Us::Parser::la {nullptr} |
Referenced by AddOp(), arg_list(), AssignOp(), atom(), basic_type(), EqOp(), exp1(), exp2(), exp3(), exp5(), exp6(), exp7(), exp_add(), exp_eq(), exp_mult(), extern_stat(), formal_param_list(), initializer_list(), InitParse(), IsAssignment(), IsCast(), IsInitializerEntry(), IsScript(), IsType(), IsVarDecl(), MulOp(), stat(), stat2(), static_exp(), TestOp(), trailer(), type(), and var_decl().
| int Us::Parser::maxT |
Referenced by Parser().
| Errors* Us::Parser::mErrorsPtr {nullptr} |
Referenced by Parser(), wizard::WsfScriptParser::ProcessScript(), SemErr(), and ~Parser().
| Cx* Us::Parser::mRootCx |
Referenced by EOF_Token(), wizard::WsfScriptParser::ProcessScript(), and Script().
| Scanner* Us::Parser::mScannerPtr {nullptr} |
Referenced by IsAssignment(), IsCast(), IsInitializerEntry(), IsVarDecl(), and Parser().
| Token* Us::Parser::t {nullptr} |
Referenced by atom(), extern_stat(), formal_param_list(), func_def(), identifier(), InitParse(), SemErr(), static_exp(), trailer(), type(), var_decl(), and var_decl_expr().