#include "lprefix.h"
#include <string.h>
#include "lua.h"
#include "lcode.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "llex.h"
#include "lmem.h"
#include "lobject.h"
#include "lopcodes.h"
#include "lparser.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
Go to the source code of this file.
Classes | |
struct | BlockCnt |
struct | ConsControl |
struct | LHS_assign |
Macros | |
#define | lparser_c |
#define | LUA_CORE |
#define | MAXVARS 200 |
#define | hasmultret(k) ((k) == VCALL || (k) == VVARARG) |
#define | eqstr(a, b) ((a) == (b)) |
#define | check_condition(ls, c, msg) { if (!(c)) luaX_syntaxerror(ls, msg); } |
#define | new_localvarliteral(ls, v) new_localvarliteral_(ls, "" v, (sizeof(v)/sizeof(char))-1) |
#define | leavelevel(ls) ((ls)->L->nCcalls--) |
#define | UNARY_PRIORITY 12 /* priority for unary operators */ |
Typedefs | |
typedef struct BlockCnt | BlockCnt |
Functions | |
static void | statement (LexState *ls) |
static void | expr (LexState *ls, expdesc *v) |
static l_noret | semerror (LexState *ls, const char *msg) |
static l_noret | error_expected (LexState *ls, int token) |
static l_noret | errorlimit (FuncState *fs, int limit, const char *what) |
static void | checklimit (FuncState *fs, int v, int l, const char *what) |
static int | testnext (LexState *ls, int c) |
static void | check (LexState *ls, int c) |
static void | checknext (LexState *ls, int c) |
static void | check_match (LexState *ls, int what, int who, int where) |
static TString * | str_checkname (LexState *ls) |
static void | init_exp (expdesc *e, expkind k, int i) |
static void | codestring (LexState *ls, expdesc *e, TString *s) |
static void | checkname (LexState *ls, expdesc *e) |
static int | registerlocalvar (LexState *ls, TString *varname) |
static void | new_localvar (LexState *ls, TString *name) |
static void | new_localvarliteral_ (LexState *ls, const char *name, size_t sz) |
static LocVar * | getlocvar (FuncState *fs, int i) |
static void | adjustlocalvars (LexState *ls, int nvars) |
static void | removevars (FuncState *fs, int tolevel) |
static int | searchupvalue (FuncState *fs, TString *name) |
static int | newupvalue (FuncState *fs, TString *name, expdesc *v) |
static int | searchvar (FuncState *fs, TString *n) |
static void | markupval (FuncState *fs, int level) |
static void | singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) |
static void | singlevar (LexState *ls, expdesc *var) |
static void | adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) |
static void | enterlevel (LexState *ls) |
static void | closegoto (LexState *ls, int g, Labeldesc *label) |
static int | findlabel (LexState *ls, int g) |
static int | newlabelentry (LexState *ls, Labellist *l, TString *name, int line, int pc) |
static void | findgotos (LexState *ls, Labeldesc *lb) |
static void | movegotosout (FuncState *fs, BlockCnt *bl) |
static void | enterblock (FuncState *fs, BlockCnt *bl, lu_byte isloop) |
static void | breaklabel (LexState *ls) |
static l_noret | undefgoto (LexState *ls, Labeldesc *gt) |
static void | leaveblock (FuncState *fs) |
static Proto * | addprototype (LexState *ls) |
static void | codeclosure (LexState *ls, expdesc *v) |
static void | open_func (LexState *ls, FuncState *fs, BlockCnt *bl) |
static void | close_func (LexState *ls) |
static int | block_follow (LexState *ls, int withuntil) |
static void | statlist (LexState *ls) |
static void | fieldsel (LexState *ls, expdesc *v) |
static void | yindex (LexState *ls, expdesc *v) |
static void | recfield (LexState *ls, struct ConsControl *cc) |
static void | closelistfield (FuncState *fs, struct ConsControl *cc) |
static void | lastlistfield (FuncState *fs, struct ConsControl *cc) |
static void | listfield (LexState *ls, struct ConsControl *cc) |
static void | field (LexState *ls, struct ConsControl *cc) |
static void | constructor (LexState *ls, expdesc *t) |
static void | parlist (LexState *ls) |
static void | body (LexState *ls, expdesc *e, int ismethod, int line) |
static int | explist (LexState *ls, expdesc *v) |
static void | funcargs (LexState *ls, expdesc *f, int line) |
static void | primaryexp (LexState *ls, expdesc *v) |
static void | suffixedexp (LexState *ls, expdesc *v) |
static void | simpleexp (LexState *ls, expdesc *v) |
static UnOpr | getunopr (int op) |
static BinOpr | getbinopr (int op) |
static BinOpr | subexpr (LexState *ls, expdesc *v, int limit) |
static void | block (LexState *ls) |
static void | check_conflict (LexState *ls, struct LHS_assign *lh, expdesc *v) |
static void | assignment (LexState *ls, struct LHS_assign *lh, int nvars) |
static int | cond (LexState *ls) |
static void | gotostat (LexState *ls, int pc) |
static void | checkrepeated (FuncState *fs, Labellist *ll, TString *label) |
static void | skipnoopstat (LexState *ls) |
static void | labelstat (LexState *ls, TString *label, int line) |
static void | whilestat (LexState *ls, int line) |
static void | repeatstat (LexState *ls, int line) |
static int | exp1 (LexState *ls) |
static void | forbody (LexState *ls, int base, int line, int nvars, int isnum) |
static void | fornum (LexState *ls, TString *varname, int line) |
static void | forlist (LexState *ls, TString *indexname) |
static void | forstat (LexState *ls, int line) |
static void | test_then_block (LexState *ls, int *escapelist) |
static void | ifstat (LexState *ls, int line) |
static void | localfunc (LexState *ls) |
static void | localstat (LexState *ls) |
static int | funcname (LexState *ls, expdesc *v) |
static void | funcstat (LexState *ls, int line) |
static void | exprstat (LexState *ls) |
static void | retstat (LexState *ls) |
static void | mainfunc (LexState *ls, FuncState *fs) |
LClosure * | luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, Dyndata *dyd, const char *name, int firstchar) |
Variables | |
struct { | |
lu_byte left | |
lu_byte right | |
} | priority [] |
#define check_condition | ( | ls, | |
c, | |||
msg | |||
) | { if (!(c)) luaX_syntaxerror(ls, msg); } |
Definition at line 118 of file lparser.cpp.
Referenced by assignment(), exprstat(), and simpleexp().
Definition at line 42 of file lparser.cpp.
Referenced by checkrepeated(), closegoto(), findgotos(), findlabel(), searchupvalue(), and searchvar().
Definition at line 37 of file lparser.cpp.
Referenced by adjust_assign(), funcargs(), lastlistfield(), and retstat().
#define leavelevel | ( | ls | ) | ((ls)->L->nCcalls--) |
Definition at line 338 of file lparser.cpp.
Referenced by statement(), and subexpr().
#define lparser_c |
Definition at line 7 of file lparser.cpp.
#define LUA_CORE |
Definition at line 8 of file lparser.cpp.
#define MAXVARS 200 |
Definition at line 34 of file lparser.cpp.
Referenced by new_localvar().
#define new_localvarliteral | ( | ls, | |
v | |||
) | new_localvarliteral_(ls, "" v, (sizeof(v)/sizeof(char))-1) |
Definition at line 191 of file lparser.cpp.
#define UNARY_PRIORITY 12 /* priority for unary operators */ |
Definition at line 1042 of file lparser.cpp.
Referenced by subexpr().
Definition at line 499 of file lparser.cpp.
References FuncState::f, f, LexState::fs, LexState::L, luaC_objbarrier, luaF_newproto(), luaM_growvector, MAXARG_Bx, FuncState::np, Proto::p, and Proto::sizep.
Referenced by body().
Definition at line 309 of file lparser.cpp.
References FuncState::freereg, LexState::fs, hasmultret, expdesc::k, luaK_exp2nextreg(), luaK_nil(), luaK_reserveregs(), luaK_setreturns(), and VVOID.
Referenced by assignment(), forlist(), and localstat().
|
static |
Definition at line 202 of file lparser.cpp.
References cast_byte, LexState::fs, getlocvar(), FuncState::nactvar, FuncState::pc, and LocVar::startpc.
Referenced by body(), forbody(), localfunc(), localstat(), and parlist().
|
static |
Definition at line 1148 of file lparser.cpp.
References adjust_assign(), check_condition, check_conflict(), checklimit(), checknext(), e, explist(), FuncState::freereg, LexState::fs, init_exp(), expdesc::k, LexState::L, LUAI_MAXCCALLS, luaK_setoneret(), luaK_storevar(), lua_State::nCcalls, LHS_assign::prev, suffixedexp(), testnext(), LHS_assign::v, VINDEXED, vkisvar, and VNONRELOC.
Referenced by exprstat().
|
static |
Definition at line 1094 of file lparser.cpp.
References enterblock(), LexState::fs, leaveblock(), and statlist().
Referenced by forbody(), ifstat(), luaM_realloc_(), statement(), and whilestat().
|
static |
Definition at line 588 of file lparser.cpp.
References LexState::t, TK_ELSE, TK_ELSEIF, TK_END, TK_EOS, TK_UNTIL, and Token::token.
Referenced by labelstat(), retstat(), statlist(), and test_then_block().
Definition at line 783 of file lparser.cpp.
References addprototype(), adjustlocalvars(), check_match(), checknext(), close_func(), codeclosure(), FuncState::f, Proto::lastlinedefined, Proto::linedefined, LexState::linenumber, new_localvarliteral, open_func(), parlist(), statlist(), TK_END, and TK_FUNCTION.
Referenced by funcstat(), localfunc(), persist_context::name_space::parse(), and simpleexp().
|
static |
Definition at line 454 of file lparser.cpp.
References Labellist::arr, LexState::dyd, findgotos(), LexState::fs, LexState::L, Dyndata::label, luaS_new(), n, newlabelentry(), and FuncState::pc.
Referenced by leaveblock().
|
static |
Definition at line 106 of file lparser.cpp.
References error_expected(), LexState::t, and Token::token.
Referenced by wb::side_actions::bump_earlier(), checknext(), mainfunc(), and str_checkname().
|
static |
Definition at line 1120 of file lparser.cpp.
References FuncState::freereg, LexState::fs, expdesc::ind, expdesc::info, expdesc::k, luaK_codeABC(), luaK_reserveregs(), OP_GETUPVAL, OP_MOVE, LHS_assign::prev, expdesc::u, LHS_assign::v, VINDEXED, and VLOCAL.
Referenced by assignment().
|
static |
Definition at line 122 of file lparser.cpp.
References error_expected(), LexState::L, LexState::linenumber, luaO_pushfstring(), luaX_syntaxerror(), luaX_token2str(), and testnext().
Referenced by body(), constructor(), forstat(), funcargs(), ifstat(), primaryexp(), repeatstat(), statement(), and whilestat().
|
static |
Definition at line 92 of file lparser.cpp.
References errorlimit().
Referenced by assignment(), enterlevel(), listfield(), new_localvar(), newupvalue(), and recfield().
Definition at line 156 of file lparser.cpp.
References codestring(), and str_checkname().
Referenced by fieldsel(), recfield(), and suffixedexp().
|
static |
Definition at line 112 of file lparser.cpp.
References check(), and luaX_next().
Referenced by assignment(), body(), constructor(), forbody(), forlist(), fornum(), labelstat(), recfield(), test_then_block(), whilestat(), and yindex().
Definition at line 1204 of file lparser.cpp.
References Labellist::arr, FuncState::bl, eqstr, BlockCnt::firstlabel, getstr, i, LexState::L, Labeldesc::line, FuncState::ls, luaO_pushfstring(), wfl::msg(), n, Labeldesc::name, and semerror().
Referenced by labelstat().
|
static |
Definition at line 553 of file lparser.cpp.
References FuncState::bl, Proto::code, FuncState::f, f, LexState::fs, Proto::k, LexState::L, leaveblock(), Proto::lineinfo, Proto::locvars, lua_assert, luaC_checkGC, luaK_ret(), luaM_reallocvector, FuncState::nk, FuncState::nlocvars, FuncState::np, FuncState::nups, Proto::p, FuncState::pc, FuncState::prev, Proto::sizecode, Proto::sizek, Proto::sizelineinfo, Proto::sizelocvars, Proto::sizep, Proto::sizeupvalues, and Proto::upvalues.
Referenced by body(), and mainfunc().
Definition at line 341 of file lparser.cpp.
References Labellist::arr, LexState::dyd, eqstr, LexState::fs, g, getlocvar(), getstr, Dyndata::gt, i, LexState::L, Labeldesc::line, lua_assert, luaK_patchlist(), luaO_pushfstring(), wfl::msg(), Labellist::n, Labeldesc::nactvar, Labeldesc::name, Labeldesc::pc, semerror(), and LocVar::varname.
Referenced by findgotos(), and findlabel().
|
static |
Definition at line 668 of file lparser.cpp.
References expdesc::info, expdesc::k, LFIELDS_PER_FLUSH, luaK_exp2nextreg(), luaK_setlist(), ConsControl::na, ConsControl::t, ConsControl::tostore, expdesc::u, ConsControl::v, and VVOID.
Referenced by constructor().
Definition at line 522 of file lparser.cpp.
References LexState::fs, init_exp(), luaK_codeABx(), luaK_exp2nextreg(), FuncState::np, OP_CLOSURE, FuncState::prev, and VRELOCABLE.
Referenced by body().
Definition at line 151 of file lparser.cpp.
References LexState::fs, init_exp(), luaK_stringK(), and VK.
Referenced by checkname(), funcargs(), simpleexp(), and singlevar().
|
static |
Definition at line 1178 of file lparser.cpp.
References expr(), expdesc::f, LexState::fs, expdesc::k, luaK_goiftrue(), LHS_assign::v, VFALSE, and VNIL.
Referenced by schema_validation::wml_tag::expand_all(), unit_filter_impl::unit_filter_compound::fill(), schema_validation::wml_tag::find_key(), schema_validation::wml_tag::find_tag(), terrain_filter::get_locs_impl(), intf_eval_conditional(), side_filter::match(), terrain_filter::match_impl(), repeatstat(), game_events::builtin_conditions::variable_matches(), and whilestat().
Definition at line 725 of file lparser.cpp.
References check_match(), checknext(), closelistfield(), Proto::code, FuncState::f, field(), LexState::fs, init_exp(), expdesc::k, lastlistfield(), LexState::linenumber, lua_assert, luaK_codeABC(), luaK_exp2nextreg(), luaO_int2fb(), ConsControl::na, ConsControl::nh, OP_NEWTABLE, SETARG_B, SETARG_C, LexState::t, t, ConsControl::t, testnext(), Token::token, ConsControl::tostore, ConsControl::v, VRELOCABLE, and VVOID.
Referenced by funcargs(), and simpleexp().
Definition at line 439 of file lparser.cpp.
References FuncState::bl, LexState::dyd, BlockCnt::firstgoto, BlockCnt::firstlabel, FuncState::freereg, Dyndata::gt, BlockCnt::isloop, Dyndata::label, FuncState::ls, lua_assert, Labellist::n, BlockCnt::nactvar, FuncState::nactvar, BlockCnt::previous, and BlockCnt::upval.
Referenced by block(), forbody(), forstat(), open_func(), repeatstat(), test_then_block(), and whilestat().
|
static |
Definition at line 331 of file lparser.cpp.
References checklimit(), LexState::fs, LexState::L, LUAI_MAXCCALLS, and lua_State::nCcalls.
Referenced by statement(), and subexpr().
Definition at line 73 of file lparser.cpp.
References LexState::L, luaO_pushfstring(), luaX_syntaxerror(), and luaX_token2str().
Referenced by check(), and check_match().
Definition at line 79 of file lparser.cpp.
References FuncState::f, LexState::L, Proto::linedefined, FuncState::ls, luaO_pushfstring(), luaX_syntaxerror(), and wfl::msg().
Referenced by checklimit().
|
static |
Definition at line 1281 of file lparser.cpp.
References e, expr(), LexState::fs, expdesc::info, expdesc::k, lua_assert, luaK_exp2nextreg(), expdesc::u, and VNONRELOC.
Definition at line 805 of file lparser.cpp.
References expr(), LexState::fs, luaK_exp2nextreg(), n, and testnext().
Referenced by assignment(), forlist(), funcargs(), localstat(), and retstat().
Definition at line 1079 of file lparser.cpp.
References subexpr().
Referenced by cond(), wfl::builtins::DEFINE_WFL_FUNCTION(), exp1(), explist(), listfield(), primaryexp(), recfield(), test_then_block(), wfl::tokens_to_string(), and yindex().
|
static |
Definition at line 1489 of file lparser.cpp.
References assignment(), check_condition, LexState::fs, getinstruction, expdesc::k, LHS_assign::prev, SETARG_C, suffixedexp(), LexState::t, Token::token, LHS_assign::v, and VCALL.
Referenced by statement().
|
static |
Definition at line 703 of file lparser.cpp.
References listfield(), luaX_lookahead(), recfield(), LexState::t, TK_NAME, and Token::token.
Referenced by gui2::dialogs::generator_settings::adjust_minimum_size_by_players(), constructor(), default_map_generator_job::default_generate_map(), gui2::dialogs::modal_dialog::register_bool(), gui2::dialogs::modal_dialog::register_integer(), gui2::dialogs::modal_dialog::register_label(), gui2::dialogs::modal_dialog::register_text(), and verify().
Definition at line 611 of file lparser.cpp.
References checkname(), LexState::fs, luaK_exp2anyregup(), luaK_indexed(), and luaX_next().
Referenced by funcname(), and suffixedexp().
Definition at line 403 of file lparser.cpp.
References Labellist::arr, FuncState::bl, closegoto(), LexState::dyd, eqstr, BlockCnt::firstgoto, LexState::fs, Dyndata::gt, i, n, and Labeldesc::name.
Referenced by breaklabel(), and labelstat().
|
static |
Definition at line 365 of file lparser.cpp.
References Labellist::arr, FuncState::bl, closegoto(), LexState::dyd, eqstr, BlockCnt::firstlabel, LexState::fs, g, Dyndata::gt, i, Dyndata::label, luaK_patchclose(), Labellist::n, Labeldesc::nactvar, Labeldesc::name, Labeldesc::pc, and BlockCnt::upval.
Referenced by gotostat(), and movegotosout().
|
static |
Definition at line 1292 of file lparser.cpp.
References adjustlocalvars(), block(), checknext(), enterblock(), LexState::fs, leaveblock(), luaK_codeABC(), luaK_codeAsBx, luaK_fixline(), luaK_jump(), luaK_patchlist(), luaK_patchtohere(), luaK_reserveregs(), NO_JUMP, OP_FORLOOP, OP_FORPREP, OP_TFORCALL, OP_TFORLOOP, and TK_DO.
Definition at line 1340 of file lparser.cpp.
References adjust_assign(), checknext(), e, explist(), forbody(), FuncState::freereg, LexState::fs, LexState::linenumber, luaK_checkstack(), new_localvar(), new_localvarliteral, str_checkname(), testnext(), and TK_IN.
Referenced by forstat().
Definition at line 1318 of file lparser.cpp.
References checknext(), exp1(), forbody(), FuncState::freereg, LexState::fs, luaK_codek(), luaK_intK(), luaK_reserveregs(), new_localvar(), new_localvarliteral, and testnext().
Referenced by forstat().
|
static |
Definition at line 1365 of file lparser.cpp.
References check_match(), enterblock(), forlist(), fornum(), LexState::fs, leaveblock(), luaX_next(), luaX_syntaxerror(), str_checkname(), LexState::t, TK_END, TK_FOR, TK_IN, and Token::token.
Referenced by statement().
Definition at line 818 of file lparser.cpp.
References check_match(), codestring(), constructor(), explist(), FuncState::freereg, LexState::fs, hasmultret, expdesc::info, init_exp(), expdesc::k, lua_assert, LUA_MULTRET, luaK_codeABC(), luaK_exp2nextreg(), luaK_fixline(), luaK_setmultret, luaX_next(), luaX_syntaxerror(), OP_CALL, Token::seminfo, LexState::t, TK_STRING, Token::token, SemInfo::ts, expdesc::u, VCALL, VNONRELOC, and VVOID.
Referenced by suffixedexp().
Definition at line 1463 of file lparser.cpp.
References fieldsel(), singlevar(), LexState::t, and Token::token.
Referenced by funcstat().
|
static |
Definition at line 1477 of file lparser.cpp.
References b, body(), LexState::fs, funcname(), luaK_fixline(), luaK_storevar(), luaX_next(), and LHS_assign::v.
Referenced by statement().
|
static |
Definition at line 998 of file lparser.cpp.
References OPR_ADD, OPR_AND, OPR_BAND, OPR_BOR, OPR_BXOR, OPR_CONCAT, OPR_DIV, OPR_EQ, OPR_GE, OPR_GT, OPR_IDIV, OPR_LE, OPR_LT, OPR_MOD, OPR_MUL, OPR_NE, OPR_NOBINOPR, OPR_OR, OPR_POW, OPR_SHL, OPR_SHR, OPR_SUB, TK_AND, TK_CONCAT, TK_EQ, TK_GE, TK_IDIV, TK_LE, TK_NE, TK_OR, TK_SHL, and TK_SHR.
Referenced by subexpr().
Definition at line 195 of file lparser.cpp.
References Dyndata::actvar, Dyndata::arr, LexState::dyd, FuncState::f, FuncState::firstlocal, i, Vardesc::idx, Proto::locvars, FuncState::ls, and lua_assert.
Referenced by adjustlocalvars(), closegoto(), localfunc(), removevars(), and searchvar().
|
static |
Definition at line 987 of file lparser.cpp.
References OPR_BNOT, OPR_LEN, OPR_MINUS, OPR_NOT, OPR_NOUNOPR, and TK_NOT.
Referenced by subexpr().
|
static |
Definition at line 1188 of file lparser.cpp.
References LexState::dyd, findlabel(), g, Dyndata::gt, LexState::L, LexState::linenumber, luaS_new(), luaX_next(), newlabelentry(), str_checkname(), testnext(), and TK_GOTO.
Referenced by statement(), and test_then_block().
|
static |
Definition at line 1418 of file lparser.cpp.
References block(), check_match(), LexState::fs, luaK_patchtohere(), NO_JUMP, LexState::t, test_then_block(), testnext(), TK_ELSE, TK_ELSEIF, TK_END, TK_IF, and Token::token.
Referenced by statement().
Definition at line 144 of file lparser.cpp.
References expdesc::f, i, expdesc::info, expdesc::k, NO_JUMP, expdesc::t, and expdesc::u.
Referenced by assignment(), codeclosure(), codestring(), constructor(), funcargs(), mainfunc(), simpleexp(), and singlevaraux().
Definition at line 1224 of file lparser.cpp.
References Labellist::arr, FuncState::bl, block_follow(), checknext(), checkrepeated(), LexState::dyd, findgotos(), LexState::fs, Dyndata::label, luaK_getlabel(), BlockCnt::nactvar, Labeldesc::nactvar, newlabelentry(), skipnoopstat(), and TK_DBCOLON.
Referenced by statement().
|
static |
Definition at line 679 of file lparser.cpp.
References hasmultret, expdesc::info, expdesc::k, LUA_MULTRET, luaK_exp2nextreg(), luaK_setlist(), luaK_setmultret, ConsControl::na, ConsControl::t, ConsControl::tostore, expdesc::u, ConsControl::v, and VVOID.
Referenced by constructor().
|
static |
Definition at line 473 of file lparser.cpp.
References Labellist::arr, FuncState::bl, breaklabel(), LexState::dyd, BlockCnt::firstgoto, BlockCnt::firstlabel, FuncState::freereg, Dyndata::gt, BlockCnt::isloop, Dyndata::label, FuncState::ls, lua_assert, luaK_jump(), luaK_patchclose(), luaK_patchtohere(), movegotosout(), Labellist::n, BlockCnt::nactvar, FuncState::nactvar, BlockCnt::previous, removevars(), undefgoto(), and BlockCnt::upval.
Referenced by block(), close_func(), forbody(), forstat(), repeatstat(), test_then_block(), and whilestat().
|
static |
Definition at line 694 of file lparser.cpp.
References checklimit(), expr(), LexState::fs, MAX_INT, ConsControl::na, ConsControl::tostore, and ConsControl::v.
Referenced by field().
|
static |
Definition at line 1432 of file lparser.cpp.
References adjustlocalvars(), b, body(), LexState::fs, getlocvar(), expdesc::info, LexState::linenumber, new_localvar(), FuncState::pc, LocVar::startpc, str_checkname(), and expdesc::u.
Referenced by statement().
|
static |
Definition at line 1443 of file lparser.cpp.
References adjust_assign(), adjustlocalvars(), e, explist(), expdesc::k, new_localvar(), str_checkname(), testnext(), and VVOID.
Referenced by statement().
LClosure* luaY_parser | ( | lua_State * | L, |
ZIO * | z, | ||
Mbuffer * | buff, | ||
Dyndata * | dyd, | ||
const char * | name, | ||
int | firstchar | ||
) |
Definition at line 1628 of file lparser.cpp.
References Dyndata::actvar, LexState::buff, LexState::dyd, FuncState::f, LexState::fs, Dyndata::gt, LexState::h, iswhite, Dyndata::label, lua_assert, luaC_objbarrier, luaD_inctop(), luaF_newLclosure(), luaF_newproto(), luaH_new(), luaS_new(), luaX_setinput(), mainfunc(), Labellist::n, Dyndata::n, FuncState::nups, LClosure::p, FuncState::prev, setclLvalue, sethvalue, Proto::source, and lua_State::top.
Referenced by f_parser().
Definition at line 1613 of file lparser.cpp.
References check(), close_func(), LexState::envn, FuncState::f, init_exp(), Proto::is_vararg, LexState::L, luaC_objbarrier, luaX_next(), newupvalue(), open_func(), statlist(), TK_EOS, LHS_assign::v, and VLOCAL.
Referenced by luaY_parser().
|
static |
Definition at line 258 of file lparser.cpp.
References FuncState::bl, BlockCnt::nactvar, BlockCnt::previous, and BlockCnt::upval.
Referenced by singlevaraux().
Definition at line 421 of file lparser.cpp.
References Labellist::arr, LexState::dyd, findlabel(), BlockCnt::firstgoto, Dyndata::gt, i, FuncState::ls, luaK_patchclose(), n, BlockCnt::nactvar, Labeldesc::nactvar, Labeldesc::pc, and BlockCnt::upval.
Referenced by leaveblock().
Definition at line 175 of file lparser.cpp.
References Dyndata::actvar, Dyndata::arr, cast, checklimit(), LexState::dyd, FuncState::firstlocal, LexState::fs, Vardesc::idx, LexState::L, luaM_growvector, MAX_INT, MAXVARS, Dyndata::n, registerlocalvar(), and Dyndata::size.
Referenced by forlist(), fornum(), localfunc(), localstat(), new_localvarliteral_(), and parlist().
|
static |
Definition at line 187 of file lparser.cpp.
References luaX_newstring(), and new_localvar().
Definition at line 385 of file lparser.cpp.
References Labellist::arr, LexState::fs, LexState::L, Labeldesc::line, luaM_growvector, n, Labellist::n, Labeldesc::nactvar, FuncState::nactvar, name, Labeldesc::name, Labeldesc::pc, and Labellist::size.
Referenced by breaklabel(), gotostat(), and labelstat().
Definition at line 228 of file lparser.cpp.
References cast_byte, checklimit(), FuncState::f, f, Upvaldesc::idx, expdesc::info, Upvaldesc::instack, expdesc::k, LexState::L, FuncState::ls, luaC_objbarrier, luaM_growvector, MAXUPVAL, name, Upvaldesc::name, FuncState::nups, Proto::sizeupvalues, expdesc::u, Proto::upvalues, and VLOCAL.
Referenced by mainfunc(), and singlevaraux().
Definition at line 529 of file lparser.cpp.
References Dyndata::actvar, FuncState::bl, LexState::dyd, enterblock(), FuncState::f, f, FuncState::firstlocal, FuncState::freereg, LexState::fs, FuncState::jpc, LexState::L, FuncState::lasttarget, FuncState::ls, luaC_objbarrier, Proto::maxstacksize, Dyndata::n, FuncState::nactvar, FuncState::nk, FuncState::nlocvars, NO_JUMP, FuncState::np, FuncState::nups, FuncState::pc, FuncState::prev, LexState::source, and Proto::source.
Referenced by body(), and mainfunc().
|
static |
Definition at line 754 of file lparser.cpp.
References adjustlocalvars(), cast_byte, FuncState::f, f, LexState::fs, Proto::is_vararg, luaK_reserveregs(), luaX_next(), luaX_syntaxerror(), FuncState::nactvar, new_localvar(), Proto::numparams, str_checkname(), LexState::t, testnext(), TK_DOTS, TK_NAME, and Token::token.
Referenced by body().
Definition at line 872 of file lparser.cpp.
References check_match(), expr(), LexState::fs, LexState::linenumber, luaK_dischargevars(), luaX_next(), luaX_syntaxerror(), singlevar(), LexState::t, TK_NAME, and Token::token.
Referenced by suffixedexp().
|
static |
Definition at line 647 of file lparser.cpp.
References checklimit(), checkname(), checknext(), expr(), FuncState::freereg, LexState::fs, expdesc::info, luaK_codeABC(), luaK_exp2RK(), MAX_INT, ConsControl::nh, OP_SETTABLE, LexState::t, ConsControl::t, TK_NAME, Token::token, expdesc::u, and yindex().
Referenced by field().
Definition at line 161 of file lparser.cpp.
References FuncState::f, f, LexState::fs, LexState::L, Proto::locvars, luaC_objbarrier, luaM_growvector, FuncState::nlocvars, Proto::sizelocvars, and LocVar::varname.
Referenced by new_localvar().
|
static |
Definition at line 211 of file lparser.cpp.
References Dyndata::actvar, LexState::dyd, LocVar::endpc, getlocvar(), FuncState::ls, Dyndata::n, FuncState::nactvar, and FuncState::pc.
Referenced by leaveblock().
|
static |
Definition at line 1261 of file lparser.cpp.
References check_match(), cond(), enterblock(), LexState::fs, leaveblock(), luaK_getlabel(), luaK_patchclose(), luaK_patchlist(), luaX_next(), BlockCnt::nactvar, statlist(), TK_REPEAT, TK_UNTIL, and BlockCnt::upval.
Referenced by statement().
|
static |
Definition at line 1505 of file lparser.cpp.
References block_follow(), e, explist(), FuncState::freereg, LexState::fs, GETARG_A, getinstruction, hasmultret, expdesc::k, lua_assert, LUA_MULTRET, luaK_exp2anyreg(), luaK_exp2nextreg(), luaK_ret(), luaK_setmultret, FuncState::nactvar, OP_TAILCALL, SET_OPCODE, LexState::t, testnext(), Token::token, and VCALL.
Referenced by statement().
Definition at line 218 of file lparser.cpp.
References eqstr, FuncState::f, i, FuncState::nups, and Proto::upvalues.
Referenced by singlevaraux().
Definition at line 244 of file lparser.cpp.
References cast_int, eqstr, getlocvar(), i, and FuncState::nactvar.
Referenced by singlevaraux().
Definition at line 67 of file lparser.cpp.
References luaX_syntaxerror(), LexState::t, and Token::token.
Referenced by checkrepeated(), closegoto(), and undefgoto().
Definition at line 932 of file lparser.cpp.
References body(), check_condition, codestring(), constructor(), FuncState::f, LexState::fs, SemInfo::i, init_exp(), Proto::is_vararg, expdesc::ival, LexState::linenumber, luaK_codeABC(), luaX_next(), expdesc::nval, OP_VARARG, SemInfo::r, Token::seminfo, suffixedexp(), LexState::t, TK_DOTS, TK_FALSE, TK_FLT, TK_FUNCTION, TK_INT, TK_NIL, TK_STRING, TK_TRUE, Token::token, SemInfo::ts, expdesc::u, VFALSE, VKFLT, VKINT, VNIL, VTRUE, and VVARARG.
Referenced by subexpr().
Definition at line 295 of file lparser.cpp.
References codestring(), LexState::envn, LexState::fs, expdesc::k, lua_assert, luaK_indexed(), singlevaraux(), str_checkname(), and VVOID.
Referenced by funcname(), and primaryexp().
Definition at line 270 of file lparser.cpp.
References init_exp(), expdesc::k, markupval(), newupvalue(), FuncState::prev, searchupvalue(), searchvar(), VLOCAL, VUPVAL, and VVOID.
Referenced by singlevar().
|
static |
Definition at line 1218 of file lparser.cpp.
References statement(), LexState::t, TK_DBCOLON, and Token::token.
Referenced by labelstat().
|
static |
Definition at line 1538 of file lparser.cpp.
References block(), check_match(), enterlevel(), exprstat(), FuncState::f, forstat(), FuncState::freereg, LexState::fs, funcstat(), gotostat(), ifstat(), labelstat(), leavelevel, LexState::linenumber, localfunc(), localstat(), lua_assert, luaK_jump(), luaX_next(), Proto::maxstacksize, FuncState::nactvar, repeatstat(), retstat(), str_checkname(), LexState::t, testnext(), TK_BREAK, TK_DBCOLON, TK_DO, TK_END, TK_FOR, TK_FUNCTION, TK_GOTO, TK_IF, TK_LOCAL, TK_REPEAT, TK_RETURN, TK_WHILE, Token::token, and whilestat().
Referenced by skipnoopstat(), and statlist().
|
static |
Definition at line 599 of file lparser.cpp.
References block_follow(), statement(), LexState::t, TK_RETURN, and Token::token.
Referenced by block(), body(), mainfunc(), repeatstat(), and test_then_block().
Definition at line 135 of file lparser.cpp.
References check(), luaX_next(), Token::seminfo, LexState::t, TK_NAME, and SemInfo::ts.
Referenced by checkname(), forlist(), forstat(), gotostat(), localfunc(), localstat(), parlist(), singlevar(), and statement().
Definition at line 1049 of file lparser.cpp.
References enterlevel(), LexState::fs, getbinopr(), getunopr(), leavelevel, left, LexState::linenumber, luaK_infix(), luaK_posfix(), luaK_prefix(), luaX_next(), OPR_NOBINOPR, OPR_NOUNOPR, priority, right, simpleexp(), LexState::t, Token::token, and UNARY_PRIORITY.
Referenced by expr().
Definition at line 894 of file lparser.cpp.
References checkname(), fieldsel(), LexState::fs, funcargs(), LexState::linenumber, luaK_exp2anyregup(), luaK_exp2nextreg(), luaK_indexed(), luaK_self(), luaX_next(), primaryexp(), LexState::t, TK_STRING, Token::token, and yindex().
Referenced by assignment(), exprstat(), and simpleexp().
|
static |
Definition at line 1383 of file lparser.cpp.
References block_follow(), checknext(), enterblock(), expr(), expdesc::f, LexState::fs, gotostat(), leaveblock(), luaK_concat(), luaK_goiffalse(), luaK_goiftrue(), luaK_jump(), luaK_patchtohere(), luaX_next(), statlist(), expdesc::t, LexState::t, testnext(), TK_BREAK, TK_ELSE, TK_ELSEIF, TK_GOTO, TK_THEN, Token::token, and LHS_assign::v.
Referenced by ifstat().
|
static |
Definition at line 97 of file lparser.cpp.
References luaX_next(), LexState::t, and Token::token.
Referenced by assignment(), check_match(), constructor(), explist(), forlist(), fornum(), gotostat(), ifstat(), localstat(), parlist(), retstat(), statement(), and test_then_block().
Definition at line 464 of file lparser.cpp.
References getstr, isreserved, LexState::L, Labeldesc::line, luaO_pushfstring(), wfl::msg(), Labeldesc::name, and semerror().
Referenced by leaveblock().
|
static |
Definition at line 1242 of file lparser.cpp.
References block(), check_match(), checknext(), cond(), enterblock(), LexState::fs, leaveblock(), luaK_getlabel(), luaK_jumpto, luaK_patchtohere(), luaX_next(), TK_DO, TK_END, and TK_WHILE.
Referenced by statement().
Definition at line 622 of file lparser.cpp.
References checknext(), expr(), LexState::fs, luaK_exp2val(), and luaX_next().
Referenced by recfield(), and suffixedexp().
lu_byte left |
Definition at line 1027 of file lparser.cpp.
Referenced by display::rect_of_hexes::begin(), gui2::implementation::builder_matrix::builder_matrix(), wfl::dot_expression::execute(), wfl::square_bracket_expression::execute(), wfl::operator_expression::execute(), impl_color_equality(), impl_unit_equality(), lua_stringx::intf_str_paren_split(), lua_stringx::intf_str_split(), lua_wml::intf_wml_equal(), utils::parenthetical_split(), process_command_args(), gui2::dialogs::mp_lobby::process_gamelist_diff(), editor::context_manager::refresh_all(), unit::set_attacks(), utils::set_split(), lua_gui2::show_message_dialog(), special_locations_index(), special_locations_next(), utils::square_parenthetical_split(), subexpr(), unit_weapons(), gui2::dialogs::editor_resize_map::update_expand_direction(), and tracer::printer::~printer().
const { ... } priority[] |
Referenced by ai::stage_unit_formulas::do_play_stage(), and subexpr().
lu_byte right |
Definition at line 1028 of file lparser.cpp.
Referenced by gui2::implementation::builder_matrix::builder_matrix(), gui::textbox::draw_contents(), display::rect_of_hexes::end(), wfl::operator_expression::execute(), filesystem::get_next_filename(), impl_color_equality(), impl_unit_equality(), lua_stringx::intf_str_paren_split(), lua_stringx::intf_str_split(), lua_wml::intf_wml_equal(), utils::parenthetical_split(), process_command_args(), utils::set_split(), lua_gui2::show_message_dialog(), utils::square_parenthetical_split(), subexpr(), gui2::dialogs::editor_resize_map::update_expand_direction(), and tracer::printer::~printer().