lua/llex.h File Reference

#include "lobject.h"
#include "lzio.h"

Go to the source code of this file.

Data Structures

union  SemInfo
struct  Token
struct  LexState

Defines

#define FIRST_RESERVED   257
#define TOKEN_LEN   (sizeof("function")/sizeof(char))
#define NUM_RESERVED   (cast(int, TK_WHILE-FIRST_RESERVED+1))

Enumerations

enum  RESERVED {
  TK_AND = 257, 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
}

Functions

void luaX_init (lua_State *L)
void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, TString *source)
int luaX_lex (LexState *LS, SemInfo *seminfo)
void luaX_checklimit (LexState *ls, int val, int limit, const char *msg)
void luaX_syntaxerror (LexState *ls, const char *s)
void luaX_errorline (LexState *ls, const char *s, const char *token, int line)
const char * luaX_token2str (LexState *ls, int token)


Define Documentation

#define FIRST_RESERVED   257

Definition at line 14 of file llex.h.

Referenced by luaX_lex(), and luaX_token2str().

#define NUM_RESERVED   (cast(int, TK_WHILE-FIRST_RESERVED+1))

Definition at line 36 of file llex.h.

Referenced by luaX_init().

#define TOKEN_LEN   (sizeof("function")/sizeof(char))

Definition at line 17 of file llex.h.

Referenced by luaX_init().


Enumeration Type Documentation

enum RESERVED

Enumerator:
TK_AND 
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 

Definition at line 24 of file llex.h.


Function Documentation

void luaX_checklimit ( LexState ls,
int  val,
int  limit,
const char *  msg 
)

Definition at line 55 of file llex.c.

References LexState::L, luaO_pushfstring(), and luaX_syntaxerror().

Referenced by code_params(), inclinenumber(), listfield(), new_localvar(), and recfield().

void luaX_errorline ( LexState ls,
const char *  s,
const char *  token,
int  line 
)

Definition at line 63 of file llex.c.

References getstr, LexState::L, luaD_throw(), luaO_chunkid(), luaO_pushfstring(), MAXSRC, and LexState::source.

Referenced by luaX_error(), and prefixexp().

void luaX_init ( lua_State L  ) 

Definition at line 41 of file llex.c.

References cast, lua_assert, luaS_fix, luaS_new, NUM_RESERVED, token2string, and TOKEN_LEN.

Referenced by f_luaopen().

int luaX_lex ( LexState LS,
SemInfo seminfo 
)

Definition at line 329 of file llex.c.

References LexState::buff, LexState::current, EOZ, FIRST_RESERVED, inclinenumber(), LexState::L, luaO_pushfstring(), luaS_newlstr(), luaX_error(), luaZ_buffer, next, read_long_string(), read_numeral(), read_string(), readname(), TString::reserved, TK_CONCAT, TK_DOTS, TK_EOS, TK_EQ, TK_GE, TK_LE, TK_NAME, TK_NE, TK_NUMBER, TK_STRING, SemInfo::ts, and TString::tsv.

Referenced by lookahead(), and next().

void luaX_setinput ( lua_State L,
LexState LS,
ZIO z,
TString source 
)

Definition at line 126 of file llex.c.

References LexState::current, EOZ, LexState::fs, LexState::L, LexState::lastline, LexState::linenumber, LexState::lookahead, next, LexState::source, TK_EOS, Token::token, and LexState::z.

Referenced by luaY_parser().

void luaX_syntaxerror ( LexState ls,
const char *  s 
)

Definition at line 79 of file llex.c.

References LexState::buff, getstr, luaX_error(), luaX_token2str(), luaZ_buffer, Token::seminfo, LexState::t, TK_NAME, TK_NUMBER, TK_STRING, Token::token, and SemInfo::ts.

Referenced by breakstat(), check_match(), error_expected(), forstat(), funcargs(), luaK_checkstack(), luaK_fixjump(), luaX_checklimit(), parlist(), prefixexp(), and whilestat().

const char* luaX_token2str ( LexState ls,
int  token 
)

Definition at line 97 of file llex.c.

References FIRST_RESERVED, LexState::L, lua_assert, luaO_pushfstring(), and token2string.

Referenced by check_match(), error_expected(), luaX_lexerror(), and luaX_syntaxerror().


Generated on Fri Oct 12 08:44:55 2007 for rpm by  doxygen 1.5.2