# llex.c File Reference

`#include <ctype.h>`
`#include <locale.h>`
`#include <string.h>`
`#include "lua.h"`
`#include "ldo.h"`
`#include "llex.h"`
`#include "lobject.h"`
`#include "lparser.h"`
`#include "lstate.h"`
`#include "lstring.h"`
`#include "ltable.h"`
`#include "lzio.h"`

## Defines
#define | llex_c
#define | LUA_CORE
#define | next(ls) (ls->current = zgetc(ls->z))
#define | currIsNewline(ls) (ls->current == '\n' || ls->current == '\r')
#define | save_and_next(ls) (save(ls, ls->current), next(ls))
#define | MAXSRC 80
## Functions
static void | save (LexState *ls, int c)
void | luaX_init (lua_State *L)
const char * | luaX_token2str (LexState *ls, int token)
static const char * | txtToken (LexState *ls, int token)
void | luaX_lexerror (LexState *ls, const char *msg, int token)
void | luaX_syntaxerror (LexState *ls, const char *msg)
TString * | luaX_newstring (LexState *ls, const char *str, size_t l)
static void | inclinenumber (LexState *ls)
void | luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source)
static int | check_next (LexState *ls, const char *set)
static void | buffreplace (LexState *ls, char from, char to)
static void | trydecpoint (LexState *ls, SemInfo *seminfo)
static void | read_numeral (LexState *ls, SemInfo *seminfo)
static int | skip_sep (LexState *ls)
static void | read_long_string (LexState *ls, SemInfo *seminfo, int sep)
static void | read_string (LexState *ls, int del, SemInfo *seminfo)
static int | llex (LexState *ls, SemInfo *seminfo)
void | luaX_next (LexState *ls)
void | luaX_lookahead (LexState *ls)
## Variables
const char *const | luaX_tokens []

## Define Documentation

#define currIsNewline | ( | ls |  | ) | (ls->current == '\n' || ls->current == '\r')

#define llex_c

#define LUA_CORE

#define MAXSRC 80

#define next | ( | ls |  | ) | (ls->current = zgetc(ls->z))

#define save_and_next | ( | ls |  | ) | (save(ls, ls->current), next(ls))

## Function Documentation

static void buffreplace | ( | LexState * | ls,
|  | char | from,
|  | char | to |
| ) |  |  | `[static]`

static int check_next | ( | LexState * | ls,
|  | const char * | set |
| ) |  |  | `[static]`

static void inclinenumber | ( | LexState * | ls | ) | `[static]`

static int llex | ( | LexState * | ls,
|  | SemInfo * | seminfo |
| ) |  |  | `[static]`

void luaX_init | ( | lua_State * | L | ) |

void luaX_lexerror | ( | LexState * | ls,
|  | const char * | msg,
|  | int | token |
| ) |  |  |

void luaX_lookahead | ( | LexState * | ls | ) |

TString* luaX_newstring | ( | LexState * | ls,
|  | const char * | str,
|  | size_t | l |
| ) |  |  |

void luaX_next | ( | LexState * | ls | ) |

void luaX_setinput | ( | lua_State * | L,
|  | LexState * | ls,
|  | ZIO * | z,
|  | TString * | source |
| ) |  |  |

void luaX_syntaxerror | ( | LexState * | ls,
|  | const char * | msg |
| ) |  |  |

const char* luaX_token2str | ( | LexState * | ls,
|  | int | token |
| ) |  |  |

static void read_long_string | ( | LexState * | ls,
|  | SemInfo * | seminfo,
|  | int | sep |
| ) |  |  | `[static]`

static void read_numeral | ( | LexState * | ls,
|  | SemInfo * | seminfo |
| ) |  |  | `[static]`

static void read_string | ( | LexState * | ls,
|  | int | del,
|  | SemInfo * | seminfo |
| ) |  |  | `[static]`

static void save | ( | LexState * | ls,
|  | int | c |
| ) |  |  | `[static]`

static int skip_sep | ( | LexState * | ls | ) | `[static]`

static void trydecpoint | ( | LexState * | ls,
|  | SemInfo * | seminfo |
| ) |  |  | `[static]`

static const char* txtToken | ( | LexState * | ls,
|  | int | token |
| ) |  |  | `[static]`

## Variable Documentation

const char* const luaX_tokens[]

Initial value:

     {
        "and", "break", "do", "else", "elseif",
        "end", "false", "for", "function", "if",
        "in", "local", "nil", "not", "or", "repeat",
        "return", "then", "true", "until", "while",
        "..", "...", "==", ">=", "<=", "~=",
        "<number>", "<name>", "<string>", "<eof>",
        NULL
    }