Pol  Revision:cb584c9
Pol::Bscript Namespace Reference

Namespaces

 Pol
 

Classes

class  ArrayIterator
 
struct  BackupStruct
 
class  BApplicObj
 
class  BApplicObjBase
 
class  BApplicObjType
 
class  BApplicPtr
 
class  BBoolean
 
class  BDictionary
 
class  BDictionaryIterator
 
class  BError
 
class  BFunctionRef
 
struct  BlockDesc
 
class  BLong
 
class  BObject
 
class  BObjectImp
 
class  BObjectRef
 
struct  BSCRIPT_DBG_INSTRUCTION
 
struct  BSCRIPT_EXPORTED_FUNCTION
 
struct  BSCRIPT_FILE_HDR
 
struct  BSCRIPT_GLOBALVARNAME_HDR
 
struct  BSCRIPT_GLOBALVARNAMES_HDR
 
struct  BSCRIPT_MODULE_FUNCTION
 
struct  BSCRIPT_MODULE_HDR
 
struct  BSCRIPT_PROGDEF_HDR
 
struct  BSCRIPT_SECTION_HDR
 
class  BStruct
 
class  BStructIterator
 
struct  Candidate
 
class  Compiler
 
struct  CompilerConfig
 
class  CompilerContext
 
class  ConstString
 
class  ContIterator
 
struct  DebugToken
 
class  Double
 
struct  EPDbgBlock
 
struct  EPDbgFunction
 
struct  EPDbgInstr
 
struct  EPExportedFunction
 
struct  EScriptConfig
 
class  EScriptProgram
 
class  EScriptProgramCheckpoint
 
class  Executor
 
class  ExecutorModule
 
class  Expression
 
class  FunctionalityModule
 
class  Instruction
 
class  ModuleFunction
 
class  ObjArray
 
struct  ObjMember
 
struct  ObjMethod
 
class  objref_cmp
 
struct  Operator
 
class  Parser
 
struct  ReservedWord
 
struct  ReturnContext
 
class  Scope
 
class  SmartParser
 
class  StoredToken
 
class  StoredTokenContainer
 
class  String
 
class  SymbolContainer
 
class  TmplExecutorModule
 
class  Token
 
class  UninitObject
 
class  UserFunction
 
class  UserParam
 
struct  Variable
 
class  Verb
 

Typedefs

typedef std::vector< ref_ptr< BObjectImp > > BObjectImpRefVec
 
typedef std::unordered_map< unsigned int, BObjectImp * > bobjectimps
 
typedef std::vector< BObjectRefBObjectRefVec
 
typedef void(Executor::* ExecInstrFunc) (const Instruction &)
 
typedef BObject *(ExecutorModule::* ExecutorModuleFn) ()
 
typedef std::map< std::string, ReservedWord *, Clib::ci_cmp_predReservedWords
 
typedef std::vector< BObjectRefValueStackCont
 
typedef std::vector< VariableVariables
 

Enumerations

enum  BSCRIPT_SECTION {
  BSCRIPT_SECTION_MODULE = 1, BSCRIPT_SECTION_CODE = 2, BSCRIPT_SECTION_SYMBOLS = 3, BSCRIPT_SECTION_PROGDEF = 4,
  BSCRIPT_SECTION_GLOBALVARNAMES = 5, BSCRIPT_SECTION_EXPORTED_FUNCTIONS = 6
}
 
enum  BTokenId : u16 {
  TOK_LONG = 0x00, TOK_DOUBLE = 0x01, TOK_STRING = 0x02, TOK_IDENT = 0x03,
  TOK_ADD = 0x04, TOK_SUBTRACT = 0x05, TOK_MULT = 0x06, TOK_DIV = 0x07,
  TOK_ASSIGN = 0x08, INS_ASSIGN_CONSUME = 0x09, TOK_PLUSEQUAL = 0x0a, TOK_MINUSEQUAL = 0x0b,
  TOK_TIMESEQUAL = 0x0c, TOK_DIVIDEEQUAL = 0x0d, TOK_MODULUSEQUAL = 0x0e, TOK_INSERTINTO = 0x0f,
  TOK_LESSTHAN = 0x10, TOK_LESSEQ = 0x11, TOK_GRTHAN = 0x12, TOK_GREQ = 0x13,
  TOK_AND = 0x14, TOK_OR = 0x15, TOK_EQUAL = 0x16, TOK_NEQ = 0x17,
  TOK_UNPLUS = 0x18, TOK_UNMINUS = 0x19, TOK_LOG_NOT = 0x1a, TOK_BITWISE_NOT = 0x1b,
  TOK_CONSUMER = 0x1c, TOK_ARRAY_SUBSCRIPT = 0x1d, TOK_ADDMEMBER = 0x1e, TOK_DELMEMBER = 0x1f,
  TOK_CHKMEMBER = 0x20, CTRL_STATEMENTBEGIN = 0x21, CTRL_PROGEND = 0x22, CTRL_MAKELOCAL = 0x23,
  CTRL_JSR_USERFUNC = 0x24, INS_POP_PARAM = 0x25, CTRL_LEAVE_BLOCK = 0x26, RSV_JMPIFFALSE = 0x27,
  RSV_JMPIFTRUE = 0x28, RSV_GOTO = 0x29, RSV_RETURN = 0x2a, RSV_EXIT = 0x2b,
  RSV_LOCAL = 0x2c, RSV_GLOBAL = 0x2d, RSV_VAR = 0x2e, RSV_FUNCTION = 0x2f,
  INS_DECLARE_ARRAY = 0x30, TOK_FUNC = 0x31, TOK_USERFUNC = 0x32, TOK_ERROR = 0x33,
  TOK_IN = 0x34, TOK_LOCALVAR = 0x35, TOK_GLOBALVAR = 0x36, INS_INITFOREACH = 0x37,
  INS_STEPFOREACH = 0x38, INS_CASEJMP = 0x39, INS_GET_ARG = 0x3a, TOK_ARRAY = 0x3b,
  INS_CALL_METHOD = 0x3c, TOK_DICTIONARY = 0x3d, TOK_STACK = 0x3e, INS_INITFOR = 0x3f,
  INS_NEXTFOR = 0x40, TOK_REFTO = 0x41, INS_POP_PARAM_BYREF = 0x42, TOK_MODULUS = 0x43,
  TOK_BSLEFT = 0x44, TOK_BSRIGHT = 0x45, TOK_BITAND = 0x46, TOK_BITOR = 0x47,
  TOK_BITXOR = 0x48, TOK_STRUCT = 0x49, INS_SUBSCRIPT_ASSIGN = 0x4a, INS_SUBSCRIPT_ASSIGN_CONSUME = 0x4b,
  INS_MULTISUBSCRIPT = 0x4c, INS_MULTISUBSCRIPT_ASSIGN = 0x4d, INS_ASSIGN_LOCALVAR = 0x4e, INS_ASSIGN_GLOBALVAR = 0x4f,
  INS_GET_MEMBER = 0x50, INS_SET_MEMBER = 0x51, INS_SET_MEMBER_CONSUME = 0x52, INS_ADDMEMBER2 = 0x53,
  INS_ADDMEMBER_ASSIGN = 0x54, INS_UNINIT = 0x55, INS_DICTIONARY_ADDMEMBER = 0x56, INS_GET_MEMBER_ID = 0x57,
  INS_SET_MEMBER_ID = 0x58, INS_SET_MEMBER_ID_CONSUME = 0x59, INS_CALL_METHOD_ID = 0x5a, TOK_EQUAL1 = 0x5b,
  INS_SET_MEMBER_ID_CONSUME_PLUSEQUAL = 0x5c, INS_SET_MEMBER_ID_CONSUME_MINUSEQUAL = 0x5d, INS_SET_MEMBER_ID_CONSUME_TIMESEQUAL = 0x5e, INS_SET_MEMBER_ID_CONSUME_DIVIDEEQUAL = 0x5f,
  INS_SET_MEMBER_ID_CONSUME_MODULUSEQUAL = 0x60, TOK_FUNCREF = 0x61, TOK_SEMICOLON = 0x100, TOK_COMMA,
  TOK_LPAREN, TOK_RPAREN, TOK_TERM, TOK_LBRACKET,
  TOK_RBRACKET, TOK_LBRACE, TOK_RBRACE, RSV_FOREACH,
  RSV_ENDFOREACH, RSV_DECLARE, RSV_FUTURE, RSV_BREAK,
  RSV_CONTINUE, RSV_USE_MODULE, RSV_INCLUDE_FILE, RSV_FOR,
  RSV_NEXT, RSV_TO, RSV_STEP, RSV_THEN,
  RSV_ST_IF, RSV_ELSE, RSV_ELSEIF, RSV_ENDIF,
  RSV_GOSUB, RSV_BEGIN, RSV_ENDB, RSV_DO,
  RSV_WHILE, RSV_OPTION_BRACKETED, CTRL_LABEL, CTRL_NOTHING,
  RSV_CONST, RSV_ENDWHILE, RSV_REPEAT, RSV_UNTIL,
  RSV_ENDFOR, RSV_ENDFUNCTION, RSV_SWITCH, RSV_CASE,
  RSV_DEFAULT, RSV_ENDSWITCH, RSV_COLON, RSV_PROGRAM,
  RSV_ENDPROGRAM, RSV_ENUM, RSV_ENDENUM, RSV_EXPORTED,
  TOK_MEMBER, TOK_DICTKEY, RSV_DOWHILE, TOK_UNUSED
}
 
enum  BTokenType : u8 {
  TYP_TERMINATOR = 0x00, TYP_OPERAND = 0x01, TYP_OPERATOR = 0x02, TYP_UNARY_OPERATOR = 0x03,
  TYP_LEFTPAREN = 0x04, TYP_RIGHTPAREN = 0x05, TYP_LEFTBRACKET = 0x06, TYP_RIGHTBRACKET = 0x07,
  TYP_TESTMAX = TYP_RIGHTBRACKET, TYP_RESERVED = 0x08, TYP_LABEL = 0x09, TYP_FUNC = 0x10,
  TYP_METHOD = 0x1a, TYP_USERFUNC = 0x1b, TYP_SEPARATOR = 0x1c, TYP_DELIMITER = 0x1d,
  TYP_CONTROL = 0x1e, TYP_LEFTBRACE = 0x1f, TYP_RIGHTBRACE = 0x20, TYP_NUMTYPES = 0x21,
  TYP_FUNCREF = 0x22
}
 
enum  eb_break_ok { BreakOk = true, BreakNotOk = false }
 
enum  eb_continue_ok { ContinueOk = true, ContinueNotOk = false }
 
enum  eb_label_ok { CanBeLabelled = true, CanNotBeLabelled = false }
 
enum  ESCRIPT_CASE_TYPES : u8 { CASE_TYPE_LONG = 255, CASE_TYPE_DEFAULT = 254, CASE_STRING_MAXLEN = 253 }
 
enum  MemberID {
  MBR_X, MBR_Y, MBR_Z, MBR_NAME,
  MBR_OBJTYPE, MBR_GRAPHIC, MBR_SERIAL, MBR_COLOR,
  MBR_HEIGHT, MBR_FACING, MBR_DIRTY, MBR_WEIGHT,
  MBR_MULTI, MBR_AMOUNT, MBR_LAYER, MBR_CONTAINER,
  MBR_USESCRIPT, MBR_EQUIPSCRIPT, MBR_UNEQUIPSCRIPT, MBR_DESC,
  MBR_MOVABLE, MBR_INVISIBLE, MBR_DECAYAT, MBR_SELLPRICE,
  MBR_BUYPRICE, MBR_NEWBIE, MBR_ITEM_COUNT, MBR_WARMODE,
  MBR_GENDER, MBR_TRUEOBJTYPE, MBR_TRUECOLOR, MBR_AR_MOD,
  MBR_HIDDEN, MBR_CONCEALED, MBR_FROZEN, MBR_PARALYZED,
  MBR_POISONED, MBR_STEALTHSTEPS, MBR_SQUELCHED, MBR_DEAD,
  MBR_AR, MBR_BACKPACK, MBR_WEAPON, MBR_SHIELD,
  MBR_ACCTNAME, MBR_ACCT, MBR_CMDLEVEL, MBR_CMDLEVELSTR,
  MBR_CRIMINAL, MBR_IP, MBR_GOLD, MBR_TITLE_PREFIX,
  MBR_TITLE_SUFFIX, MBR_TITLE_GUILD, MBR_TITLE_RACE, MBR_GUILDID,
  MBR_GUILD, MBR_MURDERER, MBR_ATTACHED, MBR_CLIENTVERSION,
  MBR_REPORTABLES, MBR_SCRIPT, MBR_NPCTEMPLATE, MBR_MASTER,
  MBR_PROCESS, MBR_EVENTMASK, MBR_SPEECH_COLOR, MBR_SPEECH_FONT,
  MBR_USE_ADJUSTMENTS, MBR_RUN_SPEED, MBR_LOCKED, MBR_CORPSETYPE,
  MBR_TILLERMAN, MBR_PORTPLANK, MBR_STARBOARDPLANK, MBR_HOLD,
  MBR_HAS_OFFLINE_MOBILES, MBR_COMPONENTS, MBR_ITEMS, MBR_MOBILES,
  MBR_XEAST, MBR_XWEST, MBR_YNORTH, MBR_YSOUTH,
  MBR_GUMPWIDTH, MBR_GUMPHEIGHT, MBR_ISOPEN, MBR_QUALITY,
  MBR_HP, MBR_MAXHP_MOD, MBR_MAXHP, MBR_DMG_MOD,
  MBR_ATTRIBUTE, MBR_INTRINSIC, MBR_HITSCRIPT, MBR_AR_BASE,
  MBR_ONHIT_SCRIPT, MBR_ENABLED, MBR_BANNED, MBR_USERNAMEPASSWORDHASH,
  MBR_MEMBERS, MBR_ALLYGUILDS, MBR_ENEMYGUILDS, MBR_PID,
  MBR_STATE, MBR_INSTR_CYCLES, MBR_SLEEP_CYCLES, MBR_CONSEC_CYCLES,
  MBR_PC, MBR_CALL_DEPTH, MBR_NUM_GLOBALS, MBR_VAR_SIZE,
  MBR_REALM, MBR_UO_EXPANSION, MBR_CUSTOM, MBR_GLOBALS,
  MBR_FOOTPRINT, MBR_CLIENTINFO, MBR_DELAY_MOD, MBR_CREATEDAT,
  MBR_OPPONENT, MBR_CONNECTED, MBR_ATTACHED_TO, MBR_CONTROLLER,
  MBR_OWNERSERIAL, MBR_DEFAULTCMDLEVEL, MBR_UCLANG, MBR_RACE,
  MBR_TRADING_WITH, MBR_TRADE_CONTAINER, MBR_ALIGNMENT, MBR_CURSOR,
  MBR_GUMP, MBR_PROMPT, MBR_STACKABLE, MBR_MOVEMODE,
  MBR_HITCHANCE_MOD, MBR_EVASIONCHANCE_MOD, MBR_TILE_LAYER, MBR_CLIENTVERSIONDETAIL,
  MBR_SAVEONEXIT, MBR_FIRE_RESIST, MBR_COLD_RESIST, MBR_ENERGY_RESIST,
  MBR_POISON_RESIST, MBR_PHYSICAL_RESIST, MBR_FIRE_RESIST_MOD, MBR_COLD_RESIST_MOD,
  MBR_ENERGY_RESIST_MOD, MBR_POISON_RESIST_MOD, MBR_PHYSICAL_RESIST_MOD, MBR_STATCAP,
  MBR_SKILLCAP, MBR_LUCK, MBR_FOLLOWERSMAX, MBR_TITHING,
  MBR_FOLLOWERS, MBR_FIRE_DAMAGE, MBR_COLD_DAMAGE, MBR_ENERGY_DAMAGE,
  MBR_POISON_DAMAGE, MBR_PHYSICAL_DAMAGE, MBR_FIRE_DAMAGE_MOD, MBR_COLD_DAMAGE_MOD,
  MBR_ENERGY_DAMAGE_MOD, MBR_POISON_DAMAGE_MOD, MBR_PHYSICAL_DAMAGE_MOD, MBR_PARTY,
  MBR_LEADER, MBR_PARTYLOOT, MBR_CANDIDATE_OF_PARTY, MBR_CANDIDATES,
  MBR_MOVECOST_WALK, MBR_MOVECOST_RUN, MBR_MOVECOST_WALK_MOUNTED, MBR_MOVECOST_RUN_MOUNTED,
  MBR_AGGRESSORTO, MBR_LAWFULLYDAMAGED, MBR_GETGOTTENBY, MBR_UO_EXPANSION_CLIENT,
  MBR_CLIENTTYPE, MBR_DEAFENED, MBR_CLIENT, MBR_TYPE,
  MBR_ATTRIBUTES, MBR_EDITING, MBR_HOUSEPARTS, MBR_DOUBLECLICKRANGE,
  MBR_MOUNTEDSTEPS, MBR_ROPE, MBR_WHEEL, MBR_HULL,
  MBR_TILLER, MBR_RUDDER, MBR_SAILS, MBR_STORAGE,
  MBR_WEAPONSLOT, MBR_MULTIID, MBR_TRADEWINDOW, MBR_LASTCOORD,
  MBR_FACETID, MBR_EDITABLE, MBR_ACTIVE_SKILL, MBR_CASTING_SPELL,
  MBR_CARRYINGCAPACITY_MOD, MBR_MAX_ITEMS_MOD, MBR_MAX_WEIGHT_MOD, MBR_MAX_SLOTS_MOD,
  MBR_SPEED_MOD, MBR_NAME_SUFFIX, MBR_TEMPORALLY_CRIMINAL, MBR_LAST_TEXTCOLOR,
  MBR_INSURED, MBR_LAST_ACTIVITY_AT, MBR_LAST_PACKET_AT, MBR_HOUSE,
  MBR_SPECIFIC_NAME, MBR_CARRYINGCAPACITY, MBR_NO_DROP, MBR_NO_DROP_EXCEPTION,
  MBR_PORT
}
 
enum  MethodID {
  MTH_ISA, MTH_SET_MEMBER, MTH_GET_MEMBER, MTH_SETPOISONED,
  MTH_SETPARALYZED, MTH_SETCRIMINAL, MTH_SETLIGHTLEVEL, MTH_SQUELCH,
  MTH_ENABLE, MTH_DISABLE, MTH_ENABLED, MTH_SETCMDLEVEL,
  MTH_SPENDGOLD, MTH_SETMURDERER, MTH_REMOVEREPORTABLE, MTH_GETGOTTENITEM,
  MTH_CLEARGOTTENITEM, MTH_SETWARMODE, MTH_SETMASTER, MTH_MOVE_OFFLINE_MOBILES,
  MTH_SETCUSTOM, MTH_GETPINS, MTH_INSERTPIN, MTH_APPENDPIN,
  MTH_ERASEPIN, MTH_OPEN, MTH_CLOSE, MTH_TOGGLE,
  MTH_BAN, MTH_UNBAN, MTH_SETPASSWORD, MTH_CHECKPASSWORD,
  MTH_SETNAME, MTH_GETCHARACTER, MTH_DELETECHARACTER, MTH_GETPROP,
  MTH_SETPROP, MTH_ERASEPROP, MTH_PROPNAMES, MTH_ISMEMBER,
  MTH_ISALLYGUILD, MTH_ISENEMYGUILD, MTH_ADDMEMBER, MTH_ADDALLYGUILD,
  MTH_ADDENEMYGUILD, MTH_REMOVEMEMBER, MTH_REMOVEALLYGUILD, MTH_REMOVEENEMYGUILD,
  MTH_SIZE, MTH_ERASE, MTH_INSERT, MTH_SHRINK,
  MTH_APPEND, MTH_REVERSE, MTH_SORT, MTH_EXISTS,
  MTH_KEYS, MTH_SENDPACKET, MTH_SENDAREAPACKET, MTH_GETINT8,
  MTH_GETINT16, MTH_GETINT32, MTH_SETINT8, MTH_SETINT16,
  MTH_SETINT32, MTH_GETSTRING, MTH_GETUNICODESTRING, MTH_SETSTRING,
  MTH_SETUNICODESTRING, MTH_GETSIZE, MTH_SETSIZE, MTH_CREATEELEMENT,
  MTH_FINDELEMENT, MTH_DELETEELEMENT, MTH_SENDEVENT, MTH_KILL,
  MTH_LOADSYMBOLS, MTH_SET_UO_EXPANSION, MTH_CLEAR_EVENT_QUEUE, MTH_ADD_COMPONENT,
  MTH_ERASE_COMPONENT, MTH_DELETE, MTH_SPLIT, MTH_MOVE_CHAR,
  MTH_GETINT16FLIPPED, MTH_GETINT32FLIPPED, MTH_SETINT16FLIPPED, MTH_SETINT32FLIPPED,
  MTH_GETCORPSE, MTH_SETDEFAULTCMDLEVEL, MTH_PRIVILEGES, MTH_GETUNICODESTRINGFLIPPED,
  MTH_SETUNICODESTRINGFLIPPED, MTH_ADD_CHARACTER, MTH_SET_SWINGTIMER, MTH_ATTACK_ONCE,
  MTH_SETFACING, MTH_COMPAREVERSION, MTH_SETLEADER, MTH_ADDCANDIDATE,
  MTH_REMOVECANDIDATE, MTH_RANDOMENTRY, MTH_SEEK, MTH_PEEK,
  MTH_TELL, MTH_FLUSH, MTH_GETSINT8, MTH_GETSINT16,
  MTH_GETSINT32, MTH_SETSINT8, MTH_SETSINT16, MTH_SETSINT32,
  MTH_SETAGGRESSORTO, MTH_SETLAWFULLYDAMAGEDTO, MTH_CLEARAGGRESSORTO, MTH_CLEARLAWFULLYDAMAGEDTO,
  MTH_HASSPELL, MTH_SPELLS, MTH_REMOVESPELL, MTH_ADDSPELL,
  MTH_DEAF, MTH_SETSEASON, MTH_NEXTSIBLING, MTH_FIRSTCHILD,
  MTH_SAVEXML, MTH_APPENDNODE, MTH_SETDECLARATION, MTH_SETATTRIBUTE,
  MTH_REMOVEATTRIBUTE, MTH_REMOVENODE, MTH_APPENDTEXT, MTH_XMLTOSTRING,
  MTH_APPENDXMLCOMMENT, MTH_ADD_HOUSE_PART, MTH_ERASE_HOUSE_PART, MTH_ACCEPT_COMMIT,
  MTH_SPLITSTACK_AT, MTH_SPLITSTACK_INTO, MTH_CANCEL_EDITING, MTH_CLONENODE,
  MTH_HAS_EXISTING_STACK, MTH_LENGTH, MTH_JOIN, MTH_FIND,
  MTH_UPPER, MTH_LOWER, MTH_FORMAT, MTH_DISABLE_SKILLS_FOR,
  MTH_CYCLE, MTH_ADD_BUFF, MTH_DEL_BUFF, MTH_CLEAR_BUFFS,
  MTH_CALL, MTH_SORTEDINSERT
}
 
enum  ModuleID { Mod_Basic }
 
enum  ParseError {
  PERR_NONE, PERR_UNEXRPAREN, PERR_MISSLPAREN, PERR_MISSRPAREN,
  PERR_BADTOKEN, PERR_BADOPER, PERR_WAAH, PERR_UNTERMSTRING,
  PERR_INVESCAPE, PERR_TOOFEWARGS, PERR_TOOMANYARGS, PERR_UNEXPCOMMA,
  PERR_ILLEGALCONS, PERR_MISSINGDELIM, PERR_NOTLEGALHERE, PERR_PROCNOTALLOWED,
  PERR_UNEXPSEMI, PERR_EXPWHILE, PERR_UNEXRBRACKET, PERR_MISSRBRACKET,
  PERR_NUM_ERRORS
}
 
enum  Precedence {
  PREC_PAREN = 14, PREC_UNARY_OPS = 12, PREC_MULT = 11, PREC_PLUS = 10,
  PREC_LESSTHAN = 9, PREC_BSLEFT = 8, PREC_BSRIGHT = 8, PREC_BITAND = 8,
  PREC_BITXOR = 7, PREC_BITOR = 6, PREC_EQUALTO = 5, PREC_LOGAND = 4,
  PREC_LOGOR = 3, PREC_ASSIGN = 1, PREC_COMMA = 0, PREC_DEPRECATED = 0,
  PREC_TERMINATOR = -1
}
 

Functions

BObjectImpbobject_from_string (const std::string &str, int radix)
 
BObjectImpconvert_numeric (const std::string &str, int radix)
 
bool could_be_a_number (const char *s)
 
int display_bobjectimp_instance (BObjectImp *imp)
 
void display_bobjectimp_instances ()
 
void display_executor_instances ()
 
std::atomic< int > eobject_imp_constructions (0)
 
std::atomic< int > eobject_imp_count (0)
 
Precedence find_precedence (Token &token)
 
template<class T >
BApplicObj< T > * getApplicObjParam (ExecutorModule &ex, unsigned param, const BApplicObjType *object_type)
 
ObjMembergetKnownObjMember (const char *token)
 
ObjMethodgetKnownObjMethod (const char *token)
 
ObjMembergetObjMember (int id)
 
