My Project
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
NPLMono.NPLLex Class Reference

lexer for NPL files. More...

Classes

class  LexState
 
class  SemInfo
 
class  Token
 
class  Zio
 

Public Types

enum  RESERVED {
  TK_AND = FIRST_RESERVED, TK_BREAK, TK_DO, TK_ELSE,
  TK_ELSEIF, TK_END, TK_FALSE, TK_FOR,
  TK_FUNCTION, TK_IF, TK_IN, TK_LOCAL,
  TK_NIL, TK_NOT, TK_OR, TK_REPEAT,
  TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL,
  TK_WHILE, TK_NAME, TK_CONCAT, TK_DOTS,
  TK_EQ, TK_GE, TK_LE, TK_NE,
  TK_NUMBER, TK_STRING, TK_EOS, TK_AND = FIRST_RESERVED,
  TK_BREAK, TK_DO, TK_ELSE, TK_ELSEIF,
  TK_END, TK_FALSE, TK_FOR, TK_FUNCTION,
  TK_IF, TK_IN, TK_LOCAL, TK_NIL,
  TK_NOT, TK_OR, TK_REPEAT, TK_RETURN,
  TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE,
  TK_NAME, TK_CONCAT, TK_DOTS, TK_EQ,
  TK_GE, TK_LE, TK_NE, TK_NUMBER,
  TK_STRING, TK_EOS
}
 
enum  RESERVED {
  TK_AND = FIRST_RESERVED, TK_BREAK, TK_DO, TK_ELSE,
  TK_ELSEIF, TK_END, TK_FALSE, TK_FOR,
  TK_FUNCTION, TK_IF, TK_IN, TK_LOCAL,
  TK_NIL, TK_NOT, TK_OR, TK_REPEAT,
  TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL,
  TK_WHILE, TK_NAME, TK_CONCAT, TK_DOTS,
  TK_EQ, TK_GE, TK_LE, TK_NE,
  TK_NUMBER, TK_STRING, TK_EOS, TK_AND = FIRST_RESERVED,
  TK_BREAK, TK_DO, TK_ELSE, TK_ELSEIF,
  TK_END, TK_FALSE, TK_FOR, TK_FUNCTION,
  TK_IF, TK_IN, TK_LOCAL, TK_NIL,
  TK_NOT, TK_OR, TK_REPEAT, TK_RETURN,
  TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE,
  TK_NAME, TK_CONCAT, TK_DOTS, TK_EQ,
  TK_GE, TK_LE, TK_NE, TK_NUMBER,
  TK_STRING, TK_EOS
}
 

Public Member Functions

LexState GetState ()
 
LexState SetInput (string input)
 set the input stream. More...
 
LexState GetState ()
 
LexState SetInput (string input)
 set the input stream. More...
 

Static Public Member Functions

static int next (LexState LS)
 
static void checkbuffer (LexState LS, int len)
 
static void save (LexState LS, char c, ref int l)
 
static void save_and_next (LexState LS, ref int l)
 
static void luaX_errorline (LexState ls, string s, string token, int line)
 
static void luaX_error (LexState ls, string s, string token)
 
static void luaX_syntaxerror (LexState ls, string msg)
 
static void luaX_checklimit (LexState ls, int val, int limit, string msg)
 
static void luaX_lexerror (LexState ls, string s, int token)
 
static string luaX_token2str (LexState ls, int token)
 
static void ThrowError (LexState ls, string errorMsg)
 
static void inclinenumber (LexState LS)
 
static void read_long_string (LexState LS, SemInfo seminfo)
 
static void read_string (LexState LS, int del, SemInfo seminfo)
 
static int readname (LexState LS)
 
static void read_numeral (LexState LS, int comma, SemInfo seminfo)
 
static int luaX_lex (LexState LS, SemInfo seminfo)
 
static int next (LexState LS)
 
static void checkbuffer (LexState LS, int len)
 
static void save (LexState LS, char c, ref int l)
 
static void save_and_next (LexState LS, ref int l)
 
static void luaX_errorline (LexState ls, string s, string token, int line)
 
static void luaX_error (LexState ls, string s, string token)
 
static void luaX_syntaxerror (LexState ls, string msg)
 
static void luaX_checklimit (LexState ls, int val, int limit, string msg)
 
static void luaX_lexerror (LexState ls, string s, int token)
 
static string luaX_token2str (LexState ls, int token)
 
static void ThrowError (LexState ls, string errorMsg)
 
static void inclinenumber (LexState LS)
 
static void read_long_string (LexState LS, SemInfo seminfo)
 
static void read_string (LexState LS, int del, SemInfo seminfo)
 
static int readname (LexState LS)
 
static void read_numeral (LexState LS, int comma, SemInfo seminfo)
 
static int luaX_lex (LexState LS, SemInfo seminfo)
 

Public Attributes

const int EOZ = -1
 
const int MAX_INT = 65530
 
const int FIRST_RESERVED = 257
 
const int MAXNOCHECK = 5
 
const int EXTRABUFF = 32
 
const int TOKEN_LEN = 8
 
const int UCHAR_MAX = 0xff
 
LexState m_lexState
 
Zio m_zio
 

Detailed Description

lexer for NPL files.

It is the same lexer of lua 5.1

Member Function Documentation

§ SetInput() [1/2]

LexState NPLMono.NPLLex.SetInput ( string  input)
inline

set the input stream.

and clean up all states

Parameters
inputcode to be parsed
nLenlength of the code
Returns
the state

§ SetInput() [2/2]

LexState NPLMono.NPLLex.SetInput ( string  input)
inline

set the input stream.

and clean up all states

Parameters
inputcode to be parsed
nLenlength of the code
Returns
the state

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