class ScriptParser

Abstract script parser. More...

Contains pure virtuals
Full nameTelEngine::ScriptParser
Definition#include <libs/yscript/yatescript.h>
InheritsTelEngine::GenObject [public ]
Inherited byJsParser
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods


Detailed Description

Abstract parser, base class for each language parser

 ~ScriptParser ()

~ScriptParser

[virtual]

Destructor, releases code

bool  parse (const char* text, bool fragment = false, const char* file = 0, int len = -1)

parse

[pure virtual]

Parse a string as script source code

Parameters:
textSource code text
fragmentTrue if the code is just an included fragment
fileName of the file that is being parsed
lenLength of text, negative if unknown

Returns: True if the text was successfully parsed

bool  parseFile (const char* name, bool fragment = false)

parseFile

[virtual]

Parse a file as script source code

Parameters:
nameSource file name
fragmentTrue if the code is just an included fragment

Returns: True if the file was successfully parsed

inline void  clear ()

clear

Clear any existing parsed code

inline ScriptCode*  code ()

code

[const]

Retrieve the currently stored parsed code

Returns: Parsed code block, may be NULL

ScriptContext*  createContext ()

createContext

[const virtual]

Create a context adequate for the parsed code

Returns: A new script context

ScriptRun*  createRunner (ScriptCode* code, ScriptContext* context = 0, const char* title = 0)

createRunner

[const virtual]

Create a runner adequate for a block of parsed code

Parameters:
codeParsed code block
contextScript context, an empty one will be allocated if NULL
titleAn optional name for the runner

Returns: A new script runner, NULL if code is NULL

inline ScriptRun*  createRunner (ScriptContext* context = 0, const char* title = 0)

createRunner

[const]

Create a runner adequate for the parsed code

Parameters:
contextScript context, an empty one will be allocated if NULL
titleAn optional name for the runner

Returns: A new script runner, NULL if code is not yet parsed

bool  callable (const String& name)

callable

[virtual]

Check if a script has a certain function or method

Parameters:
nameName of the function to check

Returns: True if function exists in code

inline  ScriptParser ()

ScriptParser

[protected]

Default constructor for derived classes

void  setCode (ScriptCode* code)

setCode

[protected]

Set the just parsed block of code

Parameters:
codeParsed code block, may be NULL


Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.