ObjMethodgetObjMethod (int id)
 
std::string getpathof (const std::string &fname)
 
static void init_tables ()
 
void int_to_binstr (int &value, std::stringstream &s)
 
bool is_web_script (const char *file)
 
int isInTable (Verb *table, int tableSize, const char *search, Verb **result)
 
void matchOperators (Operator *oplist, int n_ops, char *buf, int *nPartial, Operator **pTotalMatchOperator)
 
bool mismatched_end (const Token &token, BTokenId correct)
 
std::string normalize_ecl_filename (const std::string &filename)
 
std::ostream & operator<< (std::ostream &os, const BObject &obj)
 
fmt::Writer & operator<< (fmt::Writer &w, const BObject &obj)
 
std::ostream & operator<< (std::ostream &os, const BObjectImp &objimp)
 
fmt::Writer & operator<< (fmt::Writer &w, const BObjectImp &objimp)
 
std::ostream & operator<< (std::ostream &os, const CompilerContext &ctx)
 
fmt::Writer & operator<< (fmt::Writer &writer, const CompilerContext &ctx)
 
std::ostream & operator<< (std::ostream &out, const BTokenType &tok)
 
std::ostream & operator<< (std::ostream &out, const BTokenId &tok)
 
std::ostream & operator<< (std::ostream &os, const Token &tok)
 
fmt::Writer & operator<< (fmt::Writer &w, const Token &tok)
 
Tokenoptimize_double_operation (Token *left, Token *oper, Token *right)
 
Tokenoptimize_double_operation (Token *oper, Token *value)
 
Tokenoptimize_long_operation (Token *left, Token *oper, Token *right)
 
Tokenoptimize_long_operation (Token *oper, Token *value)
 
Tokenoptimize_string_operation (Token *left, Token *oper, Token *right)
 
Tokenoptimize_string_operation (Token *, Token *)
 
void preprocess_web_script (Clib::FileContents &fc)
 
bool s_parse_int (int &i, std::string const &s)
 
void s_trim (std::string &s)
 
void testparserdefinitions ()
 
bool try_to_format (std::stringstream &to_stream, BObjectImp *what, std::string &frmt)
 

Variables

int allowed_table [8][8]
 
Operator binary_operators []
 
Clib::fixed_allocator< sizeof(BLong), 256 > blong_alloc
 
Clib::fixed_allocator< sizeof(BObject), 256 > bobject_alloc
 
bobjectimps bobjectimp_instances
 
CompilerConfig compilercfg
 
Clib::fixed_allocator< sizeof(Double), 256 > double_alloc
 
std::atomic< int > eobject_imp_constructions
 
std::atomic< int > eobject_imp_count
 
EScriptConfig escript_config
 
int escript_execinstr_calls = 0
 
u64 escript_instr_cycles = 0
 
int escript_program_count = 0
 
int executor_count = 0
 
std::set< Executor * > executor_instances
 
const unsigned EXPR_FLAG_AUTO_TERM_ALLOWED = 0x0080
 
const unsigned EXPR_FLAG_COMMA_TERM_ALLOWED = 0x0002
 
const unsigned EXPR_FLAG_CONSUME_RESULT = 0x0100
 
const unsigned EXPR_FLAG_DICTKEY_TERM_ALLOWED = 0x0200
 
const unsigned EXPR_FLAG_ENDENUM_TERM_ALLOWED = 0x0010
 
const unsigned EXPR_FLAG_RIGHTBRACE_TERM_ALLOWED = 0x0020
 
const unsigned EXPR_FLAG_RIGHTPAREN_TERM_ALLOWED = 0x0004
 
const unsigned EXPR_FLAG_SEMICOLON_TERM_ALLOWED = 0x0001
 
const unsigned EXPR_FLAG_SINGLE_ELEMENT = 0x0008
 
const unsigned EXPR_FLAG_TO_TERM_ALLOWED = 0x0040
 
char ident_allowed []
 
int include_debug
 
int n_objmembers = sizeof object_members / sizeof object_members[0]
 
int n_objmethods = sizeof object_methods / sizeof object_methods[0]
 
int n_operators = sizeof binary_operators / sizeof binary_operators[0]
 
unsigned n_reserved = sizeof reserved_words / sizeof reserved_words[0]
 
int n_unary = sizeof unary_operators / sizeof unary_operators[0]
 
ObjMember object_members []
 
ObjMethod object_methods []
 
char operator_brk [] = "+-/*(),<=>,:;%"
 
const char * ParseErrorStr [PERR_NUM_ERRORS]
 
class Pol::Bscript::StoredToken POSTSTRUCT_PACK
 
ReservedWord reserved_words []
 
ReservedWords reservedWordsByName
 
Clib::UnitTest testparserdefinitions_obj (testparserdefinitions)
 
Operator unary_operators []
 
Clib::fixed_allocator< sizeof(UninitObject), 256 > uninit_alloc
 

Detailed Description

Bscript namespace is for escript stuff, like compiler and basic modules

Typedef Documentation

Definition at line 409 of file bobject.h.

typedef std::unordered_map<unsigned int, BObjectImp*> Pol::Bscript::bobjectimps

Definition at line 161 of file object.cpp.

Definition at line 21 of file exectype.h.

typedef void( Executor::* Pol::Bscript::ExecInstrFunc) (const Instruction &)

Definition at line 16 of file executortype.h.

typedef BObject*( ExecutorModule::* Pol::Bscript::ExecutorModuleFn) ()

Definition at line 39 of file execmodl.h.

Definition at line 913 of file parser.cpp.

Definition at line 51 of file executor.h.

typedef std::vector<Variable> Pol::Bscript::Variables

Definition at line 94 of file compiler.h.

Enumeration Type Documentation

Enumerator
BSCRIPT_SECTION_MODULE 
BSCRIPT_SECTION_CODE 
BSCRIPT_SECTION_SYMBOLS 
BSCRIPT_SECTION_PROGDEF 
BSCRIPT_SECTION_GLOBALVARNAMES 
BSCRIPT_SECTION_EXPORTED_FUNCTIONS 

Definition at line 61 of file filefmt.h.

The token ID: what this token is

This will be outputted on the compiled bytecode as 2nd byte. Tokens above 0xFF cannot be outputted and are used only internally by the compiler: please remember to allocate your new token in the upper space if it is not meant to be outputted.

Using hardcoded int conversion for better backward compatibility: every insertion in the middle of it done in the past shifted forward all the tokens, invalidating bytecode documentation.

Enumerator
TOK_LONG 
TOK_DOUBLE 
TOK_STRING 
TOK_IDENT 
TOK_ADD 
TOK_SUBTRACT 
TOK_MULT 
TOK_DIV 
TOK_ASSIGN 
INS_ASSIGN_CONSUME 
TOK_PLUSEQUAL 
TOK_MINUSEQUAL 
TOK_TIMESEQUAL 
TOK_DIVIDEEQUAL 
TOK_MODULUSEQUAL 
TOK_INSERTINTO 
TOK_LESSTHAN 
TOK_LESSEQ 
TOK_GRTHAN 
TOK_GREQ 
TOK_AND 
TOK_OR 
TOK_EQUAL 
TOK_NEQ 
TOK_UNPLUS 
TOK_UNMINUS 
TOK_LOG_NOT 
TOK_BITWISE_NOT 
TOK_CONSUMER 
TOK_ARRAY_SUBSCRIPT 
TOK_ADDMEMBER 
TOK_DELMEMBER 
TOK_CHKMEMBER 
CTRL_STATEMENTBEGIN 
CTRL_PROGEND 
CTRL_MAKELOCAL 
CTRL_JSR_USERFUNC 
INS_POP_PARAM 
CTRL_LEAVE_BLOCK 
RSV_JMPIFFALSE 
RSV_JMPIFTRUE 
RSV_GOTO 
RSV_RETURN 
RSV_EXIT 
RSV_LOCAL 
RSV_GLOBAL 
RSV_VAR 
RSV_FUNCTION 
INS_DECLARE_ARRAY 
TOK_FUNC 
TOK_USERFUNC 
TOK_ERROR 
TOK_IN 
TOK_LOCALVAR 
TOK_GLOBALVAR 
INS_INITFOREACH 
INS_STEPFOREACH 
INS_CASEJMP 
INS_GET_ARG 
TOK_ARRAY 
INS_CALL_METHOD 
TOK_DICTIONARY 
TOK_STACK 
INS_INITFOR 
INS_NEXTFOR 
TOK_REFTO 
INS_POP_PARAM_BYREF 
TOK_MODULUS 
TOK_BSLEFT 
TOK_BSRIGHT 
TOK_BITAND 
TOK_BITOR 
TOK_BITXOR 
TOK_STRUCT 
INS_SUBSCRIPT_ASSIGN 
INS_SUBSCRIPT_ASSIGN_CONSUME 
INS_MULTISUBSCRIPT 
INS_MULTISUBSCRIPT_ASSIGN 
INS_ASSIGN_LOCALVAR 
INS_ASSIGN_GLOBALVAR 
INS_GET_MEMBER 
INS_SET_MEMBER 
INS_SET_MEMBER_CONSUME 
INS_ADDMEMBER2 
INS_ADDMEMBER_ASSIGN 
INS_UNINIT 
INS_DICTIONARY_ADDMEMBER 
INS_GET_MEMBER_ID 
INS_SET_MEMBER_ID 
INS_SET_MEMBER_ID_CONSUME 
INS_CALL_METHOD_ID 
TOK_EQUAL1 
INS_SET_MEMBER_ID_CONSUME_PLUSEQUAL 
INS_SET_MEMBER_ID_CONSUME_MINUSEQUAL 
INS_SET_MEMBER_ID_CONSUME_TIMESEQUAL 
INS_SET_MEMBER_ID_CONSUME_DIVIDEEQUAL 
INS_SET_MEMBER_ID_CONSUME_MODULUSEQUAL 
TOK_FUNCREF 
TOK_SEMICOLON 
TOK_COMMA 
TOK_LPAREN 
TOK_RPAREN 
TOK_TERM 
TOK_LBRACKET 
TOK_RBRACKET 
TOK_LBRACE 
TOK_RBRACE 
RSV_FOREACH 
RSV_ENDFOREACH 
RSV_DECLARE 
RSV_FUTURE 
RSV_BREAK 
RSV_CONTINUE 
RSV_USE_MODULE 
RSV_INCLUDE_FILE 
RSV_FOR 
RSV_NEXT 
RSV_TO 
RSV_STEP 
RSV_THEN 
RSV_ST_IF 
RSV_ELSE 
RSV_ELSEIF 
RSV_ENDIF 
RSV_GOSUB 
RSV_BEGIN 
RSV_ENDB 
RSV_DO 
RSV_WHILE 
RSV_OPTION_BRACKETED 
CTRL_LABEL 
CTRL_NOTHING 
RSV_CONST 
RSV_ENDWHILE 
RSV_REPEAT 
RSV_UNTIL 
RSV_ENDFOR 
RSV_ENDFUNCTION 
RSV_SWITCH 
RSV_CASE 
RSV_DEFAULT 
RSV_ENDSWITCH 
RSV_COLON 
RSV_PROGRAM 
RSV_ENDPROGRAM 
RSV_ENUM 
RSV_ENDENUM 
RSV_EXPORTED 
TOK_MEMBER 
TOK_DICTKEY 
RSV_DOWHILE 
TOK_UNUSED 

Definition at line 82 of file tokens.h.

The token type

This also gets outputted to the compiled bytecode. Using hardcoded int conversion for better backward compatibility: every insertion in the middle of it done in the past shifted forward all the bytes

Note
20151229 Bodom This seems to be the first byte on the outputted bytecode, but not always. It looks like over time it also assumed different meaning, like saying the number of parameters in a method call. Type names may be out to date.
Enumerator
TYP_TERMINATOR 
TYP_OPERAND 
TYP_OPERATOR 
TYP_UNARY_OPERATOR 
TYP_LEFTPAREN 
TYP_RIGHTPAREN 
TYP_LEFTBRACKET 
TYP_RIGHTBRACKET 
TYP_TESTMAX 
TYP_RESERVED 
TYP_LABEL 
TYP_FUNC 
TYP_METHOD 
TYP_USERFUNC 
TYP_SEPARATOR 
TYP_DELIMITER 
TYP_CONTROL 
TYP_LEFTBRACE 
TYP_RIGHTBRACE 
TYP_NUMTYPES 
TYP_FUNCREF 

Definition at line 31 of file tokens.h.

Enumerator
BreakOk 
BreakNotOk 

Definition at line 56 of file compiler.h.

Enumerator
ContinueOk 
ContinueNotOk 

Definition at line 61 of file compiler.h.

Enumerator
CanBeLabelled 
CanNotBeLabelled 

Definition at line 51 of file compiler.h.

Enumerator
CASE_TYPE_LONG 
CASE_TYPE_DEFAULT 
CASE_STRING_MAXLEN 

Definition at line 287 of file tokens.h.

Enumerator
MBR_X 
MBR_Y 
MBR_Z 
MBR_NAME 
MBR_OBJTYPE 
MBR_GRAPHIC 
MBR_SERIAL 
MBR_COLOR 
MBR_HEIGHT 
MBR_FACING 
MBR_DIRTY 
MBR_WEIGHT 
MBR_MULTI 
MBR_AMOUNT 
MBR_LAYER 
MBR_CONTAINER 
MBR_USESCRIPT 
MBR_EQUIPSCRIPT 
MBR_UNEQUIPSCRIPT 
MBR_DESC 
MBR_MOVABLE 
MBR_INVISIBLE 
MBR_DECAYAT 
MBR_SELLPRICE 
MBR_BUYPRICE 
MBR_NEWBIE 
MBR_ITEM_COUNT 
MBR_WARMODE 
MBR_GENDER 
MBR_TRUEOBJTYPE 
MBR_TRUECOLOR 
MBR_AR_MOD 
MBR_HIDDEN 
MBR_CONCEALED 
MBR_FROZEN 
MBR_PARALYZED 
MBR_POISONED 
MBR_STEALTHSTEPS 
MBR_SQUELCHED 
MBR_DEAD 
MBR_AR 
MBR_BACKPACK 
MBR_WEAPON 
MBR_SHIELD 
MBR_ACCTNAME 
MBR_ACCT 
MBR_CMDLEVEL 
MBR_CMDLEVELSTR 
MBR_CRIMINAL 
MBR_IP 
MBR_GOLD 
MBR_TITLE_PREFIX 
MBR_TITLE_SUFFIX 
MBR_TITLE_GUILD 
MBR_TITLE_RACE 
MBR_GUILDID 
MBR_GUILD 
MBR_MURDERER 
MBR_ATTACHED 
MBR_CLIENTVERSION 
MBR_REPORTABLES 
MBR_SCRIPT 
MBR_NPCTEMPLATE 
MBR_MASTER 
MBR_PROCESS 
MBR_EVENTMASK 
MBR_SPEECH_COLOR 
MBR_SPEECH_FONT 
MBR_USE_ADJUSTMENTS 
MBR_RUN_SPEED 
MBR_LOCKED 
MBR_CORPSETYPE 
MBR_TILLERMAN 
MBR_PORTPLANK 
MBR_STARBOARDPLANK 
MBR_HOLD 
MBR_HAS_OFFLINE_MOBILES 
MBR_COMPONENTS 
MBR_ITEMS 
MBR_MOBILES 
MBR_XEAST 
MBR_XWEST 
MBR_YNORTH 
MBR_YSOUTH 
MBR_GUMPWIDTH 
MBR_GUMPHEIGHT 
MBR_ISOPEN 
MBR_QUALITY 
MBR_HP 
MBR_MAXHP_MOD 
MBR_MAXHP 
MBR_DMG_MOD 
MBR_ATTRIBUTE 
MBR_INTRINSIC 
MBR_HITSCRIPT 
MBR_AR_BASE 
MBR_ONHIT_SCRIPT 
MBR_ENABLED 
MBR_BANNED 
MBR_USERNAMEPASSWORDHASH 
MBR_MEMBERS 
MBR_ALLYGUILDS 
MBR_ENEMYGUILDS 
MBR_PID 
MBR_STATE 
MBR_INSTR_CYCLES 
MBR_SLEEP_CYCLES 
MBR_CONSEC_CYCLES 
MBR_PC 
MBR_CALL_DEPTH 
MBR_NUM_GLOBALS 
MBR_VAR_SIZE 
MBR_REALM 
MBR_UO_EXPANSION 
MBR_CUSTOM 
MBR_GLOBALS 
MBR_FOOTPRINT 
MBR_CLIENTINFO 
MBR_DELAY_MOD 
MBR_CREATEDAT 
MBR_OPPONENT 
MBR_CONNECTED 
MBR_ATTACHED_TO 
MBR_CONTROLLER 
MBR_OWNERSERIAL 
MBR_DEFAULTCMDLEVEL 
MBR_UCLANG 
MBR_RACE 
MBR_TRADING_WITH 
MBR_TRADE_CONTAINER 
MBR_ALIGNMENT 
MBR_CURSOR 
MBR_GUMP 
MBR_PROMPT 
MBR_STACKABLE 
MBR_MOVEMODE 
MBR_HITCHANCE_MOD 
MBR_EVASIONCHANCE_MOD 
MBR_TILE_LAYER 
MBR_CLIENTVERSIONDETAIL 
MBR_SAVEONEXIT 
MBR_FIRE_RESIST 
MBR_COLD_RESIST 
MBR_ENERGY_RESIST 
MBR_POISON_RESIST 
MBR_PHYSICAL_RESIST 
MBR_FIRE_RESIST_MOD 
MBR_COLD_RESIST_MOD 
MBR_ENERGY_RESIST_MOD 
MBR_POISON_RESIST_MOD 
MBR_PHYSICAL_RESIST_MOD 
MBR_STATCAP 
MBR_SKILLCAP 
MBR_LUCK 
MBR_FOLLOWERSMAX 
MBR_TITHING 
MBR_FOLLOWERS 
MBR_FIRE_DAMAGE 
MBR_COLD_DAMAGE 
MBR_ENERGY_DAMAGE 
MBR_POISON_DAMAGE 
MBR_PHYSICAL_DAMAGE 
MBR_FIRE_DAMAGE_MOD 
MBR_COLD_DAMAGE_MOD 
MBR_ENERGY_DAMAGE_MOD 
MBR_POISON_DAMAGE_MOD 
MBR_PHYSICAL_DAMAGE_MOD 
MBR_PARTY 
MBR_LEADER 
MBR_PARTYLOOT 
MBR_CANDIDATE_OF_PARTY 
MBR_CANDIDATES 
MBR_MOVECOST_WALK 
MBR_MOVECOST_RUN 
MBR_MOVECOST_WALK_MOUNTED 
MBR_MOVECOST_RUN_MOUNTED 
MBR_AGGRESSORTO 
MBR_LAWFULLYDAMAGED 
MBR_GETGOTTENBY 
MBR_UO_EXPANSION_CLIENT 
MBR_CLIENTTYPE 
MBR_DEAFENED 
MBR_CLIENT 
MBR_TYPE 
MBR_ATTRIBUTES 
MBR_EDITING 
MBR_HOUSEPARTS 
MBR_DOUBLECLICKRANGE 
MBR_MOUNTEDSTEPS 
MBR_ROPE 
MBR_WHEEL 
MBR_HULL 
MBR_TILLER 
MBR_RUDDER 
MBR_SAILS 
MBR_STORAGE 
MBR_WEAPONSLOT 
MBR_MULTIID 
MBR_TRADEWINDOW 
MBR_LASTCOORD 
MBR_FACETID 
MBR_EDITABLE 
MBR_ACTIVE_SKILL 
MBR_CASTING_SPELL 
MBR_CARRYINGCAPACITY_MOD 
MBR_MAX_ITEMS_MOD 
MBR_MAX_WEIGHT_MOD 
MBR_MAX_SLOTS_MOD 
MBR_SPEED_MOD 
MBR_NAME_SUFFIX 
MBR_TEMPORALLY_CRIMINAL 
MBR_LAST_TEXTCOLOR 
MBR_INSURED 
MBR_LAST_ACTIVITY_AT 
MBR_LAST_PACKET_AT 
MBR_HOUSE 
MBR_SPECIFIC_NAME 
MBR_CARRYINGCAPACITY 
MBR_NO_DROP 
MBR_NO_DROP_EXCEPTION 
MBR_PORT 

Definition at line 36 of file objmembers.h.

Enumerator
MTH_ISA 
MTH_SET_MEMBER 
MTH_GET_MEMBER 
MTH_SETPOISONED 
MTH_SETPARALYZED 
MTH_SETCRIMINAL 
MTH_SETLIGHTLEVEL 
MTH_SQUELCH 
MTH_ENABLE 
MTH_DISABLE 
MTH_ENABLED 
MTH_SETCMDLEVEL 
MTH_SPENDGOLD 
MTH_SETMURDERER 
MTH_REMOVEREPORTABLE 
MTH_GETGOTTENITEM 
MTH_CLEARGOTTENITEM 
MTH_SETWARMODE 
MTH_SETMASTER 
MTH_MOVE_OFFLINE_MOBILES 
MTH_SETCUSTOM 
MTH_GETPINS 
MTH_INSERTPIN 
MTH_APPENDPIN 
MTH_ERASEPIN 
MTH_OPEN 
MTH_CLOSE 
MTH_TOGGLE 
MTH_BAN 
MTH_UNBAN 
MTH_SETPASSWORD 
MTH_CHECKPASSWORD 
MTH_SETNAME 
MTH_GETCHARACTER 
MTH_DELETECHARACTER 
MTH_GETPROP 
MTH_SETPROP 
MTH_ERASEPROP 
MTH_PROPNAMES 
MTH_ISMEMBER 
MTH_ISALLYGUILD 
MTH_ISENEMYGUILD 
MTH_ADDMEMBER 
MTH_ADDALLYGUILD 
MTH_ADDENEMYGUILD 
MTH_REMOVEMEMBER 
MTH_REMOVEALLYGUILD 
MTH_REMOVEENEMYGUILD 
MTH_SIZE 
MTH_ERASE 
MTH_INSERT 
MTH_SHRINK 
MTH_APPEND 
MTH_REVERSE 
MTH_SORT 
MTH_EXISTS 
MTH_KEYS 
MTH_SENDPACKET 
MTH_SENDAREAPACKET 
MTH_GETINT8 
MTH_GETINT16 
MTH_GETINT32 
MTH_SETINT8 
MTH_SETINT16 
MTH_SETINT32 
MTH_GETSTRING 
MTH_GETUNICODESTRING 
MTH_SETSTRING 
MTH_SETUNICODESTRING 
MTH_GETSIZE 
MTH_SETSIZE 
MTH_CREATEELEMENT 
MTH_FINDELEMENT 
MTH_DELETEELEMENT 
MTH_SENDEVENT 
MTH_KILL 
MTH_LOADSYMBOLS 
MTH_SET_UO_EXPANSION 
MTH_CLEAR_EVENT_QUEUE 
MTH_ADD_COMPONENT 
MTH_ERASE_COMPONENT 
MTH_DELETE 
MTH_SPLIT 
MTH_MOVE_CHAR 
MTH_GETINT16FLIPPED 
MTH_GETINT32FLIPPED 
MTH_SETINT16FLIPPED 
MTH_SETINT32FLIPPED 
MTH_GETCORPSE 
MTH_SETDEFAULTCMDLEVEL 
MTH_PRIVILEGES 
MTH_GETUNICODESTRINGFLIPPED 
MTH_SETUNICODESTRINGFLIPPED 
MTH_ADD_CHARACTER 
MTH_SET_SWINGTIMER 
MTH_ATTACK_ONCE 
MTH_SETFACING 
MTH_COMPAREVERSION 
MTH_SETLEADER 
MTH_ADDCANDIDATE 
MTH_REMOVECANDIDATE 
MTH_RANDOMENTRY 
MTH_SEEK 
MTH_PEEK 
MTH_TELL 
MTH_FLUSH 
MTH_GETSINT8 
MTH_GETSINT16 
MTH_GETSINT32 
MTH_SETSINT8 
MTH_SETSINT16 
MTH_SETSINT32 
MTH_SETAGGRESSORTO 
MTH_SETLAWFULLYDAMAGEDTO 
MTH_CLEARAGGRESSORTO 
MTH_CLEARLAWFULLYDAMAGEDTO 
MTH_HASSPELL 
MTH_SPELLS 
MTH_REMOVESPELL 
MTH_ADDSPELL 
MTH_DEAF 
MTH_SETSEASON 
MTH_NEXTSIBLING 
MTH_FIRSTCHILD 
MTH_SAVEXML 
MTH_APPENDNODE 
MTH_SETDECLARATION 
MTH_SETATTRIBUTE 
MTH_REMOVEATTRIBUTE 
MTH_REMOVENODE 
MTH_APPENDTEXT 
MTH_XMLTOSTRING 
MTH_APPENDXMLCOMMENT 
MTH_ADD_HOUSE_PART 
MTH_ERASE_HOUSE_PART 
MTH_ACCEPT_COMMIT 
MTH_SPLITSTACK_AT 
MTH_SPLITSTACK_INTO 
MTH_CANCEL_EDITING 
MTH_CLONENODE 
MTH_HAS_EXISTING_STACK 
MTH_LENGTH 
MTH_JOIN 
MTH_FIND 
MTH_UPPER 
MTH_LOWER 
MTH_FORMAT 
MTH_DISABLE_SKILLS_FOR 
MTH_CYCLE 
MTH_ADD_BUFF 
MTH_DEL_BUFF 
MTH_CLEAR_BUFFS 
MTH_CALL 
MTH_SORTEDINSERT 

Definition at line 27 of file objmethods.h.

Enumerator
Mod_Basic 

Definition at line 13 of file modules.h.

Enumerator
PERR_NONE 
PERR_UNEXRPAREN 
PERR_MISSLPAREN 
PERR_MISSRPAREN 
PERR_BADTOKEN 
PERR_BADOPER 
PERR_WAAH 
PERR_UNTERMSTRING 
PERR_INVESCAPE 
PERR_TOOFEWARGS 
PERR_TOOMANYARGS 
PERR_UNEXPCOMMA 
PERR_ILLEGALCONS 
PERR_MISSINGDELIM 
PERR_NOTLEGALHERE 
PERR_PROCNOTALLOWED 
PERR_UNEXPSEMI 
PERR_EXPWHILE 
PERR_UNEXRBRACKET 
PERR_MISSRBRACKET 
PERR_NUM_ERRORS 

Definition at line 45 of file parser.h.

Enumerator
PREC_PAREN 
PREC_UNARY_OPS 
PREC_MULT 
PREC_PLUS 
PREC_LESSTHAN 
PREC_BSLEFT 
PREC_BSRIGHT 
PREC_BITAND 
PREC_BITXOR 
PREC_BITOR 
PREC_EQUALTO 
PREC_LOGAND 
PREC_LOGOR 
PREC_ASSIGN 
PREC_COMMA 
PREC_DEPRECATED 
PREC_TERMINATOR 

Definition at line 15 of file operator.h.

Function Documentation

BObjectImp * Pol::Bscript::bobject_from_string ( const std::string &  str,
int  radix 
)
BObjectImp* Pol::Bscript::convert_numeric ( const std::string &  str,
int  radix 
)

Definition at line 59 of file escrutil.cpp.

References could_be_a_number().

Referenced by bobject_from_string().

bool Pol::Bscript::could_be_a_number ( const char *  s)

Definition at line 22 of file escrutil.cpp.

Referenced by convert_numeric().

int Pol::Bscript::display_bobjectimp_instance ( BObjectImp imp)
void Pol::Bscript::display_executor_instances ( )
std::atomic<int> Pol::Bscript::eobject_imp_constructions ( )
std::atomic<int> Pol::Bscript::eobject_imp_count ( )
Precedence Pol::Bscript::find_precedence ( Token token)

Definition at line 1427 of file parser.cpp.

References Pol::Bscript::Token::precedence.

Referenced by Pol::Bscript::SmartParser::parseToken().

template<class T >
BApplicObj<T>* Pol::Bscript::getApplicObjParam ( ExecutorModule ex,
unsigned  param,
const BApplicObjType object_type 
)
ObjMember * Pol::Bscript::getKnownObjMember ( const char *  token)

Definition at line 483 of file parser.cpp.

References Pol::Bscript::ObjMember::code, and n_objmembers.

Referenced by Pol::Core::BPacket::get_member(), Pol::Core::ScriptExObjImp::get_member(), Pol::Accounts::AccountObjImp::get_member(), Pol::Core::BXMLfile::get_member(), Pol::Module::EPartyRefObjImp::get_member(), Pol::Module::EGuildRefObjImp::get_member(), Pol::Core::BBinaryfile::get_member(), Pol::Module::ECharacterRefObjImp::get_member(), Pol::Core::BXmlNode::get_member(), Pol::Core::BSQLConnection::get_member(), Pol::Module::EItemRefObjImp::get_member(), Pol::Module::EUBoatRefObjImp::get_member(), Pol::Module::EMultiRefObjImp::get_member(), Pol::Module::EClientRefObjImp::get_member(), Pol::Core::ULockable::get_script_member(), Pol::Core::UDoor::get_script_member(), Pol::Multi::UPlank::get_script_member(), Pol::Items::Equipment::get_script_member(), Pol::Items::UArmor::get_script_member(), Pol::Core::UCorpse::get_script_member(), Pol::Multi::UMulti::get_script_member(), Pol::Core::Map::get_script_member(), Pol::Items::UWeapon::get_script_member(), Pol::Mobile::NPC::get_script_member(), Pol::Multi::UHouse::get_script_member(), Pol::Core::UContainer::get_script_member(), Pol::Core::UObject::get_script_member(), Pol::Multi::UBoat::get_script_member(), Pol::Items::Item::get_script_member(), Pol::Mobile::Character::get_script_member(), Pol::Bscript::Expression::optimize_token(), Pol::Module::ECharacterRefObjImp::set_member(), Pol::Module::EItemRefObjImp::set_member(), Pol::Module::EUBoatRefObjImp::set_member(), Pol::Module::EMultiRefObjImp::set_member(), Pol::Module::EClientRefObjImp::set_member(), Pol::Core::ULockable::set_script_member(), Pol::Items::UArmor::set_script_member(), Pol::Items::Equipment::set_script_member(), Pol::Core::Map::set_script_member(), Pol::Items::UWeapon::set_script_member(), Pol::Mobile::NPC::set_script_member(), Pol::Core::UContainer::set_script_member(), Pol::Core::UObject::set_script_member(), Pol::Items::Item::set_script_member(), Pol::Mobile::Character::set_script_member(), Pol::Items::Equipment::set_script_member_double(), Pol::Items::UWeapon::set_script_member_double(), Pol::Core::UObject::set_script_member_double(), and Pol::Items::Item::set_script_member_double().

ObjMethod * Pol::Bscript::getKnownObjMethod ( const char *  token)

Definition at line 666 of file parser.cpp.

References Pol::Bscript::ObjMethod::code, and n_objmethods.

Referenced by Pol::Core::ScriptExObjImp::call_method(), Pol::Core::BPacket::call_method(), Pol::Accounts::AccountObjImp::call_method(), Pol::Core::BXMLfile::call_method(), Pol::Bscript::BDictionary::call_method(), Pol::Module::EPartyRefObjImp::call_method(), Pol::Bscript::BStruct::call_method(), Pol::Module::EGuildRefObjImp::call_method(), Pol::Module::ECharacterRefObjImp::call_method(), Pol::Core::BBinaryfile::call_method(), Pol::Module::DataFileRefObjImp::call_method(), Pol::Core::BXmlNode::call_method(), Pol::Bscript::String::call_method(), Pol::Module::EItemRefObjImp::call_method(), Pol::Core::BSQLConnection::call_method(), Pol::Core::BXmlAttribute::call_method(), Pol::Module::EUBoatRefObjImp::call_method(), Pol::Module::EMultiRefObjImp::call_method(), Pol::Module::EClientRefObjImp::call_method(), Pol::Bscript::ObjArray::call_method(), Pol::Bscript::BFunctionRef::call_method(), Pol::Core::CallPropertyListMethod(), Pol::Core::UObject::custom_script_method(), Pol::Bscript::SmartParser::IIP(), Pol::Bscript::EScriptProgram::read_exported_functions(), Pol::Core::UDoor::script_method(), Pol::Core::Spellbook::script_method(), Pol::Core::Map::script_method(), Pol::Mobile::NPC::script_method(), Pol::Multi::UHouse::script_method(), Pol::Core::UObject::script_method(), Pol::Multi::UBoat::script_method(), Pol::Items::Item::script_method(), Pol::Mobile::Character::script_method(), and Pol::Bscript::BFunctionRef::validCall().

static void Pol::Bscript::init_tables ( )
static

Definition at line 915 of file parser.cpp.

References n_reserved, and Pol::Bscript::ReservedWord::word.

Referenced by Pol::Bscript::Parser::Parser().

void Pol::Bscript::int_to_binstr ( int &  value,
std::stringstream &  s 
)

Definition at line 629 of file str.cpp.

Referenced by try_to_format().

bool Pol::Bscript::is_web_script ( const char *  file)

Given a file name, tells if this is a web script

Definition at line 5285 of file compiler.cpp.

Referenced by Pol::Bscript::Compiler::compileFile().

int Pol::Bscript::isInTable ( Verb table,
int  tableSize,
const char *  search,
Verb **  result 
)
void Pol::Bscript::matchOperators ( Operator oplist,
int  n_ops,
char *  buf,
int *  nPartial,
Operator **  pTotalMatchOperator 
)
bool Pol::Bscript::mismatched_end ( const Token token,
BTokenId  correct 
)
std::string Pol::Bscript::normalize_ecl_filename ( const std::string &  filename)

Definition at line 135 of file escrutil.cpp.

Referenced by Pol::Core::full_scriptname().

std::ostream& Pol::Bscript::operator<< ( std::ostream &  os,
const BObject obj 
)
fmt::Writer& Pol::Bscript::operator<< ( fmt::Writer &  w,
const BObject obj 
)
std::ostream& Pol::Bscript::operator<< ( std::ostream &  os,
const BObjectImp objimp 
)

Definition at line 30 of file objstrm.cpp.

References Pol::Bscript::BObjectImp::printOn().

fmt::Writer& Pol::Bscript::operator<< ( fmt::Writer &  w,
const BObjectImp objimp 
)

Definition at line 35 of file objstrm.cpp.

References Pol::Bscript::BObjectImp::printOn().

std::ostream& Pol::Bscript::operator<< ( std::ostream &  os,
const CompilerContext ctx 
)
inline

Definition at line 54 of file compctx.h.

References Pol::Bscript::CompilerContext::printOn().

Referenced by Pol::Bscript::Token::tokval().

fmt::Writer& Pol::Bscript::operator<< ( fmt::Writer &  writer,
const CompilerContext ctx 
)
inline

Definition at line 60 of file compctx.h.

References Pol::Bscript::CompilerContext::printOn().

std::ostream& Pol::Bscript::operator<< ( std::ostream &  out,
const BTokenType tok 
)
inline

Definition at line 65 of file tokens.h.

std::ostream& Pol::Bscript::operator<< ( std::ostream &  out,
const BTokenId tok 
)
inline

Definition at line 282 of file tokens.h.

std::ostream & Pol::Bscript::operator<< ( std::ostream &  os,
const Token tok 
)

Definition at line 466 of file tkn_strm.cpp.

References Pol::Bscript::Token::printOn().

fmt::Writer & Pol::Bscript::operator<< ( fmt::Writer &  w,
const Token tok 
)

Definition at line 472 of file tkn_strm.cpp.

References Pol::Bscript::Token::printOn().

Token* Pol::Bscript::optimize_double_operation ( Token left,
Token oper,
Token right 
)
Token* Pol::Bscript::optimize_double_operation ( Token oper,
Token value 
)

Definition at line 345 of file compiler.cpp.

References Pol::Bscript::Token::dval, Pol::Bscript::Token::id, and TOK_UNMINUS.

Token* Pol::Bscript::optimize_long_operation ( Token oper,
Token value 
)
Token* Pol::Bscript::optimize_string_operation ( Token left,
Token oper,
Token right 
)
Token* Pol::Bscript::optimize_string_operation ( Token ,
Token  
)

Definition at line 360 of file compiler.cpp.

void Pol::Bscript::preprocess_web_script ( Clib::FileContents fc)

Transforms the raw html page into a script with a single WriteHtml() instruction

Definition at line 5299 of file compiler.cpp.

References Pol::Clib::FileContents::contents(), and Pol::Clib::FileContents::set_contents().

Referenced by Pol::Bscript::Compiler::compileFile().

bool Pol::Bscript::s_parse_int ( int &  i,
std::string const &  s 
)

Definition at line 602 of file str.cpp.

Referenced by Pol::Bscript::String::call_method_id().

void Pol::Bscript::s_trim ( std::string &  s)

Definition at line 621 of file str.cpp.

void Pol::Bscript::testparserdefinitions ( )
bool Pol::Bscript::try_to_format ( std::stringstream &  to_stream,
BObjectImp what,
std::string &  frmt 
)

Variable Documentation

int Pol::Bscript::allowed_table[8][8]
Initial value:
= {
{1, 1, 0, 1, 1, 0, 0, 0},
{1, 0, 1, 0, 0, 1, 1, 1},
{0, 1, 0, 1, 1, 0, 0, 0},
{0, 1, 0, 0, 1, 0, 0, 0},
{0, 1, 0, 1, 1, 0, 0, 0},
{1, 0, 1, 0, 0, 1, 0, 1},
{0, 1, 0, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 0, 1, 1, 1},
}

Definition at line 111 of file parser.cpp.

Operator Pol::Bscript::binary_operators[]

Definition at line 189 of file parser.cpp.

Clib::fixed_allocator< sizeof(BLong), 256 > Pol::Bscript::blong_alloc

Definition at line 44 of file object.cpp.

Referenced by Pol::Module::PolCore::call_method().

Clib::fixed_allocator< sizeof(BObject), 256 > Pol::Bscript::bobject_alloc

Definition at line 42 of file object.cpp.

Referenced by Pol::Module::PolCore::call_method().

bobjectimps Pol::Bscript::bobjectimp_instances

Definition at line 164 of file object.cpp.

Clib::fixed_allocator< sizeof(Double), 256 > Pol::Bscript::double_alloc

Definition at line 45 of file object.cpp.

Referenced by Pol::Module::PolCore::call_method().

std::atomic<int> Pol::Bscript::eobject_imp_constructions
int Pol::Bscript::escript_execinstr_calls = 0

Definition at line 23 of file escriptv.cpp.

Referenced by Pol::Clib::RunEclMain::runeclScript().

u64 Pol::Bscript::escript_instr_cycles = 0
int Pol::Bscript::escript_program_count = 0
std::set<Executor*> Pol::Bscript::executor_instances

Definition at line 55 of file executor.cpp.

const unsigned Pol::Bscript::EXPR_FLAG_AUTO_TERM_ALLOWED = 0x0080
const unsigned Pol::Bscript::EXPR_FLAG_CONSUME_RESULT = 0x0100
const unsigned Pol::Bscript::EXPR_FLAG_DICTKEY_TERM_ALLOWED = 0x0200
const unsigned Pol::Bscript::EXPR_FLAG_ENDENUM_TERM_ALLOWED = 0x0010
const unsigned Pol::Bscript::EXPR_FLAG_RIGHTBRACE_TERM_ALLOWED = 0x0020
const unsigned Pol::Bscript::EXPR_FLAG_SINGLE_ELEMENT = 0x0008
const unsigned Pol::Bscript::EXPR_FLAG_TO_TERM_ALLOWED = 0x0040
char Pol::Bscript::ident_allowed[]
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789"
"_"

Definition at line 104 of file parser.cpp.

int Pol::Bscript::include_debug

Definition at line 30 of file eprog2.cpp.

Referenced by Pol::ECompile::readargs().

int Pol::Bscript::n_objmembers = sizeof object_members / sizeof object_members[0]
int Pol::Bscript::n_objmethods = sizeof object_methods / sizeof object_methods[0]
int Pol::Bscript::n_operators = sizeof binary_operators / sizeof binary_operators[0]
unsigned Pol::Bscript::n_reserved = sizeof reserved_words / sizeof reserved_words[0]

Definition at line 911 of file parser.cpp.

Referenced by init_tables(), and Pol::Bscript::Parser::write_words().

int Pol::Bscript::n_unary = sizeof unary_operators / sizeof unary_operators[0]
ObjMember Pol::Bscript::object_members

Definition at line 256 of file parser.cpp.

ObjMethod Pol::Bscript::object_methods

Definition at line 509 of file parser.cpp.

char Pol::Bscript::operator_brk[] = "+-/*(),<=>,:;%"

Definition at line 102 of file parser.cpp.

const char * Pol::Bscript::ParseErrorStr
Initial value:
= {"(No Error, or not specified)",
"Unexpected ')'",
"Missing '('",
"Missing ')'",
"Bad Token",
"Unknown Operator",
"Waaah!",
"Unterminated String Literal",
"Invalid escape sequence in String",
"Too Few Arguments",
"Too Many Arguments",
"Unexpected Comma",
"Illegal Construction",
"Missing ';'",
"Token not legal here",
"Procedure calls not allowed here",
"Unexpected Semicolon",
"Expected 'while'",
"Unexpected ']'",
"Missing ']'"}

Definition at line 82 of file parser.cpp.

Referenced by Pol::Bscript::Compiler::compileContext().

class Pol::Bscript::StoredToken Pol::Bscript::POSTSTRUCT_PACK
ReservedWord Pol::Bscript::reserved_words[]

Definition at line 810 of file parser.cpp.

ReservedWords Pol::Bscript::reservedWordsByName

Definition at line 914 of file parser.cpp.

Clib::UnitTest Pol::Bscript::testparserdefinitions_obj(testparserdefinitions)

Referenced by testparserdefinitions().

Clib::fixed_allocator< sizeof(UninitObject), 256 > Pol::Bscript::uninit_alloc