Code::Blocks  SVN r11506
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
SQCompiler Class Reference
Collaboration diagram for SQCompiler:

Public Member Functions

 SQCompiler (SQVM *v, SQLEXREADFUNC rg, SQUserPointer up, const SQChar *sourcename, bool raiseerror, bool lineinfo)
 
void Error (const SQChar *s,...)
 
void Lex ()
 
void PushExpState ()
 
bool IsDerefToken (SQInteger tok)
 
ExpState PopExpState ()
 
SQObject Expect (SQInteger tok)
 
bool IsEndOfStatement ()
 
void OptionalSemicolon ()
 
void MoveIfCurrentTargetIsLocal ()
 
bool Compile (SQObjectPtr &o)
 
void Statements ()
 
void Statement ()
 
void EmitDerefOp (SQOpcode op)
 
void Emit2ArgsOP (SQOpcode op, SQInteger p3=0)
 
void EmitCompoundArith (SQInteger tok, bool deref)
 
void CommaExpr ()
 
ExpState Expression (bool funcarg=false)
 
void BIN_EXP (SQOpcode op, void(SQCompiler::*f)(void), SQInteger op3=0)
 
void LogicalOrExp ()
 
void LogicalAndExp ()
 
void BitwiseOrExp ()
 
void BitwiseXorExp ()
 
void BitwiseAndExp ()
 
void CompExp ()
 
void ShiftExp ()
 
void PlusExp ()
 
void MultExp ()
 
void PrefixedExpr ()
 
SQInteger Factor ()
 
void UnaryOP (SQOpcode op)
 
bool NeedGet ()
 
void FunctionCallArgs ()
 
void ParseTableOrClass (SQInteger separator, SQInteger terminator='}')
 
void LocalDeclStatement ()
 
void IfStatement ()
 
void WhileStatement ()
 
void DoWhileStatement ()
 
void ForStatement ()
 
void ForEachStatement ()
 
void SwitchStatement ()
 
void FunctionStatement ()
 
void ClassStatement ()
 
SQObject ExpectScalar ()
 
void EnumStatement ()
 
void TryCatchStatement ()
 
void FunctionExp (SQInteger ftype)
 
void ClassExp ()
 
void DelegateExpr ()
 
void DeleteExpr ()
 
void PrefixIncDec (SQInteger token)
 
void CreateFunction (SQObject &name)
 
void CleanStack (SQInteger stacksize)
 
void ResolveBreaks (SQFuncState *funcstate, SQInteger ntoresolve)
 
void ResolveContinues (SQFuncState *funcstate, SQInteger ntoresolve, SQInteger targetpos)
 

Static Public Member Functions

static void ThrowError (void *ud, const SQChar *s)
 

Private Attributes

SQInteger _token
 
SQFuncState * _fs
 
SQObjectPtr _sourcename
 
SQLexer _lex
 
bool _lineinfo
 
bool _raiseerror
 
SQInteger _debugline
 
SQInteger _debugop
 
ExpStateVec _expstates
 
SQCharcompilererror
 
jmp_buf _errorjmp
 
SQVM * _vm
 

Detailed Description

Definition at line 48 of file sqcompiler.cpp.

Constructor & Destructor Documentation

◆ SQCompiler()

SQCompiler::SQCompiler ( SQVM *  v,
SQLEXREADFUNC  rg,
SQUserPointer  up,
const SQChar sourcename,
bool  raiseerror,
bool  lineinfo 
)
inline

Definition at line 51 of file sqcompiler.cpp.

References NULL.

Member Function Documentation

◆ BIN_EXP()

void SQCompiler::BIN_EXP ( SQOpcode  op,
void(SQCompiler::*)(void)  f,
SQInteger  op3 = 0 
)
inline

Definition at line 413 of file sqcompiler.cpp.

◆ BitwiseAndExp()

void SQCompiler::BitwiseAndExp ( )
inline

Definition at line 475 of file sqcompiler.cpp.

References CompExp().

Referenced by BitwiseXorExp().

◆ BitwiseOrExp()

void SQCompiler::BitwiseOrExp ( )
inline

Definition at line 461 of file sqcompiler.cpp.

References BitwiseXorExp().

Referenced by LogicalAndExp().

◆ BitwiseXorExp()

void SQCompiler::BitwiseXorExp ( )
inline

Definition at line 468 of file sqcompiler.cpp.

References BitwiseAndExp().

Referenced by BitwiseOrExp().

◆ ClassExp()

void SQCompiler::ClassExp ( )
inline

Definition at line 1195 of file sqcompiler.cpp.

◆ ClassStatement()

void SQCompiler::ClassStatement ( )
inline

Definition at line 1076 of file sqcompiler.cpp.

References ExpState::_deref, _exst, DEREF_FIELD, and DEREF_NO_DEREF.

◆ CleanStack()

void SQCompiler::CleanStack ( SQInteger  stacksize)
inline

Definition at line 1314 of file sqcompiler.cpp.

◆ CommaExpr()

void SQCompiler::CommaExpr ( )
inline

Definition at line 337 of file sqcompiler.cpp.

◆ CompExp()

void SQCompiler::CompExp ( )
inline

Definition at line 482 of file sqcompiler.cpp.

References ShiftExp().

Referenced by BitwiseAndExp().

◆ Compile()

bool SQCompiler::Compile ( SQObjectPtr &  o)
inline

Definition at line 156 of file sqcompiler.cpp.

References NULL.

Referenced by Compile().

◆ CreateFunction()

void SQCompiler::CreateFunction ( SQObject &  name)
inline

Definition at line 1249 of file sqcompiler.cpp.

◆ DelegateExpr()

void SQCompiler::DelegateExpr ( )
inline

Definition at line 1215 of file sqcompiler.cpp.

◆ DeleteExpr()

void SQCompiler::DeleteExpr ( )
inline

Definition at line 1223 of file sqcompiler.cpp.

References ExpState::_deref, _exst, DEREF_FIELD, and DEREF_NO_DEREF.

◆ DoWhileStatement()

void SQCompiler::DoWhileStatement ( )
inline

Definition at line 908 of file sqcompiler.cpp.

References BEGIN_BREAKBLE_BLOCK, and END_BREAKBLE_BLOCK.

◆ Emit2ArgsOP()

void SQCompiler::Emit2ArgsOP ( SQOpcode  op,
SQInteger  p3 = 0 
)
inline

Definition at line 308 of file sqcompiler.cpp.

◆ EmitCompoundArith()

void SQCompiler::EmitCompoundArith ( SQInteger  tok,
bool  deref 
)
inline

Definition at line 314 of file sqcompiler.cpp.

◆ EmitDerefOp()

void SQCompiler::EmitDerefOp ( SQOpcode  op)
inline

Definition at line 301 of file sqcompiler.cpp.

◆ EnumStatement()

void SQCompiler::EnumStatement ( )
inline

Definition at line 1129 of file sqcompiler.cpp.

◆ Error()

void SQCompiler::Error ( const SQChar s,
  ... 
)
inline

Definition at line 63 of file sqcompiler.cpp.

Referenced by ThrowError().

◆ Expect()

SQObject SQCompiler::Expect ( SQInteger  tok)
inline

Definition at line 89 of file sqcompiler.cpp.

◆ ExpectScalar()

SQObject SQCompiler::ExpectScalar ( )
inline

Definition at line 1092 of file sqcompiler.cpp.

◆ Expression()

ExpState SQCompiler::Expression ( bool  funcarg = false)
inline

Definition at line 341 of file sqcompiler.cpp.

References _exst, DEREF_FIELD, and DEREF_NO_DEREF.

◆ Factor()

SQInteger SQCompiler::Factor ( )
inline

Definition at line 595 of file sqcompiler.cpp.

References _exst, DEREF_FIELD, and DEREF_NO_DEREF.

◆ ForEachStatement()

void SQCompiler::ForEachStatement ( )
inline

Definition at line 967 of file sqcompiler.cpp.

References BEGIN_BREAKBLE_BLOCK, and END_BREAKBLE_BLOCK.

◆ ForStatement()

void SQCompiler::ForStatement ( )
inline

Definition at line 922 of file sqcompiler.cpp.

References BEGIN_BREAKBLE_BLOCK, and END_BREAKBLE_BLOCK.

◆ FunctionCallArgs()

void SQCompiler::FunctionCallArgs ( )
inline

Definition at line 767 of file sqcompiler.cpp.

◆ FunctionExp()

void SQCompiler::FunctionExp ( SQInteger  ftype)
inline

Definition at line 1189 of file sqcompiler.cpp.

References _null_.

◆ FunctionStatement()

void SQCompiler::FunctionStatement ( )
inline

Definition at line 1056 of file sqcompiler.cpp.

◆ IfStatement()

void SQCompiler::IfStatement ( )
inline

Definition at line 861 of file sqcompiler.cpp.

◆ IsDerefToken()

bool SQCompiler::IsDerefToken ( SQInteger  tok)
inline

Definition at line 75 of file sqcompiler.cpp.

◆ IsEndOfStatement()

bool SQCompiler::IsEndOfStatement ( )
inline

Definition at line 141 of file sqcompiler.cpp.

◆ Lex()

void SQCompiler::Lex ( )
inline

Definition at line 73 of file sqcompiler.cpp.

◆ LocalDeclStatement()

void SQCompiler::LocalDeclStatement ( )
inline

Definition at line 842 of file sqcompiler.cpp.

◆ LogicalAndExp()

void SQCompiler::LogicalAndExp ( )
inline

Definition at line 437 of file sqcompiler.cpp.

References BitwiseOrExp().

◆ LogicalOrExp()

void SQCompiler::LogicalOrExp ( )
inline

Definition at line 419 of file sqcompiler.cpp.

◆ MoveIfCurrentTargetIsLocal()

void SQCompiler::MoveIfCurrentTargetIsLocal ( )
inline

Definition at line 149 of file sqcompiler.cpp.

◆ MultExp()

void SQCompiler::MultExp ( )
inline

Definition at line 515 of file sqcompiler.cpp.

References PrefixedExpr().

Referenced by PlusExp().

◆ NeedGet()

bool SQCompiler::NeedGet ( )
inline

Definition at line 757 of file sqcompiler.cpp.

References _exst.

◆ OptionalSemicolon()

void SQCompiler::OptionalSemicolon ( )
inline

Definition at line 142 of file sqcompiler.cpp.

◆ ParseTableOrClass()

void SQCompiler::ParseTableOrClass ( SQInteger  separator,
SQInteger  terminator = '}' 
)
inline

Definition at line 785 of file sqcompiler.cpp.

◆ PlusExp()

void SQCompiler::PlusExp ( )
inline

Definition at line 505 of file sqcompiler.cpp.

References MultExp().

Referenced by ShiftExp().

◆ PopExpState()

ExpState SQCompiler::PopExpState ( )
inline

Definition at line 83 of file sqcompiler.cpp.

◆ PrefixedExpr()

void SQCompiler::PrefixedExpr ( )
inline

Definition at line 525 of file sqcompiler.cpp.

References _exst, DEREF_FIELD, and DEREF_NO_DEREF.

Referenced by MultExp().

◆ PrefixIncDec()

void SQCompiler::PrefixIncDec ( SQInteger  token)
inline

Definition at line 1235 of file sqcompiler.cpp.

References ExpState::_deref, _exst, and DEREF_FIELD.

◆ PushExpState()

void SQCompiler::PushExpState ( )
inline

Definition at line 74 of file sqcompiler.cpp.

References ExpState::ExpState().

◆ ResolveBreaks()

void SQCompiler::ResolveBreaks ( SQFuncState *  funcstate,
SQInteger  ntoresolve 
)
inline

Definition at line 1319 of file sqcompiler.cpp.

◆ ResolveContinues()

void SQCompiler::ResolveContinues ( SQFuncState *  funcstate,
SQInteger  ntoresolve,
SQInteger  targetpos 
)
inline

Definition at line 1329 of file sqcompiler.cpp.

◆ ShiftExp()

void SQCompiler::ShiftExp ( )
inline

Definition at line 495 of file sqcompiler.cpp.

References PlusExp().

Referenced by CompExp().

◆ Statement()

void SQCompiler::Statement ( )
inline

Definition at line 199 of file sqcompiler.cpp.

◆ Statements()

void SQCompiler::Statements ( )
inline

Definition at line 192 of file sqcompiler.cpp.

◆ SwitchStatement()

void SQCompiler::SwitchStatement ( )
inline

Definition at line 1008 of file sqcompiler.cpp.

◆ ThrowError()

static void SQCompiler::ThrowError ( void *  ud,
const SQChar s 
)
inlinestatic

Definition at line 59 of file sqcompiler.cpp.

References Error().

◆ TryCatchStatement()

void SQCompiler::TryCatchStatement ( )
inline

Definition at line 1164 of file sqcompiler.cpp.

◆ UnaryOP()

void SQCompiler::UnaryOP ( SQOpcode  op)
inline

Definition at line 751 of file sqcompiler.cpp.

◆ WhileStatement()

void SQCompiler::WhileStatement ( )
inline

Definition at line 888 of file sqcompiler.cpp.

References BEGIN_BREAKBLE_BLOCK, and END_BREAKBLE_BLOCK.

Member Data Documentation

◆ _debugline

SQInteger SQCompiler::_debugline
private

Definition at line 1346 of file sqcompiler.cpp.

◆ _debugop

SQInteger SQCompiler::_debugop
private

Definition at line 1347 of file sqcompiler.cpp.

◆ _errorjmp

jmp_buf SQCompiler::_errorjmp
private

Definition at line 1350 of file sqcompiler.cpp.

◆ _expstates

ExpStateVec SQCompiler::_expstates
private

Definition at line 1348 of file sqcompiler.cpp.

◆ _fs

SQFuncState* SQCompiler::_fs
private

Definition at line 1341 of file sqcompiler.cpp.

◆ _lex

SQLexer SQCompiler::_lex
private

Definition at line 1343 of file sqcompiler.cpp.

◆ _lineinfo

bool SQCompiler::_lineinfo
private

Definition at line 1344 of file sqcompiler.cpp.

◆ _raiseerror

bool SQCompiler::_raiseerror
private

Definition at line 1345 of file sqcompiler.cpp.

◆ _sourcename

SQObjectPtr SQCompiler::_sourcename
private

Definition at line 1342 of file sqcompiler.cpp.

◆ _token

SQInteger SQCompiler::_token
private

Definition at line 1340 of file sqcompiler.cpp.

◆ _vm

SQVM* SQCompiler::_vm
private

Definition at line 1351 of file sqcompiler.cpp.

◆ compilererror

SQChar* SQCompiler::compilererror
private

Definition at line 1349 of file sqcompiler.cpp.


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