Yate
|
Javascript parser. More...
#include <yatescript.h>
Public Member Functions | |
virtual bool | parse (const char *text, bool fragment=false) |
virtual ScriptContext * | createContext () const |
virtual ScriptRun * | createRunner (ScriptCode *code, ScriptContext *context=0) const |
ScriptRun * | createRunner (ScriptContext *context=0) const |
void | adjustPath (String &script) |
const String & | basePath () const |
void | basePath (const char *path) |
Static Public Member Functions | |
static ScriptRun::Status | eval (const String &text, ExpOperation **result=0, ScriptContext *context=0) |
Javascript parser.
Javascript parser, takes source code and generates preparsed code
void adjustPath | ( | String & | script | ) |
Adjust a file script path to include default if needed
script | File path to adjust |
Retrieve the base script path
void basePath | ( | const char * | path | ) | [inline] |
Set the pase script path
path | Base path to add to relative script paths |
virtual ScriptContext* createContext | ( | ) | const [virtual] |
Create a context adequate for Javascript code
Reimplemented from ScriptParser.
virtual ScriptRun* createRunner | ( | ScriptCode * | code, |
ScriptContext * | context = 0 |
||
) | const [virtual] |
Create a runner adequate for a block of parsed Javascript code
code | Parsed code block |
context | Javascript context, an empty one will be allocated if NULL |
Reimplemented from ScriptParser.
ScriptRun* createRunner | ( | ScriptContext * | context = 0 | ) | const [inline] |
Create a runner adequate for the parsed Javascript code
context | Javascript context, an empty one will be allocated if NULL |
Reimplemented from ScriptParser.
References JsParser::createRunner().
Referenced by JsParser::createRunner().
static ScriptRun::Status eval | ( | const String & | text, |
ExpOperation ** | result = 0 , |
||
ScriptContext * | context = 0 |
||
) | [static] |
Parse and run a piece of Javascript code
text | Source code fragment to execute |
result | Pointer to an optional pointer to store returned value |
context | Script context, an empty one will be allocated if NULL |
virtual bool parse | ( | const char * | text, |
bool | fragment = false |
||
) | [virtual] |
Parse a string as Javascript source code
text | Source code text |
fragment | True if the code is just an included fragment |
Implements ScriptParser.