luaY_parser¶
lparser.cpp
https://www.cnblogs.com/nazhizq/p/6516561.html
Proto *luaY_parser(lua_State *L, ZIO *z, Mbuffer *buff, const char *name)
{
struct LexState lexstate;
struct FuncState funcstate;
lexstate.buff = buff;
luaX_setinput(L, &lexstate, z, luaS_new(L, name));
// begin
open_func(&lexstate, &funcstate);
funcstate.f->is_vararg = VARARG_ISVARARG; /* main func. is always vararg */
luaX_next(&lexstate); /* read first token */
chunk(&lexstate);
check(&lexstate, TK_EOS);
close_func(&lexstate);
// end
lua_assert(funcstate.prev == NULL);
lua_assert(funcstate.f->nups == 0);
lua_assert(lexstate.fs == NULL);
return funcstate.f;
}
open_func¶
luaX_next¶
llex.cpp
もろもろパースする。
パーサー。