WSF
Us::Parser Class Reference

#include <Parser.h>

Collaboration diagram for Us::Parser:

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
Parseroperator= (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
CxmRootCx
ScannermScannerPtr {nullptr}
ErrorsmErrorsPtr {nullptr}
Tokent {nullptr}
Tokenla {nullptr}

Member Typedef Documentation

◆ Cx

◆ Fn

◆ Sy

◆ Ty

◆ Val

◆ ValList

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
_EOF 
_ident 
_number 
_real_number 
_string_literal 
_char_literal 
_dot 
_semicolon 
_lparen 
_rparen 
_assign 
_eq 
_ne 
_ge 
_le 
_plus 
_minus 
_and 
_or 
_rbrace 
_comma 
_plus_assign 
_minus_assign 
_times_assign 
_div_assign 
_r_arrow 
_do 
_if 
_for 
_foreach 
_in 
_else 
_while 
_break 
_continue 
_return 
_null 
_null2 
_true 
_false 
_string 
_int 
_double 
_char 
_bool 
_global 
_static 
_extern 
_ppvar 
_ppvarEnd 

Constructor & Destructor Documentation

◆ Parser() [1/2]

Us::Parser::Parser ( Scanner * aScannerPtr)
explicit

References maxT, mErrorsPtr, and mScannerPtr.

Referenced by operator=(), and Parser().

◆ Parser() [2/2]

Us::Parser::Parser ( const Parser & aSrc)
delete

References Parser().

◆ ~Parser()

Us::Parser::~Parser ( )
virtual

References mErrorsPtr.

Member Function Documentation

◆ AddOp()

void Us::Parser::AddOp ( int & op)

References _minus, _plus, Us::UsCtx::cADD, Us::UsCtx::cSUBTRACT, and la.

Referenced by exp_add().

◆ arg_list()

void Us::Parser::arg_list ( Cx & c,
ValList & args )

References _comma, exp(), and la.

Referenced by atom(), and trailer().

◆ assign_expr()

void Us::Parser::assign_expr ( Cx & c,
Val & v )

References AssignOp(), exp(), identifier(), and Us::UsCtx::Op().

Referenced by stat(), and stat2().

◆ AssignOp()

◆ atom()

◆ basic_type()

void Us::Parser::basic_type ( )

References _bool, _char, _double, _int, _string, and la.

Referenced by type().

◆ block()

void Us::Parser::block ( Cx & c)

References _rbrace, and stat().

Referenced by stat().

◆ block_func()

void Us::Parser::block_func ( Cx & c)

References _EOF, and stat().

Referenced by func_def(), and wizard::WsfScriptParser::ProcessScript().

◆ bool_exp()

void Us::Parser::bool_exp ( Cx & c,
Val & v )

References exp().

Referenced by do_stat(), stat(), and while_stat().

◆ do_stat()

◆ EOF_Token()

void Us::Parser::EOF_Token ( )
inline

References mRootCx.

◆ EqOp()

void Us::Parser::EqOp ( int & op)

References _eq, _ne, Us::UsCtx::cEQ, Us::UsCtx::cNE, and la.

Referenced by exp_eq().

◆ exp()

void Us::Parser::exp ( Cx & c,
Val & v )

◆ exp1()

void Us::Parser::exp1 ( Cx & c,
Val & v )

References _or, exp2(), la, Us::UsCtx::OrCheck(), and Us::UsCtx::OrComplete().

Referenced by atom(), exp(), and trailer().

◆ exp2()

void Us::Parser::exp2 ( Cx & c,
Val & v )

References _and, Us::UsCtx::AndCheck(), Us::UsCtx::AndComplete(), exp3(), and la.

Referenced by exp1().

◆ exp3()

void Us::Parser::exp3 ( Cx & c,
Val & v )

References exp_eq(), and la.

Referenced by exp2().

◆ exp5()

void Us::Parser::exp5 ( Cx & c,
Val & v )

◆ exp6()

void Us::Parser::exp6 ( Cx & c,
Val & v )

◆ exp7()

void Us::Parser::exp7 ( Cx & c,
Val & v )

References _dot, _r_arrow, atom(), la, and trailer().

Referenced by exp6().

◆ exp_add()

void Us::Parser::exp_add ( Cx & c,
Val & v )

References _minus, _plus, AddOp(), exp_mult(), la, and Us::UsCtx::Op().

Referenced by exp_test().

◆ exp_eq()

void Us::Parser::exp_eq ( Cx & c,
Val & v )

References _eq, _ne, EqOp(), exp_test(), la, and Us::UsCtx::Op().

Referenced by exp3().

◆ exp_mult()

void Us::Parser::exp_mult ( Cx & c,
Val & v )

References exp5(), la, MulOp(), and Us::UsCtx::Op().

Referenced by exp_add().

◆ exp_test()

void Us::Parser::exp_test ( Cx & c,
Val & v )

References exp_add(), Us::UsCtx::Op(), and TestOp().

Referenced by exp_eq().

◆ extern_stat()

◆ formal_param_list()

void Us::Parser::formal_param_list ( Cx & c,
Fn & f )

References _comma, _ident, _lparen, _rparen, Us::UsCtx::AddParam(), la, t, and type().

Referenced by func_def().

◆ func_def()

◆ identifier()

void Us::Parser::identifier ( Cx & c,
Val & v )

References _ident, Us::UsCtx::Identifier(), and t.

Referenced by assign_expr(), and atom().

◆ initializer_list()

void Us::Parser::initializer_list ( Cx & c,
Val & v )

◆ InitParse()

void Us::Parser::InitParse ( )

◆ IsAssignment()

bool Us::Parser::IsAssignment ( )
inline

◆ IsCast()

bool Us::Parser::IsCast ( Cx & c)
inline

References _dot, _lparen, IsType(), Us::Token::kind, la, and mScannerPtr.

Referenced by exp5().

◆ IsInitializerEntry()

bool Us::Parser::IsInitializerEntry ( )
inline

References _comma, _rbrace, Us::Token::kind, la, and mScannerPtr.

Referenced by initializer_list().

◆ IsScript()

bool Us::Parser::IsScript ( Cx & c)
inline

◆ IsType() [1/2]

bool Us::Parser::IsType ( Cx & c)
inline

References la, and Us::UsCtx::qType().

◆ IsType() [2/2]

bool Us::Parser::IsType ( Cx & c,
Token * tok )
inline

References Us::UsCtx::qType().

Referenced by atom(), IsCast(), and IsVarDecl().

◆ IsVarDecl()

bool Us::Parser::IsVarDecl ( Cx & c)
inline

References _dot, _extern, _global, _lparen, _static, IsType(), Us::Token::kind, la, and mScannerPtr.

Referenced by stat(), and stat2().

◆ MulOp()

void Us::Parser::MulOp ( int & op)

References Us::UsCtx::cDIVIDE, Us::UsCtx::cMULTIPLY, and la.

Referenced by exp_mult().

◆ operator=()

Parser & Us::Parser::operator= ( const Parser & aRhs)
delete

References Parser().

◆ Parse()

void Us::Parser::Parse ( )

◆ Script()

void Us::Parser::Script ( )

References func_def(), and mRootCx.

Referenced by Parse().

◆ SemErr()

void Us::Parser::SemErr ( const cocochar_t * msg)

References mErrorsPtr, and t.

◆ stat()

◆ stat2()

void Us::Parser::stat2 ( Cx & c)

◆ static_exp()

◆ TestOp()

void Us::Parser::TestOp ( int & op)

◆ trailer()

◆ type()

void Us::Parser::type ( Cx & c,
Ty *& ty )

◆ var_decl()

◆ var_decl_expr()

void Us::Parser::var_decl_expr ( Cx & c,
Val & v )

References _ident, t, type(), and Us::UsCtx::VarDecl().

Referenced by stat().

◆ while_stat()

Member Data Documentation

◆ la

◆ maxT

int Us::Parser::maxT

Referenced by Parser().

◆ mErrorsPtr

Errors* Us::Parser::mErrorsPtr {nullptr}

◆ mRootCx

Cx* Us::Parser::mRootCx

◆ mScannerPtr

Scanner* Us::Parser::mScannerPtr {nullptr}

◆ t


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved