Pol  Rev 533
EScriptProgram Class Reference

#include <eprog.h>

+ Inheritance diagram for EScriptProgram:
+ Collaboration diagram for EScriptProgram:

List of all members.

Public Member Functions

 EScriptProgram ()
int _readToken (Token &token, unsigned position) const
int add_dbg_filename (const std::string &filename)
void add_ins_dbg_info ()
void addfunction (std::string name, unsigned firstPC, unsigned lastPC)
void addlocalvar (const std::string &localvarname)
void addToken (const Token &token)
void append (const StoredToken &stoken)
void append (const StoredToken &stoken, unsigned *posn)
void append (const StoredToken &stoken, const CompilerContext &ctx)
void append (const StoredToken &stoken, const CompilerContext &ctx, unsigned *posn)
void clear_modules ()
int create_instructions ()
std::string dbg_get_instruction (size_t atPC) const
void dump (std::ostream &os)
void dump_casejmp (std::ostream &os, const Token &token)
void enterblock ()
void enterfunction ()
void erase ()
void leaveblock ()
void leavefunction ()
unsigned parentvariables (unsigned parent)
int read (const char *fname)
int read_dbg_file ()
int read_exported_functions (FILE *fp, BSCRIPT_SECTION_HDR *hdr)
int read_globalvarnames (FILE *fp)
int read_module (FILE *fp)
int read_progdef_hdr (FILE *fp)
void setcontext (const CompilerContext &ctx)
void setstatementbegin ()
void update_dbg_pos (const Token &tkn)
unsigned varcount (unsigned block)
int write (const char *fname)
int write_dbg (const char *fname, bool gen_txt)

Public Attributes

vector< EPDbgBlockblocks
unsigned curblock
unsigned curfile
unsigned curline
vector< std::string > dbg_filenames
vector< unsigned > dbg_filenum
vector< EPDbgFunctiondbg_functions
vector< unsigned > dbg_ins_blocks
vector< bool > dbg_ins_statementbegin
vector< unsigned > dbg_linenum
bool debug_loaded
unsigned expectedArgs
vector< EPExportedFunctionexported_functions
vector< std::string > fileline
vector< std::string > function_decls
vector< std::string > globalvarnames
bool haveProgram
vector< Instructioninstr
u64 instr_cycles
unsigned int invocations
vector< FunctionalityModule * > modules
std::string name
unsigned nglobals
class Package const * pkg
std::string program_decl
unsigned program_PC
unsigned savecurblock
vector< std::string > sourcelines
bool statementbegin
SymbolContainer symbols
StoredTokenContainer tokens
unsigned short version

Private Member Functions

 ~EScriptProgram ()

Friends

class EScriptProgramCheckpoint
class ref_ptr< EScriptProgram >

Detailed Description

Definition at line 80 of file eprog.h.


Constructor & Destructor Documentation

Definition at line 69 of file eprog.cpp.

References delete_all(), escript_program_count, modules, and name.

+ Here is the call graph for this function:


Member Function Documentation

int EScriptProgram::add_dbg_filename ( const std::string &  filename)

Definition at line 506 of file eprog2.cpp.

References dbg_filenames.

Referenced by Compiler::compileFile(), Compiler::includeModule(), Compiler::read_function_declarations_in_included_file(), and Compiler::useModule().

+ Here is the caller graph for this function:

Definition at line 49 of file eprog2.cpp.

References StoredTokenContainer::count(), curblock, curfile, curline, dbg_filenum, dbg_ins_blocks, dbg_ins_statementbegin, dbg_linenum, passert, statementbegin, and tokens.

Referenced by addToken(), and append().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void EScriptProgram::addfunction ( std::string  name,
unsigned  firstPC,
unsigned  lastPC 
)

Definition at line 580 of file eprog2.cpp.

References dbg_functions, EPDbgFunction::firstPC, EPDbgFunction::lastPC, EPDbgFunction::name, and name.

Referenced by Compiler::handleBracketedFunction3().

+ Here is the caller graph for this function:

void EScriptProgram::append ( const StoredToken stoken,
unsigned *  posn 
)

Definition at line 72 of file eprog2.cpp.

References add_ins_dbg_info(), StoredTokenContainer::append_tok(), and tokens.

+ Here is the call graph for this function:

void EScriptProgram::append ( const StoredToken stoken,
const CompilerContext ctx 
)

Definition at line 79 of file eprog2.cpp.

References add_ins_dbg_info(), StoredTokenContainer::append_tok(), setcontext(), and tokens.

+ Here is the call graph for this function:

void EScriptProgram::append ( const StoredToken stoken,
const CompilerContext ctx,
unsigned *  posn 
)

Definition at line 88 of file eprog2.cpp.

References add_ins_dbg_info(), StoredTokenContainer::append_tok(), setcontext(), and tokens.

+ Here is the call graph for this function:

Definition at line 79 of file eprog.cpp.

References delete_all(), and modules.

Referenced by Compiler::read_function_declarations().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Definition at line 141 of file eprog_read.cpp.

References _readToken(), Instruction::func, Executor::GetInstrFunc(), instr, SymbolContainer::length(), Instruction::token, and tokens.

Referenced by read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string EScriptProgram::dbg_get_instruction ( size_t  atPC) const

Definition at line 522 of file eprog2.cpp.

References instr, OSTRINGSTREAM, and OSTRINGSTREAM_STR.

Referenced by DebugContext::cmd_scriptins().

+ Here is the caller graph for this function:

void EScriptProgram::dump ( std::ostream &  os)

Definition at line 14 of file eprog3.cpp.

References _readToken(), dump_casejmp(), exported_functions, fileline, function_decls, Token::id, INS_CASEJMP, SymbolContainer::length(), program_decl, program_PC, sourcelines, and tokens.

Referenced by Compiler::dump(), and DumpScript().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void EScriptProgram::dump_casejmp ( std::ostream &  os,
const Token token 
)

Definition at line 56 of file eprog3.cpp.

References CASE_TYPE_DEFAULT, CASE_TYPE_LONG, and Token::dataptr.

Referenced by dump().

+ Here is the caller graph for this function:

Definition at line 543 of file eprog2.cpp.

References blocks, curblock, EPDbgBlock::parentblockidx, EPDbgBlock::parentvariables, and varcount().

Referenced by Compiler::enterblock().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Definition at line 534 of file eprog2.cpp.

References curblock, and savecurblock.

Referenced by Compiler::handleBracketedFunction(), Compiler::handleBracketedFunction3(), Compiler::handleFunction(), and Compiler::handleProgram2().

+ Here is the caller graph for this function:

Definition at line 25 of file eprog2.cpp.

References blocks, dbg_filenum, dbg_functions, dbg_ins_blocks, dbg_ins_statementbegin, dbg_linenum, SymbolContainer::erase(), globalvarnames, nglobals, symbols, and tokens.

+ Here is the call graph for this function:

Definition at line 539 of file eprog2.cpp.

References curblock, and savecurblock.

Referenced by Compiler::handleBracketedFunction(), Compiler::handleBracketedFunction3(), Compiler::handleFunction(), and Compiler::handleProgram2().

+ Here is the caller graph for this function:

unsigned EScriptProgram::parentvariables ( unsigned  parent)

Definition at line 373 of file eprog2.cpp.

References blocks.

Definition at line 316 of file eprog_read.cpp.

References buffer, globalvarnames, BSCRIPT_GLOBALVARNAME_HDR::namelen, and BSCRIPT_GLOBALVARNAMES_HDR::nGlobalVars.

Referenced by read().

+ Here is the caller graph for this function:

int EScriptProgram::read_module ( FILE *  fp)

Definition at line 169 of file eprog_read.cpp.

References FunctionalityModule::addFunction(), BSCRIPT_MODULE_FUNCTION::funcname, BSCRIPT_MODULE_HDR::modulename, modules, BSCRIPT_MODULE_FUNCTION::nargs, and BSCRIPT_MODULE_HDR::nfuncs.

Referenced by read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Definition at line 158 of file eprog_read.cpp.

References BSCRIPT_PROGDEF_HDR::expectedArgs, expectedArgs, and haveProgram.

Referenced by read().

+ Here is the caller graph for this function:

Definition at line 59 of file eprog2.cpp.

References curfile, curline, CompilerContext::dbg_filenum, and CompilerContext::line.

Referenced by append(), and Compiler::getStatement().

+ Here is the caller graph for this function:

Definition at line 530 of file eprog2.cpp.

References statementbegin.

Referenced by Compiler::getStatement(), Compiler::handleBracketedIf(), Compiler::handleDoClause(), and Compiler::handleRepeatUntil().

+ Here is the caller graph for this function:

unsigned EScriptProgram::varcount ( unsigned  block)

Definition at line 364 of file eprog2.cpp.

References blocks.

Referenced by enterblock().

+ Here is the caller graph for this function:


Friends And Related Function Documentation

friend class EScriptProgramCheckpoint [friend]

Definition at line 166 of file eprog.h.

friend class ref_ptr< EScriptProgram > [friend]

Definition at line 168 of file eprog.h.


Member Data Documentation

Definition at line 138 of file eprog.h.

Referenced by add_ins_dbg_info(), setcontext(), and update_dbg_pos().

Definition at line 139 of file eprog.h.

Referenced by add_ins_dbg_info(), setcontext(), and update_dbg_pos().

Definition at line 98 of file eprog.h.

Referenced by Compiler::handleProgram2(), read_progdef_hdr(), and write().

vector<std::string> EScriptProgram::function_decls

Definition at line 119 of file eprog.h.

Referenced by dump(), and Compiler::handleBracketedFunction3().

Definition at line 92 of file eprog.h.

Referenced by erase(), read(), and Executor::setProgram().

Definition at line 118 of file eprog.h.

Referenced by dump(), and Compiler::handleProgram().

Definition at line 117 of file eprog.h.

Referenced by dump(), and Compiler::handleProgram2().

Definition at line 136 of file eprog.h.

Referenced by enterfunction(), and leavefunction().

unsigned short EScriptProgram::version

Definition at line 124 of file eprog.h.

Referenced by read(), and read_dbg_file().


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