Public Member Functions | Static Public Member Functions | Static Public Attributes

el7::scripting::parsing::Parser Class Reference

#include <Parser.h>

List of all members.

Public Member Functions

 Parser (VirtualMachine *vm)
 ~Parser (void)
VirtualMachineget_vm () const
const cl7::string_typeget_script_code () const
const std::vector< unsigned
long > * 
get_bytecode () const
bool parse (const cl7::string_type &script_code, bool log_parser_debug_info=false, bool log_builder_debug_info=false)
unsigned get_source_code_position (const cl7::string_type &script_code, unsigned code_ref, unsigned *line=NULL, unsigned *col=NULL) const

Static Public Member Functions

static bool is_whitespace (cl7::char_type chr)
static bool is_letter (cl7::char_type chr)
static bool is_digit (cl7::char_type chr)
static bool is_digitnz (cl7::char_type chr)
static bool is_idchr (cl7::char_type chr)
static cl7::string_type extract_identifier (const cl7::string_type &str, unsigned pos)

Static Public Attributes

static const cl7::char_type CH_NUL = TEXT('\0')
static const cl7::char_type CH_HT = TEXT('\t')
static const cl7::char_type CH_LF = TEXT('\n')
static const cl7::char_type CH_VT = TEXT('\v')
static const cl7::char_type CH_FF = TEXT('\f')
static const cl7::char_type CH_CR = TEXT('\r')
static const cl7::char_type CH_SPACE = TEXT(' ')
static const cl7::char_type CH_ESCAPE = TEXT('\\')
static const cl7::char_type CH_DOUBLE_QUOTE = TEXT('"')
static const cl7::char_type CH_SINGLE_QUOTE = TEXT('\'')
static const cl7::char_type CH_OPENING_ROUND = TEXT('(')
static const cl7::char_type CH_CLOSING_ROUND = TEXT(')')
static const cl7::char_type CH_OPENING_SQUARE = TEXT('[')
static const cl7::char_type CH_CLOSING_SQUARE = TEXT(']')
static const cl7::char_type CH_OPENING_CURLY = TEXT('{')
static const cl7::char_type CH_CLOSING_CURLY = TEXT('}')

Constructor & Destructor Documentation

el7::scripting::parsing::Parser::Parser ( VirtualMachine vm  ) 

Explicit constructor.

el7::scripting::parsing::Parser::~Parser ( void   ) 

Destructor.


Member Function Documentation

cl7::string_type el7::scripting::parsing::Parser::extract_identifier ( const cl7::string_type str,
unsigned  pos 
) [static]

Extracts the identifier at the specified character position of the given string.

const std::vector<unsigned long>* el7::scripting::parsing::Parser::get_bytecode (  )  const [inline]

Returns the generated (raw) bytecode.

const cl7::string_type& el7::scripting::parsing::Parser::get_script_code (  )  const [inline]

The original source code.

unsigned el7::scripting::parsing::Parser::get_source_code_position ( const cl7::string_type script_code,
unsigned  code_ref,
unsigned *  line = NULL,
unsigned *  col = NULL 
) const

Returns the position within the given script source code derived from the given reference position within the corresponding preprocessed code. Additionally, the line number and column of the source code position are stored into the parameters (if possible).

VirtualMachine* el7::scripting::parsing::Parser::get_vm (  )  const [inline]

Returns the virtual machine.

bool el7::scripting::parsing::Parser::is_digit ( cl7::char_type  chr  )  [static]
bool el7::scripting::parsing::Parser::is_digitnz ( cl7::char_type  chr  )  [static]
bool el7::scripting::parsing::Parser::is_idchr ( cl7::char_type  chr  )  [static]
bool el7::scripting::parsing::Parser::is_letter ( cl7::char_type  chr  )  [static]
bool el7::scripting::parsing::Parser::is_whitespace ( cl7::char_type  chr  )  [static]
bool el7::scripting::parsing::Parser::parse ( const cl7::string_type script_code,
bool  log_parser_debug_info = false,
bool  log_builder_debug_info = false 
)

Member Data Documentation

Closing curly bracket.

Closing round bracket.

Closing square bracket.

Carriage return (0x0d: 13).

Double quote.

Escape character.

Form feed (0x0c: 12).

Horizontal tab (0x09: 9).

Line feed (0x0a: 10).

Null character (0x00: 0).

Opening curly bracket.

Opening round bracket.

Opening square bracket.

Single quote.

Space (0x20: 32).

Vertical tab (0x0b: 11).


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines