Lua 5.1.4: llex.h


L0001    /*
L0002    ** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $
L0003    ** Lexical Analyzer
L0004    ** See Copyright Notice in lua.h
L0005    */
L0006    
L0007    #ifndef llex_h
L0008    #define llex_h
L0009    
L0010    #include "lobject.h"
L0011    #include "lzio.h"
L0012    
L0013    
L0014    #define FIRST_RESERVED	257
L0015    
L0016    /* maximum length of a reserved word */
L0017    #define TOKEN_LEN	(sizeof("function")/sizeof(char))
L0018    
L0019    
L0020    /*
L0021    * WARNING: if you change the order of this enumeration,
L0022    * grep "ORDER RESERVED"
L0023    */
L0024    enum RESERVED {
L0025      /* terminal symbols denoted by reserved words */
L0026      TK_AND = FIRST_RESERVED, TK_BREAK,
L0027      TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION,
L0028      TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT,
L0029      TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE,
L0030      /* other terminal symbols */
L0031      TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER,
L0032      TK_NAME, TK_STRING, TK_EOS
L0033    };
L0034    
L0035    /* number of reserved words */
L0036    #define NUM_RESERVED	(cast(int, TK_WHILE-FIRST_RESERVED+1))
L0037    
L0038    
L0039    /* array with token `names' */
L0040    LUAI_DATA const char *const luaX_tokens [];
L0041    
L0042    
L0043    typedef union {
L0044      lua_Number r;
L0045      TString *ts;
L0046    } SemInfo;  /* semantics information */
L0047    
L0048    
L0049    typedef struct Token {
L0050      int token;
L0051      SemInfo seminfo;
L0052    } Token;
L0053    
L0054    
L0055    typedef struct LexState {
L0056      int current;  /* current character (charint) */
L0057      int linenumber;  /* input line counter */
L0058      int lastline;  /* line of last token `consumed' */
L0059      Token t;  /* current token */
L0060      Token lookahead;  /* look ahead token */
L0061      struct FuncState *fs;  /* `FuncState' is private to the parser */
L0062      struct lua_State *L;
L0063      ZIO *z;  /* input stream */
L0064      Mbuffer *buff;  /* buffer for tokens */
L0065      TString *source;  /* current source name */
L0066      char decpoint;  /* locale decimal point */
L0067    } LexState;
L0068    
L0069    
L0070    LUAI_FUNC void luaX_init (lua_State *L);
L0071    LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z,
L0072                                  TString *source);
L0073    LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l);
L0074    LUAI_FUNC void luaX_next (LexState *ls);
L0075    LUAI_FUNC void luaX_lookahead (LexState *ls);
L0076    LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token);
L0077    LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s);
L0078    LUAI_FUNC const char *luaX_token2str (LexState *ls, int token);
L0079    
L0080    
L0081    #endif

Generated by pretty.lua