mirror of https://github.com/lua/lua.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
919 B
48 lines
919 B
/*
|
|
** $Id: llex.h,v 1.3 1997/11/19 17:29:23 roberto Exp roberto $
|
|
** Lexical Analizer
|
|
** See Copyright Notice in lua.h
|
|
*/
|
|
|
|
#ifndef llex_h
|
|
#define llex_h
|
|
|
|
#include "lobject.h"
|
|
#include "lzio.h"
|
|
|
|
|
|
#define MAX_IFS 5
|
|
|
|
/* "ifstate" keeps the state of each nested $if the lexical is dealing with. */
|
|
|
|
struct ifState {
|
|
int elsepart; /* true if its in the $else part */
|
|
int condition; /* true if $if condition is true */
|
|
int skip; /* true if part must be skiped */
|
|
};
|
|
|
|
struct textBuff {
|
|
char *text;
|
|
int tokensize;
|
|
int buffsize;
|
|
};
|
|
|
|
|
|
typedef struct LexState {
|
|
int current; /* look ahead character */
|
|
struct zio *lex_z;
|
|
int linenumber;
|
|
struct ifState ifstate[MAX_IFS];
|
|
int iflevel; /* level of nested $if's (for lexical analysis) */
|
|
struct textBuff textbuff;
|
|
int linelasttoken;
|
|
int lastline;
|
|
} LexState;
|
|
|
|
|
|
void luaX_init (void);
|
|
void luaX_setinput (ZIO *z);
|
|
char *luaX_lasttoken (void);
|
|
|
|
|
|
#endif
|
|
|