diff --git a/c_src/egs_prs_drv.c b/apps/egs/c_src/egs_prs_drv.c
similarity index 100%
rename from c_src/egs_prs_drv.c
rename to apps/egs/c_src/egs_prs_drv.c
diff --git a/c_src/prs.c b/apps/egs/c_src/prs.c
similarity index 100%
rename from c_src/prs.c
rename to apps/egs/c_src/prs.c
diff --git a/include/records.hrl b/apps/egs/include/records.hrl
similarity index 100%
rename from include/records.hrl
rename to apps/egs/include/records.hrl
diff --git a/apps/egs/priv/egs_drv.so b/apps/egs/priv/egs_drv.so
new file mode 100755
index 0000000..383ae83
Binary files /dev/null and b/apps/egs/priv/egs_drv.so differ
diff --git a/apps/egs/rebar.config b/apps/egs/rebar.config
new file mode 100644
index 0000000..6d687c8
--- /dev/null
+++ b/apps/egs/rebar.config
@@ -0,0 +1,4 @@
+{deps, [
+ {ex_reloader, ".*", {git, "git://github.com/extend/ex_reloader.git", "HEAD"}},
+ {cowboy, ".*", {git, "git://github.com/extend/cowboy.git", "HEAD"}}
+]}.
diff --git a/src/egs.app.src b/apps/egs/src/egs.app.src
similarity index 100%
rename from src/egs.app.src
rename to apps/egs/src/egs.app.src
diff --git a/src/egs.erl b/apps/egs/src/egs.erl
similarity index 100%
rename from src/egs.erl
rename to apps/egs/src/egs.erl
diff --git a/src/egs_accounts.erl b/apps/egs/src/egs_accounts.erl
similarity index 100%
rename from src/egs_accounts.erl
rename to apps/egs/src/egs_accounts.erl
diff --git a/src/egs_app.erl b/apps/egs/src/egs_app.erl
similarity index 100%
rename from src/egs_app.erl
rename to apps/egs/src/egs_app.erl
diff --git a/src/egs_char_select.erl b/apps/egs/src/egs_char_select.erl
similarity index 100%
rename from src/egs_char_select.erl
rename to apps/egs/src/egs_char_select.erl
diff --git a/src/egs_conf.erl b/apps/egs/src/egs_conf.erl
similarity index 100%
rename from src/egs_conf.erl
rename to apps/egs/src/egs_conf.erl
diff --git a/src/egs_counters_db.erl b/apps/egs/src/egs_counters_db.erl
similarity index 100%
rename from src/egs_counters_db.erl
rename to apps/egs/src/egs_counters_db.erl
diff --git a/src/egs_files.erl b/apps/egs/src/egs_files.erl
similarity index 100%
rename from src/egs_files.erl
rename to apps/egs/src/egs_files.erl
diff --git a/src/egs_game.erl b/apps/egs/src/egs_game.erl
similarity index 100%
rename from src/egs_game.erl
rename to apps/egs/src/egs_game.erl
diff --git a/src/egs_game_protocol.erl b/apps/egs/src/egs_game_protocol.erl
similarity index 92%
rename from src/egs_game_protocol.erl
rename to apps/egs/src/egs_game_protocol.erl
index 081e230..9e4c0aa 100644
--- a/src/egs_game_protocol.erl
+++ b/apps/egs/src/egs_game_protocol.erl
@@ -18,12 +18,12 @@
%% along with EGS. If not, see .
-module(egs_game_protocol).
--export([start_link/3, init/2]).
+-export([start_link/4, init/2]).
-include("include/records.hrl").
--spec start_link(ssl:sslsocket(), module(), []) -> {ok, pid()}.
-start_link(Socket, Transport, []) ->
+-spec start_link(pid(), ssl:sslsocket(), module(), []) -> {ok, pid()}.
+start_link(_ListenerPid, Socket, Transport, []) ->
Pid = spawn_link(?MODULE, init, [Socket, Transport]),
{ok, Pid}.
diff --git a/src/egs_items_db.erl b/apps/egs/src/egs_items_db.erl
similarity index 100%
rename from src/egs_items_db.erl
rename to apps/egs/src/egs_items_db.erl
diff --git a/src/egs_login.erl b/apps/egs/src/egs_login.erl
similarity index 100%
rename from src/egs_login.erl
rename to apps/egs/src/egs_login.erl
diff --git a/src/egs_login_protocol.erl b/apps/egs/src/egs_login_protocol.erl
similarity index 88%
rename from src/egs_login_protocol.erl
rename to apps/egs/src/egs_login_protocol.erl
index 5a2bc05..2a21ccc 100644
--- a/src/egs_login_protocol.erl
+++ b/apps/egs/src/egs_login_protocol.erl
@@ -18,12 +18,12 @@
%% along with EGS. If not, see .
-module(egs_login_protocol).
--export([start_link/3, init/2]).
+-export([start_link/4, init/2]).
-include("include/records.hrl").
--spec start_link(ssl:sslsocket(), module(), []) -> {ok, pid()}.
-start_link(Socket, Transport, []) ->
+-spec start_link(pid(), ssl:sslsocket(), module(), []) -> {ok, pid()}.
+start_link(_ListenerPid, Socket, Transport, []) ->
Pid = spawn_link(?MODULE, init, [Socket, Transport]),
{ok, Pid}.
diff --git a/src/egs_network.erl b/apps/egs/src/egs_network.erl
similarity index 100%
rename from src/egs_network.erl
rename to apps/egs/src/egs_network.erl
diff --git a/src/egs_npc_db.erl b/apps/egs/src/egs_npc_db.erl
similarity index 100%
rename from src/egs_npc_db.erl
rename to apps/egs/src/egs_npc_db.erl
diff --git a/src/egs_patch_files_db.erl b/apps/egs/src/egs_patch_files_db.erl
similarity index 100%
rename from src/egs_patch_files_db.erl
rename to apps/egs/src/egs_patch_files_db.erl
diff --git a/src/egs_patch_protocol.erl b/apps/egs/src/egs_patch_protocol.erl
similarity index 98%
rename from src/egs_patch_protocol.erl
rename to apps/egs/src/egs_patch_protocol.erl
index fa17267..9df46d6 100644
--- a/src/egs_patch_protocol.erl
+++ b/apps/egs/src/egs_patch_protocol.erl
@@ -18,7 +18,7 @@
%% along with EGS. If not, see .
-module(egs_patch_protocol).
--export([start_link/3, init/2]).
+-export([start_link/4, init/2]).
-define(TIMEOUT, 5000).
@@ -33,8 +33,8 @@
-type cmd() :: 0..16#14.
-type cmd_size() :: 0..16#ffffffff.
--spec start_link(inet:socket(), module(), []) -> {ok, pid()}.
-start_link(Socket, Transport, []) ->
+-spec start_link(pid(), inet:socket(), module(), []) -> {ok, pid()}.
+start_link(_ListenerPid, Socket, Transport, []) ->
Pid = spawn_link(?MODULE, init, [Socket, Transport]),
{ok, Pid}.
diff --git a/src/egs_proto.erl b/apps/egs/src/egs_proto.erl
similarity index 100%
rename from src/egs_proto.erl
rename to apps/egs/src/egs_proto.erl
diff --git a/src/egs_prs.erl b/apps/egs/src/egs_prs.erl
similarity index 100%
rename from src/egs_prs.erl
rename to apps/egs/src/egs_prs.erl
diff --git a/src/egs_quests.erl b/apps/egs/src/egs_quests.erl
similarity index 100%
rename from src/egs_quests.erl
rename to apps/egs/src/egs_quests.erl
diff --git a/src/egs_quests_db.erl b/apps/egs/src/egs_quests_db.erl
similarity index 100%
rename from src/egs_quests_db.erl
rename to apps/egs/src/egs_quests_db.erl
diff --git a/src/egs_quests_sup.erl b/apps/egs/src/egs_quests_sup.erl
similarity index 100%
rename from src/egs_quests_sup.erl
rename to apps/egs/src/egs_quests_sup.erl
diff --git a/src/egs_script_compiler.erl b/apps/egs/src/egs_script_compiler.erl
similarity index 100%
rename from src/egs_script_compiler.erl
rename to apps/egs/src/egs_script_compiler.erl
diff --git a/apps/egs/src/egs_script_lexer.erl b/apps/egs/src/egs_script_lexer.erl
new file mode 100644
index 0000000..348488f
--- /dev/null
+++ b/apps/egs/src/egs_script_lexer.erl
@@ -0,0 +1,1076 @@
+-file("/usr/lib/erlang/lib/parsetools-2.0.6/include/leexinc.hrl", 0).
+%% The source of this file is part of leex distribution, as such it
+%% has the same Copyright as the other files in the leex
+%% distribution. The Copyright is defined in the accompanying file
+%% COPYRIGHT. However, the resultant scanner generated by leex is the
+%% property of the creator of the scanner and is not covered by that
+%% Copyright.
+
+-module(egs_script_lexer).
+
+-export([string/1,string/2,token/2,token/3,tokens/2,tokens/3]).
+-export([format_error/1]).
+
+%% User code. This is placed here to allow extra attributes.
+-file("src/egs_script_lexer.xrl", 46).
+
+%% Reserved words.
+reserved_word("debug") -> debug;
+%% Definitions.
+reserved_word("event") -> event_def;
+reserved_word("function") -> function_def;
+reserved_word("num_var") -> num_var;
+reserved_word("str_var") -> str_var;
+%% Low level opcodes.
+reserved_word("abs") -> abs;
+reserved_word("add") -> add;
+reserved_word("band") -> 'band';
+reserved_word("bor") -> 'bor';
+reserved_word("bxor") -> 'bxor';
+reserved_word("dec") -> dec;
+reserved_word("div") -> 'div';
+reserved_word("inc") -> inc;
+reserved_word("is_eq") -> is_eq;
+reserved_word("is_gt") -> is_gt;
+reserved_word("is_gteq") -> is_gteq;
+reserved_word("is_lt") -> is_lt;
+reserved_word("is_lteq") -> is_lteq;
+reserved_word("is_neq") -> is_neq;
+reserved_word("jmp") -> jmp;
+reserved_word("jnz") -> jnz;
+reserved_word("jz") -> jz;
+reserved_word("land") -> land;
+reserved_word("lor") -> lor;
+reserved_word("lshift") -> lshift;
+reserved_word("mod") -> mod;
+reserved_word("mul") -> mul;
+reserved_word("neg") -> neg;
+reserved_word("nop") -> nop;
+reserved_word("num_get") -> num_get;
+reserved_word("num_set") -> num_set;
+reserved_word("push") -> push;
+reserved_word("restore") -> restore;
+reserved_word("return") -> return;
+reserved_word("rshift") -> rshift;
+reserved_word("save") -> save;
+reserved_word("savep") -> savep;
+reserved_word("str_get") -> str_get;
+reserved_word("str_set") -> str_set;
+reserved_word("sub") -> sub;
+%% Case statement.
+reserved_word("case") -> 'case';
+reserved_word("default") -> default;
+reserved_word("end") -> 'end';
+%% Otherwise isn't a reserved word.
+reserved_word(_) -> false.
+
+%% Syscalls.
+syscall("mes.fukidasi_pc") -> {100, sync};
+syscall("mes.fukidasi_apc") -> {101, sync};
+syscall("mes.fukidasi_npc") -> {102, sync};
+syscall("mes.fukidasi_pc_type") -> {103, sync};
+syscall("mes.fukidasi_apc_type") -> {104, sync};
+syscall("mes.fukidasi_npc_type") -> {105, sync};
+syscall("mes.fukidasi_custom") -> {106, sync};
+syscall("mes.erase_fukidasi") -> {107, async};
+syscall("mes.chat_pc") -> {108, async};
+syscall("mes.cut_in_chat") -> {109, async};
+syscall("mes.cut_in_chat_custom") -> {110, async};
+syscall("mes.system_win") -> {111, sync};
+syscall("mes.custom_win") -> {112, sync};
+syscall("mes.scroll_win") -> {113, sync};
+syscall("mes.win_move") -> {114, async};
+syscall("mes.erase_system_win") -> {115, async};
+syscall("mes.select_win") -> {116, sync};
+syscall("mes.select_win_set") -> {117, sync};
+syscall("mes.select_win_single") -> {118, sync};
+syscall("mes.select_win_custom") -> {119, sync};
+syscall("mes.select_win_fukidasi") -> {120, sync};
+syscall("mes.select_win_b") -> {121, sync};
+syscall("mes.select_win_set_b") -> {122, sync};
+syscall("mes.select_win_single_b") -> {123, sync};
+syscall("mes.select_win_custom_b") -> {124, sync};
+syscall("mes.select_win_fukidasi_b") -> {125, sync};
+syscall("mes.erase_select_win") -> {126, sync};
+syscall("mes.message_end") -> {127, async};
+syscall("mes.set_name_npc") -> {128, async};
+syscall("mes.set_color_npc") -> {129, async};
+syscall("mes.line_window") -> {130, async};
+syscall("adv.cut_in") -> {131, async};
+syscall("adv.cut_in_custom") -> {132, async};
+syscall("adv.window_disable") -> {133, async};
+syscall("adv.window_enable") -> {134, async};
+syscall("adv.fukidasi_disable") -> {135, async};
+syscall("adv.fukidasi_enable") -> {136, async};
+syscall("adv.player_disable") -> {137, async};
+syscall("adv.player_enable") -> {138, async};
+syscall("adv.chat_on") -> {139, async};
+syscall("adv.chat_off") -> {140, async};
+syscall("adv.mainmenu_disable") -> {141, async};
+syscall("adv.mainmenu_enable") -> {142, async};
+syscall("unit_flag.on") -> {143, async};
+syscall("unit_flag.off") -> {144, async};
+syscall("unit_flag.reverse") -> {145, async};
+syscall("unit_flag.delay_on") -> {146, async};
+syscall("unit_flag.delay_off") -> {147, async};
+syscall("unit_flag.delay_reverse") -> {148, async};
+syscall("unit_flag.chk") -> {149, async};
+syscall("player.get_my_id") -> {150, async};
+syscall("player.set_pos") -> {151, async};
+syscall("player.change_unit") -> {152, async};
+syscall("player.turn") -> {153, async};
+syscall("player.walk") -> {154, async};
+syscall("player.run") -> {155, async};
+syscall("player.pad_off") -> {158, async};
+syscall("player.pad_on") -> {159, async};
+syscall("player.get_pos") -> {160, async};
+syscall("player.get_ang") -> {161, async};
+syscall("player.turn_coord") -> {162, async};
+syscall("player.turn_member") -> {163, async};
+syscall("plymotion.item_take_off") -> {173, async};
+syscall("plymotion.set_pack") -> {174, sync};
+syscall("plymotion.release_pack") -> {176, async};
+syscall("plymotion.set_loop") -> {177, async};
+syscall("plymotion.play_one_shot") -> {178, sync};
+syscall("plymotion.cancel_one_shot") -> {179, async};
+syscall("plymotion.restart_one_shot") -> {180, async};
+syscall("apc.create") -> {183, sync};
+syscall("apc.delete") -> {184, async};
+syscall("apc.delete_inx") -> {185, async};
+syscall("apc.team_into") -> {186, async};
+syscall("apc.team_remove") -> {187, async};
+syscall("apc.set_pos") -> {188, async};
+syscall("apc.turn") -> {189, async};
+syscall("apc.walk") -> {190, async};
+syscall("apc.run") -> {191, async};
+syscall("apc.think_off") -> {194, async};
+syscall("apc.think_on") -> {195, async};
+syscall("apc.get_pos") -> {196, async};
+syscall("apc.get_ang") -> {197, async};
+syscall("apc.reserve") -> {205, async};
+syscall("apc.reserve_cancel") -> {206, async};
+syscall("apc.is_reserve") -> {207, async};
+syscall("apc.create_lv") -> {208, sync};
+syscall("apc.reserve_lv") -> {209, async};
+syscall("apc.target_guard") -> {210, async};
+syscall("apc.target_guard_pid") -> {211, async};
+syscall("apc.target_guard_aid") -> {212, async};
+syscall("apc.cancel_target_guard") -> {213, async};
+syscall("apc.set_move_out_party") -> {214, async};
+syscall("apc.apc_set_ban") -> {215, async};
+syscall("apc.get_aid_from_pid") -> {216, async};
+syscall("apc.is_apc2") -> {217, async};
+syscall("apc.is_alive") -> {218, async};
+syscall("camera.set") -> {219, async};
+syscall("camera.move") -> {220, async};
+syscall("camera.release") -> {221, async};
+syscall("camera.get_pos") -> {222, async};
+syscall("camera.cam_rot") -> {223, async};
+syscall("camera.target_rot") -> {224, async};
+syscall("camera.dist_move") -> {225, async};
+syscall("camera.get_cam_angle") -> {226, async};
+syscall("camera.get_target_angle") -> {227, async};
+syscall("camera.get_dist") -> {228, async};
+syscall("camera.set_quake") -> {229, async};
+syscall("camera.stop_quake") -> {230, async};
+syscall("direction.fade_in") -> {232, async};
+syscall("direction.fade_out") -> {233, async};
+syscall("direction.fade_out_rgba") -> {234, async};
+syscall("direction.cinema_on") -> {235, async};
+syscall("direction.cinema_off") -> {236, async};
+syscall("direction.vib") -> {237, async};
+syscall("wait.abort_cancel") -> {238, async};
+syscall("temp.exit_game") -> {239, async};
+syscall("movie.play_prm") -> {240, sync};
+syscall("movie.play_rtm") -> {242, sync};
+syscall("movie.play_event") -> {245, sync};
+syscall("movie.play_sub_title") -> {246, sync};
+syscall("movie.telop") -> {247, sync};
+syscall("sound.play_se") -> {251, async};
+syscall("sound.play_bgm") -> {253, async}; %% Unofficial name.
+syscall("sound.stop_bgm") -> {256, async};
+syscall("render.scene_off") -> {257, async};
+syscall("render.scene_on") -> {258, async};
+syscall("render.npc_all_off") -> {259, async};
+syscall("render.npc_all_on") -> {260, async};
+syscall("render.npc_off") -> {261, async};
+syscall("render.npc_on") -> {262, async};
+syscall("render.player_off") -> {263, async};
+syscall("render.player_on") -> {264, async};
+syscall("render.enemy_off") -> {265, async};
+syscall("render.enemy_on") -> {266, async};
+syscall("render.obj_off") -> {267, async};
+syscall("render.obj_on") -> {268, async};
+syscall("seq.get_quest") -> {271, async};
+syscall("seq.is_online") -> {272, async};
+syscall("seq.save_qst") -> {273, sync};
+syscall("seq.get_area") -> {274, async};
+syscall("seq.get_zone") -> {275, async};
+syscall("seq.get_unit") -> {276, async};
+syscall("seq.get_item") -> {280, sync};
+syscall("work.accountwork_get") -> {282, sync};
+syscall("work.accountwork_set") -> {283, sync};
+syscall("work.chrwork_get") -> {284, sync};
+syscall("work.chrwork_set") -> {285, sync};
+syscall("work.chrflag_get") -> {286, sync};
+syscall("work.chrflag_set") -> {287, sync};
+syscall("work.partyflag_on") -> {288, sync};
+syscall("work.partyflag_off") -> {289, sync};
+syscall("work.qstwork_get") -> {290, async};
+syscall("work.qstwork_get_member") -> {291, async};
+syscall("work.qstwork_set") -> {292, async};
+syscall("work.partyflag_get") -> {297, async};
+syscall("work.partywork_get") -> {298, async};
+syscall("work.partywork_set") -> {299, async};
+syscall("work.zone_cndflag_get") -> {300, async};
+syscall("work.zone_cndflag_on") -> {301, async};
+syscall("work.zone_cndflag_off") -> {302, async};
+syscall("work.zone_sendwork_get") -> {303, async};
+syscall("work.zone_sendwork_set") -> {304, async};
+syscall("work.party_rand_get") -> {305, sync};
+syscall("party.get_member") -> {306, async};
+syscall("party.get_leader") -> {307, async};
+syscall("party.chk_exist") -> {308, async};
+syscall("party.sync_wait") -> {309, sync};
+syscall("party.join_on") -> {310, async};
+syscall("party.join_off") -> {311, async};
+syscall("party.get_enemy_kill") -> {312, async};
+syscall("ptcl.create") -> {315, async};
+syscall("ptcl.move") -> {316, async};
+syscall("ptcl.delete") -> {317, async};
+syscall("col.create") -> {318, async};
+syscall("col.create_lock_on") -> {319, async};
+syscall("col.create_attack") -> {320, async};
+syscall("col.move") -> {321, async};
+syscall("col.scale") -> {322, async};
+syscall("col.delete") -> {323, async};
+syscall("npc.talk_on") -> {324, async};
+syscall("npc.talk_off") -> {325, async};
+syscall("npc.think_on") -> {326, async};
+syscall("npc.think_off") -> {327, async};
+syscall("npc.set_pos") -> {328, async};
+syscall("npc.turn") -> {329, async};
+syscall("npc.gaze") -> {330, async};
+syscall("npc.walk") -> {331, async};
+syscall("npc.run") -> {332, async};
+syscall("npc.walk_path") -> {335, async};
+syscall("npc.run_path") -> {336, async};
+syscall("npc.get_pos") -> {338, async};
+syscall("npc.get_ang") -> {339, async};
+syscall("npc.cng_motion") -> {340, async};
+syscall("npc.cancel_motion") -> {341, async};
+syscall("npc.get_motion") -> {342, async};
+syscall("npc.coli_end") -> {343, async};
+syscall("obj.coli_end") -> {347, async}; %% Unofficial name.
+syscall("status.get_posflag") -> {354, async};
+syscall("lobby.start") -> {356, sync};
+syscall("lobby.end") -> {357, async};
+syscall("lobby.select_planet") -> {358, sync};
+syscall("camera.def_cng") -> {359, async};
+syscall("camera.def_remove") -> {360, async};
+syscall("camera.def_move_back") -> {361, async};
+syscall("camera.def_set_back") -> {362, async};
+syscall("camera.def_set_quake") -> {364, async};
+syscall("camera.def_stop_qake") -> {365, async};
+syscall("calc.get_rot") -> {373, async};
+syscall("sjis.fukidasi_pc") -> {389, sync};
+syscall("sjis.fukidasi_apc") -> {390, sync};
+syscall("sjis.fukidasi_npc") -> {391, sync};
+syscall("sjis.fukidasi_pc_type") -> {392, sync};
+syscall("sjis.fukidasi_apc_type") -> {393, sync};
+syscall("sjis.fukidasi_npc_type") -> {394, sync};
+syscall("sjis.fukidasi_custom") -> {395, sync};
+syscall("sjis.chat_pc") -> {396, async};
+syscall("sjis.cut_in_chat") -> {397, async};
+syscall("sjis.cut_in_chat_custom") -> {398, async};
+syscall("sjis.system_win") -> {399, sync};
+syscall("sjis.custom_win") -> {400, sync};
+syscall("sjis.scroll_win") -> {401, sync};
+syscall("sjis.select_win") -> {402, sync};
+syscall("sjis.select_win_set") -> {403, sync};
+syscall("sjis.select_win_single") -> {404, sync};
+syscall("sjis.select_win_custom") -> {405, sync};
+syscall("sjis.select_win_fukidasi") -> {406, sync};
+syscall("sjis.select_win_b") -> {407, sync};
+syscall("sjis.select_win_set_b") -> {408, sync};
+syscall("sjis.select_win_single_b") -> {409, sync};
+syscall("sjis.select_win_custom_b") -> {410, sync};
+syscall("sjis.select_win_fukidasi_b") -> {411, sync};
+syscall("sjis.line_window") -> {412, async};
+syscall("temp.line") -> {413, async};
+syscall("temp.sline") -> {414, async};
+syscall(_) -> false.
+
+%% Functions.
+function("adv.cut_in_load") -> {"q.adv.cut_in_load", async};
+function("adv.cut_in_noise") -> {"q.adv.cut_in_noise", async};
+function("adv.cut_in_release") -> {"q.adv.cut_in_release", async};
+function("adv.cut_in_stop") -> {"q.adv.cut_in_stop", async};
+%% @todo apc.apc_sp_exec
+%% @todo q.apc.create_ex
+function("apc.get_reserve_aid_all") -> {"apc.get_reserve_aid_all", async};
+function("apc.get_reserve_count") -> {"apc.get_reserve_count", async};
+function("apc.guildcard_disable") -> {"apc.guildcard_disable", async};
+function("apc.guildcard_enable") -> {"apc.guildcard_enable", async};
+function("apc.impossible_join_pt") -> {"apc.impossible_join_pt", async};
+function("apc.is_set_ban") -> {"apc.is_set_ban", async};
+%% @todo apc.move
+%% @todo apc.move_xz
+function("apc.possible_join_pt") -> {"apc.possible_join_pt", async};
+%% @todo apc.set_goal_out_party
+function("apc.set_sp_ban") -> {"apc.set_sp_ban", async};
+function("apc.set_talk_ban") -> {"apc.set_talk_ban", async};
+function("counter.create_dc_map") -> {"counter.create_dc_map", async};
+function("counter.delete_dc_map") -> {"counter.delete_dc_map", async};
+function("counter.set_arrow_pos") -> {"counter.set_arrow_pos", async};
+function("counter.set_lookon_pos") -> {"counter.set_lookon_pos", async};
+function("direction.fade_out_nowloading") -> {"direction.fade_out_nowloading", async};
+function("font.set_party_member_id") -> {"font.set_party_member_id", async};
+function("item.exchange") -> {"q.seq.exchange_item", sync};
+function("item.get_num") -> {"q.seq.get_item_num", sync};
+function("item.get_slot_num_req") -> {"q.item.get_slot_num_req", sync};
+function("item.get_slot_num_ret") -> {"q.item.get_slot_num_ret", async};
+%% @todo item.set_ability
+function("mes.mes_broadcast_clear") -> {"mes.mes_broadcast_clear", async};
+%% @todo mes.mes_broadcast_clear_all
+function("mes.mes_broadcast_set") -> {"mes.mes_broadcast_set", async};
+function("mes.line_window_time") -> {"q.mes.line_window_line_time", async};
+function("mes.select_win_number") -> {"q.mes.select_win_number", sync};
+function("movie.text_prm_delay") -> {"movie.text_prm_delay", async};
+function("myroom.check_data_load") -> {"myroom.check_data_load", async};
+function("myroom.disable_obj_ex") -> {"myroom.disable_obj_ex", async};
+function("myroom.get_move_planet") -> {"myroom.get_move_planet", async};
+function("myroom.get_probo_ang") -> {"myroom.get_probo_ang", async};
+function("myroom.get_probo_pos") -> {"myroom.get_probo_pos", async};
+function("myroom.get_probo_rank") -> {"myroom.get_probo_rank", async};
+function("myroom.news_enable") -> {"myroom.news_enable", async};
+%% @todo myroom.get_probo_type
+function("npc.gaze_cancel") -> {"npc.gaze_cancel", async};
+%% @todo npc.get_head_y
+function("npc.is_load_comp") -> {"npc.is_load_comp", async};
+%% @todo q.npc.run_fast
+%% @todo npc.run_xz_fast
+%% @todo q.npc.walk_fast
+%% @todo npc.walk_xz_fast
+%% @todo obj.chair_disable
+%% @todo obj.chair_enable
+function("obj.get_eventflag") -> {"obj.get_eventflag", async};
+function("obj.set_caption") -> {"obj.set_caption", async};
+function("obj.vehicle_resetpos") -> {"obj.vehicle_resetpos", async};
+function("player.display") -> {"player.display", async};
+function("player.disp_off_except_party") -> {"player.disp_off_except_party", async};
+function("player.disp_on_except_party") -> {"player.disp_on_except_party", async};
+function("player.face_set") -> {"player.face_set", async};
+%% @todo player.gaze_body
+%% @todo player.get_action
+function("player.get_level") -> {"player.get_level", async};
+function("player.get_my_pmid") -> {"q.player.get_my_pmid", async};
+function("player.get_occupation") -> {"player.get_occupation", async};
+function("player.get_off_vehicle") -> {"player.get_off_vehicle", async};
+%% @todo player.get_on_vehicle
+function("player.get_race") -> {"player.get_race", async};
+function("player.get_sex") -> {"player.get_sex", async};
+function("player.hide") -> {"player.hide", async};
+function("player.is_dead") -> {"player.is_dead", async};
+%% @todo player.is_equipping_item
+function("player.is_in_sp") -> {"player.is_in_sp", async};
+function("player.is_on_vehicle") -> {"player.is_on_vehicle", async};
+%% @todo player.move
+%% @todo player.move_xz
+%% @todo player.set_vehicle_breakpos
+function("player.sp_cancel") -> {"player.sp_cancel", async};
+%% @todo player.turn_round
+%% @todo player.turn_round_coord_xz
+function("plymotion.can_i_set_event_pack") -> {"plymotion.can_i_set_event_pack", async};
+%% @todo plymotion.get_pack
+function("plymotion.is_ready") -> {"plymotion.is_ready", async};
+function("plymotion.item_re_equip") -> {"plymotion.item_re_equip", async};
+%% @todo radar.display
+%% @todo radar.fullclose
+function("radar.fullopen") -> {"radar.fullopen", async};
+%% @todo radar.hide
+function("seq.endroll_play") -> {"q.seq.endroll_play", sync};
+%% @todo seq.get_death_count
+%% @todo seq.get_death_count_apc
+function("seq.get_destroy_enemy_count") -> {"seq.get_destroy_enemy_count", async};
+function("seq.get_elapsed_time") -> {"seq.get_elapsed_time", async};
+function("seq.get_judgement") -> {"seq.get_judgement", async};
+function("seq.get_mission_step") -> {"seq.get_mission_step", async};
+function("seq.get_rank") -> {"seq.get_rank", async};
+%% @todo seq.get_remaining_time
+%% @todo seq.get_setdata_inx
+%% @todo seq.goto_title
+function("seq.has_finished_result") -> {"seq.has_finished_result", async};
+function("seq.open_ex_mode") -> {"seq.open_ex_mode", async};
+function("seq.preview_network") -> {"q.seq.preview_network", sync};
+function("seq.preview_play") -> {"q.seq.preview_play", sync};
+function("seq.result") -> {"q.seq.result", async};
+function("seq.save_menu") -> {"q.seq.save_menu", sync};
+%% @todo seq.set_chapter_no
+function("seq.set_ex_chapter_no") -> {"seq.set_ex_chapter_no", async};
+%% @todo seq.set_story_end_flag
+function("seq.staffroll_play") -> {"q.seq.staffroll_play", sync};
+%% @todo q.seq.unify_counter
+function("shop.open") -> {"shop.open", async};
+%% @todo shop.req_load_data
+function("sjis.line_window_time") -> {"q.sjis.line_window_time", async};
+function("sound.check_jingle") -> {"sound.check_jingle", async};
+%% @todo sound.get_player_pack
+function("sound.load_enemy_pack") -> {"sound.load_enemy_pack", async};
+%% @todo sound.load_enemy_port_pack
+function("sound.load_event_pack") -> {"sound.load_event_pack", async};
+function("sound.load_player_pack") -> {"sound.load_player_pack", async};
+%% @todo sound.pause_adx_voice
+function("sound.pause_bgm") -> {"sound.pause_bgm", async};
+function("sound.play_jingle") -> {"sound.play_jingle", async};
+function("sound.play_se3d_loop_stop") -> {"sound.play_se3d_loop_stop", async};
+function("sound.play_se3d_loop_vol") -> {"sound.play_se3d_loop_vol", async};
+function("sound.play_player") -> {"q.sound.play_player", sync};
+function("sound.play_se3d") -> {"q.sound.play_se3d", sync};
+%% @todo sound.play_se3d_loop
+function("sound.play_se3d_vol") -> {"q.sound.play_se3d_vol", sync};
+function("sound.play_technique") -> {"sound.play_technique", async};
+function("sound.play_vehicle") -> {"sound.play_vehicle", async};
+function("sound.stop_adx_voice") -> {"sound.stop_adx_voice", async};
+function("system.frame_adjust") -> {"system.frame_adjust", async};
+%% @todo system.frame_default
+function("system.frame_get") -> {"system.frame_get", async};
+%% @todo system.frame_set
+function("system.get_episode") -> {"system.get_episode", async};
+%% @todo system.get_language
+function("system.get_platform") -> {"system.get_platform", async};
+function("system.get_resolution") -> {"system.get_resolution", async};
+function("work.get_stamp_bonus") -> {"q.work.get_stamp_bonus", sync};
+function("work.get_stamp_num") -> {"q.work.get_stamp_num", sync};
+function("work.get_stamp_quest") -> {"q.work.get_stamp_quest", sync};
+%% @todo q.work.on_accountwork_get
+function("work.partyworknum_get") -> {"q.work.partyworknum_get", async};
+function("work.partyworknum_set") -> {"q.work.partyworknum_set", async};
+%% @todo q.work.stamp_command
+function(Name) -> {Name, local}.
+
+%% Strings.
+string_gen([$\\|Cs]) ->
+ string_escape(Cs);
+string_gen([C|Cs]) ->
+ [C|string_gen(Cs)];
+string_gen([]) ->
+ [].
+
+string_escape([O1,O2,O3|S]) when O1 >= $0, O1 =< $7, O2 >= $0, O2 =< $7, O3 >= $0, O3 =< $7 ->
+ [(O1*8 + O2)*8 + O3 - 73*$0|string_gen(S)];
+string_escape([$^,C|Cs]) ->
+ [C band 31|string_gen(Cs)];
+string_escape([C|Cs]) when C >= $\000, C =< $\s ->
+ string_gen(Cs);
+string_escape([C|Cs]) ->
+ [escape_char(C)|string_gen(Cs)].
+
+escape_char($n) -> $\n; %% \n = LF
+escape_char($r) -> $\r; %% \r = CR
+escape_char($t) -> $\t; %% \t = TAB
+escape_char($v) -> $\v; %% \v = VT
+escape_char($b) -> $\b; %% \b = BS
+escape_char($f) -> $\f; %% \f = FF
+escape_char($e) -> $\e; %% \e = ESC
+escape_char($s) -> $\s; %% \s = SPC
+escape_char($d) -> $\d; %% \d = DEL
+escape_char(C) -> C.
+
+-file("/usr/lib/erlang/lib/parsetools-2.0.6/include/leexinc.hrl", 14).
+
+format_error({illegal,S}) -> ["illegal characters ",io_lib:write_string(S)];
+format_error({user,S}) -> S.
+
+string(String) -> string(String, 1).
+
+string(String, Line) -> string(String, Line, String, []).
+
+%% string(InChars, Line, TokenChars, Tokens) ->
+%% {ok,Tokens,Line} | {error,ErrorInfo,Line}.
+%% Note the line number going into yystate, L0, is line of token
+%% start while line number returned is line of token end. We want line
+%% of token start.
+
+string([], L, [], Ts) -> % No partial tokens!
+ {ok,yyrev(Ts),L};
+string(Ics0, L0, Tcs, Ts) ->
+ case yystate(yystate(), Ics0, L0, 0, reject, 0) of
+ {A,Alen,Ics1,L1} -> % Accepting end state
+ string_cont(Ics1, L1, yyaction(A, Alen, Tcs, L0), Ts);
+ {A,Alen,Ics1,L1,_S1} -> % Accepting transistion state
+ string_cont(Ics1, L1, yyaction(A, Alen, Tcs, L0), Ts);
+ {reject,_Alen,Tlen,_Ics1,L1,_S1} -> % After a non-accepting state
+ {error,{L0,?MODULE,{illegal,yypre(Tcs, Tlen+1)}},L1};
+ {A,Alen,_Tlen,_Ics1,L1,_S1} ->
+ string_cont(yysuf(Tcs, Alen), L1, yyaction(A, Alen, Tcs, L0), Ts)
+ end.
+
+%% string_cont(RestChars, Line, Token, Tokens)
+%% Test for and remove the end token wrapper. Push back characters
+%% are prepended to RestChars.
+
+string_cont(Rest, Line, {token,T}, Ts) ->
+ string(Rest, Line, Rest, [T|Ts]);
+string_cont(Rest, Line, {token,T,Push}, Ts) ->
+ NewRest = Push ++ Rest,
+ string(NewRest, Line, NewRest, [T|Ts]);
+string_cont(Rest, Line, {end_token,T}, Ts) ->
+ string(Rest, Line, Rest, [T|Ts]);
+string_cont(Rest, Line, {end_token,T,Push}, Ts) ->
+ NewRest = Push ++ Rest,
+ string(NewRest, Line, NewRest, [T|Ts]);
+string_cont(Rest, Line, skip_token, Ts) ->
+ string(Rest, Line, Rest, Ts);
+string_cont(Rest, Line, {skip_token,Push}, Ts) ->
+ NewRest = Push ++ Rest,
+ string(NewRest, Line, NewRest, Ts);
+string_cont(_Rest, Line, {error,S}, _Ts) ->
+ {error,{Line,?MODULE,{user,S}},Line}.
+
+%% token(Continuation, Chars) ->
+%% token(Continuation, Chars, Line) ->
+%% {more,Continuation} | {done,ReturnVal,RestChars}.
+%% Must be careful when re-entering to append the latest characters to the
+%% after characters in an accept. The continuation is:
+%% {token,State,CurrLine,TokenChars,TokenLen,TokenLine,AccAction,AccLen}
+
+token(Cont, Chars) -> token(Cont, Chars, 1).
+
+token([], Chars, Line) ->
+ token(yystate(), Chars, Line, Chars, 0, Line, reject, 0);
+token({token,State,Line,Tcs,Tlen,Tline,Action,Alen}, Chars, _) ->
+ token(State, Chars, Line, Tcs ++ Chars, Tlen, Tline, Action, Alen).
+
+%% token(State, InChars, Line, TokenChars, TokenLen, TokenLine,
+%% AcceptAction, AcceptLen) ->
+%% {more,Continuation} | {done,ReturnVal,RestChars}.
+%% The argument order is chosen to be more efficient.
+
+token(S0, Ics0, L0, Tcs, Tlen0, Tline, A0, Alen0) ->
+ case yystate(S0, Ics0, L0, Tlen0, A0, Alen0) of
+ %% Accepting end state, we have a token.
+ {A1,Alen1,Ics1,L1} ->
+ token_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline));
+ %% Accepting transition state, can take more chars.
+ {A1,Alen1,[],L1,S1} -> % Need more chars to check
+ {more,{token,S1,L1,Tcs,Alen1,Tline,A1,Alen1}};
+ {A1,Alen1,Ics1,L1,_S1} -> % Take what we got
+ token_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline));
+ %% After a non-accepting state, maybe reach accept state later.
+ {A1,Alen1,Tlen1,[],L1,S1} -> % Need more chars to check
+ {more,{token,S1,L1,Tcs,Tlen1,Tline,A1,Alen1}};
+ {reject,_Alen1,Tlen1,eof,L1,_S1} -> % No token match
+ %% Check for partial token which is error.
+ Ret = if Tlen1 > 0 -> {error,{Tline,?MODULE,
+ %% Skip eof tail in Tcs.
+ {illegal,yypre(Tcs, Tlen1)}},L1};
+ true -> {eof,L1}
+ end,
+ {done,Ret,eof};
+ {reject,_Alen1,Tlen1,Ics1,L1,_S1} -> % No token match
+ Error = {Tline,?MODULE,{illegal,yypre(Tcs, Tlen1+1)}},
+ {done,{error,Error,L1},Ics1};
+ {A1,Alen1,_Tlen1,_Ics1,L1,_S1} -> % Use last accept match
+ token_cont(yysuf(Tcs, Alen1), L1, yyaction(A1, Alen1, Tcs, Tline))
+ end.
+
+%% token_cont(RestChars, Line, Token)
+%% If we have a token or error then return done, else if we have a
+%% skip_token then continue.
+
+token_cont(Rest, Line, {token,T}) ->
+ {done,{ok,T,Line},Rest};
+token_cont(Rest, Line, {token,T,Push}) ->
+ NewRest = Push ++ Rest,
+ {done,{ok,T,Line},NewRest};
+token_cont(Rest, Line, {end_token,T}) ->
+ {done,{ok,T,Line},Rest};
+token_cont(Rest, Line, {end_token,T,Push}) ->
+ NewRest = Push ++ Rest,
+ {done,{ok,T,Line},NewRest};
+token_cont(Rest, Line, skip_token) ->
+ token(yystate(), Rest, Line, Rest, 0, Line, reject, 0);
+token_cont(Rest, Line, {skip_token,Push}) ->
+ NewRest = Push ++ Rest,
+ token(yystate(), NewRest, Line, NewRest, 0, Line, reject, 0);
+token_cont(Rest, Line, {error,S}) ->
+ {done,{error,{Line,?MODULE,{user,S}},Line},Rest}.
+
+%% tokens(Continuation, Chars, Line) ->
+%% {more,Continuation} | {done,ReturnVal,RestChars}.
+%% Must be careful when re-entering to append the latest characters to the
+%% after characters in an accept. The continuation is:
+%% {tokens,State,CurrLine,TokenChars,TokenLen,TokenLine,Tokens,AccAction,AccLen}
+%% {skip_tokens,State,CurrLine,TokenChars,TokenLen,TokenLine,Error,AccAction,AccLen}
+
+tokens(Cont, Chars) -> tokens(Cont, Chars, 1).
+
+tokens([], Chars, Line) ->
+ tokens(yystate(), Chars, Line, Chars, 0, Line, [], reject, 0);
+tokens({tokens,State,Line,Tcs,Tlen,Tline,Ts,Action,Alen}, Chars, _) ->
+ tokens(State, Chars, Line, Tcs ++ Chars, Tlen, Tline, Ts, Action, Alen);
+tokens({skip_tokens,State,Line,Tcs,Tlen,Tline,Error,Action,Alen}, Chars, _) ->
+ skip_tokens(State, Chars, Line, Tcs ++ Chars, Tlen, Tline, Error, Action, Alen).
+
+%% tokens(State, InChars, Line, TokenChars, TokenLen, TokenLine, Tokens,
+%% AcceptAction, AcceptLen) ->
+%% {more,Continuation} | {done,ReturnVal,RestChars}.
+
+tokens(S0, Ics0, L0, Tcs, Tlen0, Tline, Ts, A0, Alen0) ->
+ case yystate(S0, Ics0, L0, Tlen0, A0, Alen0) of
+ %% Accepting end state, we have a token.
+ {A1,Alen1,Ics1,L1} ->
+ tokens_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Ts);
+ %% Accepting transition state, can take more chars.
+ {A1,Alen1,[],L1,S1} -> % Need more chars to check
+ {more,{tokens,S1,L1,Tcs,Alen1,Tline,Ts,A1,Alen1}};
+ {A1,Alen1,Ics1,L1,_S1} -> % Take what we got
+ tokens_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Ts);
+ %% After a non-accepting state, maybe reach accept state later.
+ {A1,Alen1,Tlen1,[],L1,S1} -> % Need more chars to check
+ {more,{tokens,S1,L1,Tcs,Tlen1,Tline,Ts,A1,Alen1}};
+ {reject,_Alen1,Tlen1,eof,L1,_S1} -> % No token match
+ %% Check for partial token which is error, no need to skip here.
+ Ret = if Tlen1 > 0 -> {error,{Tline,?MODULE,
+ %% Skip eof tail in Tcs.
+ {illegal,yypre(Tcs, Tlen1)}},L1};
+ Ts == [] -> {eof,L1};
+ true -> {ok,yyrev(Ts),L1}
+ end,
+ {done,Ret,eof};
+ {reject,_Alen1,Tlen1,_Ics1,L1,_S1} ->
+ %% Skip rest of tokens.
+ Error = {L1,?MODULE,{illegal,yypre(Tcs, Tlen1+1)}},
+ skip_tokens(yysuf(Tcs, Tlen1+1), L1, Error);
+ {A1,Alen1,_Tlen1,_Ics1,L1,_S1} ->
+ Token = yyaction(A1, Alen1, Tcs, Tline),
+ tokens_cont(yysuf(Tcs, Alen1), L1, Token, Ts)
+ end.
+
+%% tokens_cont(RestChars, Line, Token, Tokens)
+%% If we have an end_token or error then return done, else if we have
+%% a token then save it and continue, else if we have a skip_token
+%% just continue.
+
+tokens_cont(Rest, Line, {token,T}, Ts) ->
+ tokens(yystate(), Rest, Line, Rest, 0, Line, [T|Ts], reject, 0);
+tokens_cont(Rest, Line, {token,T,Push}, Ts) ->
+ NewRest = Push ++ Rest,
+ tokens(yystate(), NewRest, Line, NewRest, 0, Line, [T|Ts], reject, 0);
+tokens_cont(Rest, Line, {end_token,T}, Ts) ->
+ {done,{ok,yyrev(Ts, [T]),Line},Rest};
+tokens_cont(Rest, Line, {end_token,T,Push}, Ts) ->
+ NewRest = Push ++ Rest,
+ {done,{ok,yyrev(Ts, [T]),Line},NewRest};
+tokens_cont(Rest, Line, skip_token, Ts) ->
+ tokens(yystate(), Rest, Line, Rest, 0, Line, Ts, reject, 0);
+tokens_cont(Rest, Line, {skip_token,Push}, Ts) ->
+ NewRest = Push ++ Rest,
+ tokens(yystate(), NewRest, Line, NewRest, 0, Line, Ts, reject, 0);
+tokens_cont(Rest, Line, {error,S}, _Ts) ->
+ skip_tokens(Rest, Line, {Line,?MODULE,{user,S}}).
+
+%%skip_tokens(InChars, Line, Error) -> {done,{error,Error,Line},Ics}.
+%% Skip tokens until an end token, junk everything and return the error.
+
+skip_tokens(Ics, Line, Error) ->
+ skip_tokens(yystate(), Ics, Line, Ics, 0, Line, Error, reject, 0).
+
+%% skip_tokens(State, InChars, Line, TokenChars, TokenLen, TokenLine, Tokens,
+%% AcceptAction, AcceptLen) ->
+%% {more,Continuation} | {done,ReturnVal,RestChars}.
+
+skip_tokens(S0, Ics0, L0, Tcs, Tlen0, Tline, Error, A0, Alen0) ->
+ case yystate(S0, Ics0, L0, Tlen0, A0, Alen0) of
+ {A1,Alen1,Ics1,L1} -> % Accepting end state
+ skip_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Error);
+ {A1,Alen1,[],L1,S1} -> % After an accepting state
+ {more,{skip_tokens,S1,L1,Tcs,Alen1,Tline,Error,A1,Alen1}};
+ {A1,Alen1,Ics1,L1,_S1} ->
+ skip_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Error);
+ {A1,Alen1,Tlen1,[],L1,S1} -> % After a non-accepting state
+ {more,{skip_tokens,S1,L1,Tcs,Tlen1,Tline,Error,A1,Alen1}};
+ {reject,_Alen1,_Tlen1,eof,L1,_S1} ->
+ {done,{error,Error,L1},eof};
+ {reject,_Alen1,Tlen1,_Ics1,L1,_S1} ->
+ skip_tokens(yysuf(Tcs, Tlen1+1), L1, Error);
+ {A1,Alen1,_Tlen1,_Ics1,L1,_S1} ->
+ Token = yyaction(A1, Alen1, Tcs, Tline),
+ skip_cont(yysuf(Tcs, Alen1), L1, Token, Error)
+ end.
+
+%% skip_cont(RestChars, Line, Token, Error)
+%% Skip tokens until we have an end_token or error then return done
+%% with the original rror.
+
+skip_cont(Rest, Line, {token,_T}, Error) ->
+ skip_tokens(yystate(), Rest, Line, Rest, 0, Line, Error, reject, 0);
+skip_cont(Rest, Line, {token,_T,Push}, Error) ->
+ NewRest = Push ++ Rest,
+ skip_tokens(yystate(), NewRest, Line, NewRest, 0, Line, Error, reject, 0);
+skip_cont(Rest, Line, {end_token,_T}, Error) ->
+ {done,{error,Error,Line},Rest};
+skip_cont(Rest, Line, {end_token,_T,Push}, Error) ->
+ NewRest = Push ++ Rest,
+ {done,{error,Error,Line},NewRest};
+skip_cont(Rest, Line, skip_token, Error) ->
+ skip_tokens(yystate(), Rest, Line, Rest, 0, Line, Error, reject, 0);
+skip_cont(Rest, Line, {skip_token,Push}, Error) ->
+ NewRest = Push ++ Rest,
+ skip_tokens(yystate(), NewRest, Line, NewRest, 0, Line, Error, reject, 0);
+skip_cont(Rest, Line, {error,_S}, Error) ->
+ skip_tokens(yystate(), Rest, Line, Rest, 0, Line, Error, reject, 0).
+
+yyrev(List) -> lists:reverse(List).
+yyrev(List, Tail) -> lists:reverse(List, Tail).
+yypre(List, N) -> lists:sublist(List, N).
+yysuf(List, N) -> lists:nthtail(N, List).
+
+%% yystate() -> InitialState.
+%% yystate(State, InChars, Line, CurrTokLen, AcceptAction, AcceptLen) ->
+%% {Action, AcceptLen, RestChars, Line} |
+%% {Action, AcceptLen, RestChars, Line, State} |
+%% {reject, AcceptLen, CurrTokLen, RestChars, Line, State} |
+%% {Action, AcceptLen, CurrTokLen, RestChars, Line, State}.
+%% Generated state transition functions. The non-accepting end state
+%% return signal either an unrecognised character or end of current
+%% input.
+
+-file("src/egs_script_lexer.erl", 739).
+yystate() -> 21.
+
+yystate(24, Ics, Line, Tlen, _, _) ->
+ {4,Tlen,Ics,Line};
+yystate(23, [37|Ics], Line, Tlen, _, _) ->
+ yystate(0, Ics, Line, Tlen+1, 7, Tlen);
+yystate(23, [10|Ics], Line, Tlen, _, _) ->
+ yystate(23, Ics, Line+1, Tlen+1, 7, Tlen);
+yystate(23, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 ->
+ yystate(23, Ics, Line, Tlen+1, 7, Tlen);
+yystate(23, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 32 ->
+ yystate(23, Ics, Line, Tlen+1, 7, Tlen);
+yystate(23, Ics, Line, Tlen, _, _) ->
+ {7,Tlen,Ics,Line,23};
+yystate(22, [62|Ics], Line, Tlen, Action, Alen) ->
+ yystate(24, Ics, Line, Tlen+1, Action, Alen);
+yystate(22, [45|Ics], Line, Tlen, Action, Alen) ->
+ yystate(8, Ics, Line, Tlen+1, Action, Alen);
+yystate(22, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 ->
+ yystate(20, Ics, Line, Tlen+1, Action, Alen);
+yystate(22, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,22};
+yystate(21, [125|Ics], Line, Tlen, Action, Alen) ->
+ yystate(4, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [123|Ics], Line, Tlen, Action, Alen) ->
+ yystate(4, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [95|Ics], Line, Tlen, Action, Alen) ->
+ yystate(17, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [59|Ics], Line, Tlen, Action, Alen) ->
+ yystate(4, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [46|Ics], Line, Tlen, Action, Alen) ->
+ yystate(10, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [45|Ics], Line, Tlen, Action, Alen) ->
+ yystate(22, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [44|Ics], Line, Tlen, Action, Alen) ->
+ yystate(4, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [37|Ics], Line, Tlen, Action, Alen) ->
+ yystate(0, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [34|Ics], Line, Tlen, Action, Alen) ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [10|Ics], Line, Tlen, Action, Alen) ->
+ yystate(23, Ics, Line+1, Tlen+1, Action, Alen);
+yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 ->
+ yystate(23, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 32 ->
+ yystate(23, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 ->
+ yystate(1, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 90 ->
+ yystate(17, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 122 ->
+ yystate(17, Ics, Line, Tlen+1, Action, Alen);
+yystate(21, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,21};
+yystate(20, [46|Ics], Line, Tlen, _, _) ->
+ yystate(16, Ics, Line, Tlen+1, 0, Tlen);
+yystate(20, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 ->
+ yystate(20, Ics, Line, Tlen+1, 0, Tlen);
+yystate(20, Ics, Line, Tlen, _, _) ->
+ {0,Tlen,Ics,Line,20};
+yystate(19, [92|Ics], Line, Tlen, Action, Alen) ->
+ yystate(7, Ics, Line, Tlen+1, Action, Alen);
+yystate(19, [34|Ics], Line, Tlen, Action, Alen) ->
+ yystate(15, Ics, Line, Tlen+1, Action, Alen);
+yystate(19, [10|Ics], Line, Tlen, Action, Alen) ->
+ yystate(19, Ics, Line+1, Tlen+1, Action, Alen);
+yystate(19, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(19, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(19, [C|Ics], Line, Tlen, Action, Alen) when C >= 35, C =< 91 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(19, [C|Ics], Line, Tlen, Action, Alen) when C >= 93 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(19, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,19};
+yystate(18, Ics, Line, Tlen, _, _) ->
+ {6,Tlen,Ics,Line};
+yystate(17, [95|Ics], Line, Tlen, Action, Alen) ->
+ yystate(13, Ics, Line, Tlen+1, Action, Alen);
+yystate(17, [46|Ics], Line, Tlen, Action, Alen) ->
+ yystate(9, Ics, Line, Tlen+1, Action, Alen);
+yystate(17, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 ->
+ yystate(13, Ics, Line, Tlen+1, Action, Alen);
+yystate(17, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 90 ->
+ yystate(13, Ics, Line, Tlen+1, Action, Alen);
+yystate(17, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 122 ->
+ yystate(13, Ics, Line, Tlen+1, Action, Alen);
+yystate(17, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,17};
+yystate(16, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 ->
+ yystate(12, Ics, Line, Tlen+1, Action, Alen);
+yystate(16, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,16};
+yystate(15, Ics, Line, Tlen, _, _) ->
+ {3,Tlen,Ics,Line};
+yystate(14, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 ->
+ yystate(14, Ics, Line, Tlen+1, 6, Tlen);
+yystate(14, [C|Ics], Line, Tlen, _, _) when C >= 11 ->
+ yystate(14, Ics, Line, Tlen+1, 6, Tlen);
+yystate(14, Ics, Line, Tlen, _, _) ->
+ {6,Tlen,Ics,Line,14};
+yystate(13, [95|Ics], Line, Tlen, _, _) ->
+ yystate(13, Ics, Line, Tlen+1, 2, Tlen);
+yystate(13, [46|Ics], Line, Tlen, _, _) ->
+ yystate(9, Ics, Line, Tlen+1, 2, Tlen);
+yystate(13, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 ->
+ yystate(13, Ics, Line, Tlen+1, 2, Tlen);
+yystate(13, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 ->
+ yystate(13, Ics, Line, Tlen+1, 2, Tlen);
+yystate(13, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 ->
+ yystate(13, Ics, Line, Tlen+1, 2, Tlen);
+yystate(13, Ics, Line, Tlen, _, _) ->
+ {2,Tlen,Ics,Line,13};
+yystate(12, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 ->
+ yystate(12, Ics, Line, Tlen+1, 1, Tlen);
+yystate(12, Ics, Line, Tlen, _, _) ->
+ {1,Tlen,Ics,Line,12};
+yystate(11, [92|Ics], Line, Tlen, _, _) ->
+ yystate(7, Ics, Line, Tlen+1, 3, Tlen);
+yystate(11, [34|Ics], Line, Tlen, _, _) ->
+ yystate(15, Ics, Line, Tlen+1, 3, Tlen);
+yystate(11, [10|Ics], Line, Tlen, _, _) ->
+ yystate(19, Ics, Line+1, Tlen+1, 3, Tlen);
+yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 ->
+ yystate(19, Ics, Line, Tlen+1, 3, Tlen);
+yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 33 ->
+ yystate(19, Ics, Line, Tlen+1, 3, Tlen);
+yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 35, C =< 91 ->
+ yystate(19, Ics, Line, Tlen+1, 3, Tlen);
+yystate(11, [C|Ics], Line, Tlen, _, _) when C >= 93 ->
+ yystate(19, Ics, Line, Tlen+1, 3, Tlen);
+yystate(11, Ics, Line, Tlen, _, _) ->
+ {3,Tlen,Ics,Line,11};
+yystate(10, [37|Ics], Line, Tlen, Action, Alen) ->
+ yystate(14, Ics, Line, Tlen+1, Action, Alen);
+yystate(10, [10|Ics], Line, Tlen, Action, Alen) ->
+ yystate(18, Ics, Line+1, Tlen+1, Action, Alen);
+yystate(10, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 ->
+ yystate(18, Ics, Line, Tlen+1, Action, Alen);
+yystate(10, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 32 ->
+ yystate(18, Ics, Line, Tlen+1, Action, Alen);
+yystate(10, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,10};
+yystate(9, [95|Ics], Line, Tlen, Action, Alen) ->
+ yystate(5, Ics, Line, Tlen+1, Action, Alen);
+yystate(9, [46|Ics], Line, Tlen, Action, Alen) ->
+ yystate(9, Ics, Line, Tlen+1, Action, Alen);
+yystate(9, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 ->
+ yystate(5, Ics, Line, Tlen+1, Action, Alen);
+yystate(9, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 90 ->
+ yystate(5, Ics, Line, Tlen+1, Action, Alen);
+yystate(9, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 122 ->
+ yystate(5, Ics, Line, Tlen+1, Action, Alen);
+yystate(9, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,9};
+yystate(8, [45|Ics], Line, Tlen, Action, Alen) ->
+ yystate(8, Ics, Line, Tlen+1, Action, Alen);
+yystate(8, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 ->
+ yystate(20, Ics, Line, Tlen+1, Action, Alen);
+yystate(8, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,8};
+yystate(7, [94|Ics], Line, Tlen, Action, Alen) ->
+ yystate(3, Ics, Line, Tlen+1, Action, Alen);
+yystate(7, [93|Ics], Line, Tlen, Action, Alen) ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(7, [92|Ics], Line, Tlen, Action, Alen) ->
+ yystate(7, Ics, Line, Tlen+1, Action, Alen);
+yystate(7, [34|Ics], Line, Tlen, Action, Alen) ->
+ yystate(11, Ics, Line, Tlen+1, Action, Alen);
+yystate(7, [10|Ics], Line, Tlen, Action, Alen) ->
+ yystate(19, Ics, Line+1, Tlen+1, Action, Alen);
+yystate(7, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(7, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(7, [C|Ics], Line, Tlen, Action, Alen) when C >= 35, C =< 91 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(7, [C|Ics], Line, Tlen, Action, Alen) when C >= 95 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(7, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,7};
+yystate(6, [95|Ics], Line, Tlen, _, _) ->
+ yystate(5, Ics, Line, Tlen+1, 1, Tlen);
+yystate(6, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 ->
+ yystate(6, Ics, Line, Tlen+1, 1, Tlen);
+yystate(6, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 ->
+ yystate(5, Ics, Line, Tlen+1, 1, Tlen);
+yystate(6, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 ->
+ yystate(5, Ics, Line, Tlen+1, 1, Tlen);
+yystate(6, Ics, Line, Tlen, _, _) ->
+ {1,Tlen,Ics,Line,6};
+yystate(5, [95|Ics], Line, Tlen, _, _) ->
+ yystate(5, Ics, Line, Tlen+1, 2, Tlen);
+yystate(5, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 ->
+ yystate(5, Ics, Line, Tlen+1, 2, Tlen);
+yystate(5, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 ->
+ yystate(5, Ics, Line, Tlen+1, 2, Tlen);
+yystate(5, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 ->
+ yystate(5, Ics, Line, Tlen+1, 2, Tlen);
+yystate(5, Ics, Line, Tlen, _, _) ->
+ {2,Tlen,Ics,Line,5};
+yystate(4, Ics, Line, Tlen, _, _) ->
+ {5,Tlen,Ics,Line};
+yystate(3, [92|Ics], Line, Tlen, Action, Alen) ->
+ yystate(7, Ics, Line, Tlen+1, Action, Alen);
+yystate(3, [34|Ics], Line, Tlen, Action, Alen) ->
+ yystate(11, Ics, Line, Tlen+1, Action, Alen);
+yystate(3, [10|Ics], Line, Tlen, Action, Alen) ->
+ yystate(19, Ics, Line+1, Tlen+1, Action, Alen);
+yystate(3, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(3, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(3, [C|Ics], Line, Tlen, Action, Alen) when C >= 35, C =< 91 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(3, [C|Ics], Line, Tlen, Action, Alen) when C >= 93 ->
+ yystate(19, Ics, Line, Tlen+1, Action, Alen);
+yystate(3, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,3};
+yystate(2, [95|Ics], Line, Tlen, Action, Alen) ->
+ yystate(5, Ics, Line, Tlen+1, Action, Alen);
+yystate(2, [46|Ics], Line, Tlen, Action, Alen) ->
+ yystate(9, Ics, Line, Tlen+1, Action, Alen);
+yystate(2, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 ->
+ yystate(6, Ics, Line, Tlen+1, Action, Alen);
+yystate(2, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 90 ->
+ yystate(5, Ics, Line, Tlen+1, Action, Alen);
+yystate(2, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 122 ->
+ yystate(5, Ics, Line, Tlen+1, Action, Alen);
+yystate(2, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,2};
+yystate(1, [95|Ics], Line, Tlen, _, _) ->
+ yystate(13, Ics, Line, Tlen+1, 0, Tlen);
+yystate(1, [46|Ics], Line, Tlen, _, _) ->
+ yystate(2, Ics, Line, Tlen+1, 0, Tlen);
+yystate(1, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 ->
+ yystate(1, Ics, Line, Tlen+1, 0, Tlen);
+yystate(1, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 ->
+ yystate(13, Ics, Line, Tlen+1, 0, Tlen);
+yystate(1, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 ->
+ yystate(13, Ics, Line, Tlen+1, 0, Tlen);
+yystate(1, Ics, Line, Tlen, _, _) ->
+ {0,Tlen,Ics,Line,1};
+yystate(0, [37|Ics], Line, Tlen, _, _) ->
+ yystate(0, Ics, Line, Tlen+1, 7, Tlen);
+yystate(0, [10|Ics], Line, Tlen, _, _) ->
+ yystate(23, Ics, Line+1, Tlen+1, 7, Tlen);
+yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 ->
+ yystate(0, Ics, Line, Tlen+1, 7, Tlen);
+yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 32 ->
+ yystate(0, Ics, Line, Tlen+1, 7, Tlen);
+yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 33, C =< 36 ->
+ yystate(0, Ics, Line, Tlen+1, 7, Tlen);
+yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 38 ->
+ yystate(0, Ics, Line, Tlen+1, 7, Tlen);
+yystate(0, Ics, Line, Tlen, _, _) ->
+ {7,Tlen,Ics,Line,0};
+yystate(S, Ics, Line, Tlen, Action, Alen) ->
+ {Action,Alen,Tlen,Ics,Line,S}.
+
+%% yyaction(Action, TokenLength, TokenChars, TokenLine) ->
+%% {token,Token} | {end_token, Token} | skip_token | {error,String}.
+%% Generated action function.
+
+yyaction(0, TokenLen, YYtcs, TokenLine) ->
+ TokenChars = yypre(YYtcs, TokenLen),
+ yyaction_0(TokenChars, TokenLine);
+yyaction(1, TokenLen, YYtcs, TokenLine) ->
+ TokenChars = yypre(YYtcs, TokenLen),
+ yyaction_1(TokenChars, TokenLine);
+yyaction(2, TokenLen, YYtcs, TokenLine) ->
+ TokenChars = yypre(YYtcs, TokenLen),
+ yyaction_2(TokenChars, TokenLine);
+yyaction(3, TokenLen, YYtcs, TokenLine) ->
+ TokenChars = yypre(YYtcs, TokenLen),
+ yyaction_3(TokenChars, TokenLen, TokenLine);
+yyaction(4, _, _, TokenLine) ->
+ yyaction_4(TokenLine);
+yyaction(5, TokenLen, YYtcs, TokenLine) ->
+ TokenChars = yypre(YYtcs, TokenLen),
+ yyaction_5(TokenChars, TokenLine);
+yyaction(6, _, _, TokenLine) ->
+ yyaction_6(TokenLine);
+yyaction(7, _, _, _) ->
+ yyaction_7();
+yyaction(_, _, _, _) -> error.
+
+-compile({inline,yyaction_0/2}).
+-file("src/egs_script_lexer.xrl", 27).
+yyaction_0(TokenChars, TokenLine) ->
+ { token, { integer, TokenLine, list_to_integer (TokenChars) } } .
+
+-compile({inline,yyaction_1/2}).
+-file("src/egs_script_lexer.xrl", 28).
+yyaction_1(TokenChars, TokenLine) ->
+ { token, { float, TokenLine, list_to_float (TokenChars) } } .
+
+-compile({inline,yyaction_2/2}).
+-file("src/egs_script_lexer.xrl", 29).
+yyaction_2(TokenChars, TokenLine) ->
+ { token, case reserved_word (TokenChars) of
+ false -> case syscall (TokenChars) of
+ false -> { function, TokenLine, function (TokenChars) } ;
+ Syscall -> { syscall, TokenLine, Syscall }
+ end ;
+ KeyWord -> { KeyWord, TokenLine }
+ end } .
+
+-compile({inline,yyaction_3/3}).
+-file("src/egs_script_lexer.xrl", 37).
+yyaction_3(TokenChars, TokenLen, TokenLine) ->
+ S = lists : sublist (TokenChars, 2, TokenLen - 2),
+ { token, { string, TokenLine, string_gen (S) } } .
+
+-compile({inline,yyaction_4/1}).
+-file("src/egs_script_lexer.xrl", 39).
+yyaction_4(TokenLine) ->
+ { token, { '->', TokenLine } } .
+
+-compile({inline,yyaction_5/2}).
+-file("src/egs_script_lexer.xrl", 40).
+yyaction_5(TokenChars, TokenLine) ->
+ { token, { list_to_atom (TokenChars), TokenLine } } .
+
+-compile({inline,yyaction_6/1}).
+-file("src/egs_script_lexer.xrl", 41).
+yyaction_6(TokenLine) ->
+ { end_token, { dot, TokenLine } } .
+
+-compile({inline,yyaction_7/0}).
+-file("src/egs_script_lexer.xrl", 42).
+yyaction_7() ->
+ skip_token .
+
+-file("/usr/lib/erlang/lib/parsetools-2.0.6/include/leexinc.hrl", 282).
diff --git a/src/egs_script_lexer.xrl b/apps/egs/src/egs_script_lexer.xrl
similarity index 100%
rename from src/egs_script_lexer.xrl
rename to apps/egs/src/egs_script_lexer.xrl
diff --git a/apps/egs/src/egs_script_parser.erl b/apps/egs/src/egs_script_parser.erl
new file mode 100644
index 0000000..4b33e82
--- /dev/null
+++ b/apps/egs/src/egs_script_parser.erl
@@ -0,0 +1,1330 @@
+-module(egs_script_parser).
+-export([parse/1, parse_and_scan/1, format_error/1]).
+-file("src/egs_script_parser.yrl", 88).
+
+unwrap({_,_,V}) -> V.
+
+-file("/usr/lib/erlang/lib/parsetools-2.0.6/include/yeccpre.hrl", 0).
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% The parser generator will insert appropriate declarations before this line.%
+
+-type yecc_ret() :: {'error', _} | {'ok', _}.
+
+-spec parse(Tokens :: list()) -> yecc_ret().
+parse(Tokens) ->
+ yeccpars0(Tokens, {no_func, no_line}, 0, [], []).
+
+-spec parse_and_scan({function() | {atom(), atom()}, [_]}
+ | {atom(), atom(), [_]}) -> yecc_ret().
+parse_and_scan({F, A}) -> % Fun or {M, F}
+ yeccpars0([], {{F, A}, no_line}, 0, [], []);
+parse_and_scan({M, F, A}) ->
+ yeccpars0([], {{{M, F}, A}, no_line}, 0, [], []).
+
+-spec format_error(any()) -> [char() | list()].
+format_error(Message) ->
+ case io_lib:deep_char_list(Message) of
+ true ->
+ Message;
+ _ ->
+ io_lib:write(Message)
+ end.
+
+%% To be used in grammar files to throw an error message to the parser
+%% toplevel. Doesn't have to be exported!
+-compile({nowarn_unused_function, return_error/2}).
+-spec return_error(integer(), any()) -> no_return().
+return_error(Line, Message) ->
+ throw({error, {Line, ?MODULE, Message}}).
+
+-define(CODE_VERSION, "1.4").
+
+yeccpars0(Tokens, Tzr, State, States, Vstack) ->
+ try yeccpars1(Tokens, Tzr, State, States, Vstack)
+ catch
+ error: Error ->
+ Stacktrace = erlang:get_stacktrace(),
+ try yecc_error_type(Error, Stacktrace) of
+ Desc ->
+ erlang:raise(error, {yecc_bug, ?CODE_VERSION, Desc},
+ Stacktrace)
+ catch _:_ -> erlang:raise(error, Error, Stacktrace)
+ end;
+ %% Probably thrown from return_error/2:
+ throw: {error, {_Line, ?MODULE, _M}} = Error ->
+ Error
+ end.
+
+yecc_error_type(function_clause, [{?MODULE,F,ArityOrArgs} | _]) ->
+ case atom_to_list(F) of
+ "yeccgoto_" ++ SymbolL ->
+ {ok,[{atom,_,Symbol}],_} = erl_scan:string(SymbolL),
+ State = case ArityOrArgs of
+ [S,_,_,_,_,_,_] -> S;
+ _ -> state_is_unknown
+ end,
+ {Symbol, State, missing_in_goto_table}
+ end.
+
+yeccpars1([Token | Tokens], Tzr, State, States, Vstack) ->
+ yeccpars2(State, element(1, Token), States, Vstack, Token, Tokens, Tzr);
+yeccpars1([], {{F, A},_Line}, State, States, Vstack) ->
+ case apply(F, A) of
+ {ok, Tokens, Endline} ->
+ yeccpars1(Tokens, {{F, A}, Endline}, State, States, Vstack);
+ {eof, Endline} ->
+ yeccpars1([], {no_func, Endline}, State, States, Vstack);
+ {error, Descriptor, _Endline} ->
+ {error, Descriptor}
+ end;
+yeccpars1([], {no_func, no_line}, State, States, Vstack) ->
+ Line = 999999,
+ yeccpars2(State, '$end', States, Vstack, yecc_end(Line), [],
+ {no_func, Line});
+yeccpars1([], {no_func, Endline}, State, States, Vstack) ->
+ yeccpars2(State, '$end', States, Vstack, yecc_end(Endline), [],
+ {no_func, Endline}).
+
+%% yeccpars1/7 is called from generated code.
+%%
+%% When using the {includefile, Includefile} option, make sure that
+%% yeccpars1/7 can be found by parsing the file without following
+%% include directives. yecc will otherwise assume that an old
+%% yeccpre.hrl is included (one which defines yeccpars1/5).
+yeccpars1(State1, State, States, Vstack, Token0, [Token | Tokens], Tzr) ->
+ yeccpars2(State, element(1, Token), [State1 | States],
+ [Token0 | Vstack], Token, Tokens, Tzr);
+yeccpars1(State1, State, States, Vstack, Token0, [], {{_F,_A}, _Line}=Tzr) ->
+ yeccpars1([], Tzr, State, [State1 | States], [Token0 | Vstack]);
+yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, no_line}) ->
+ Line = yecctoken_end_location(Token0),
+ yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack],
+ yecc_end(Line), [], {no_func, Line});
+yeccpars1(State1, State, States, Vstack, Token0, [], {no_func, Line}) ->
+ yeccpars2(State, '$end', [State1 | States], [Token0 | Vstack],
+ yecc_end(Line), [], {no_func, Line}).
+
+%% For internal use only.
+yecc_end({Line,_Column}) ->
+ {'$end', Line};
+yecc_end(Line) ->
+ {'$end', Line}.
+
+yecctoken_end_location(Token) ->
+ try
+ {text, Str} = erl_scan:token_info(Token, text),
+ {line, Line} = erl_scan:token_info(Token, line),
+ Parts = re:split(Str, "\n"),
+ Dline = length(Parts) - 1,
+ Yline = Line + Dline,
+ case erl_scan:token_info(Token, column) of
+ {column, Column} ->
+ Col = byte_size(lists:last(Parts)),
+ {Yline, Col + if Dline =:= 0 -> Column; true -> 1 end};
+ undefined ->
+ Yline
+ end
+ catch _:_ ->
+ yecctoken_location(Token)
+ end.
+
+-compile({nowarn_unused_function, yeccerror/1}).
+yeccerror(Token) ->
+ Text = yecctoken_to_string(Token),
+ Location = yecctoken_location(Token),
+ {error, {Location, ?MODULE, ["syntax error before: ", Text]}}.
+
+-compile({nowarn_unused_function, yecctoken_to_string/1}).
+yecctoken_to_string(Token) ->
+ case catch erl_scan:token_info(Token, text) of
+ {text, Txt} -> Txt;
+ _ -> yecctoken2string(Token)
+ end.
+
+yecctoken_location(Token) ->
+ case catch erl_scan:token_info(Token, location) of
+ {location, Loc} -> Loc;
+ _ -> element(2, Token)
+ end.
+
+-compile({nowarn_unused_function, yecctoken2string/1}).
+yecctoken2string({atom, _, A}) -> io_lib:write(A);
+yecctoken2string({integer,_,N}) -> io_lib:write(N);
+yecctoken2string({float,_,F}) -> io_lib:write(F);
+yecctoken2string({char,_,C}) -> io_lib:write_char(C);
+yecctoken2string({var,_,V}) -> io_lib:format("~s", [V]);
+yecctoken2string({string,_,S}) -> io_lib:write_unicode_string(S);
+yecctoken2string({reserved_symbol, _, A}) -> io_lib:write(A);
+yecctoken2string({_Cat, _, Val}) -> io_lib:format("~p",[Val]);
+yecctoken2string({dot, _}) -> "'.'";
+yecctoken2string({'$end', _}) ->
+ [];
+yecctoken2string({Other, _}) when is_atom(Other) ->
+ io_lib:write(Other);
+yecctoken2string(Other) ->
+ io_lib:write(Other).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+-file("src/egs_script_parser.erl", 190).
+
+yeccpars2(0=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_0(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(1=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_1(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(2=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_2(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(3=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_3(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(4=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_4(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(5=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_5(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(6=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_6(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(7=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_7(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(8=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_8(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(9=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_9(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(10=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_10(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(11=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_11(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(12=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_12(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(13=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_13(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(14=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_14(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(15=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_15(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(16=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_16(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(17=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_17(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(18=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_18(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(19=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_19(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(20=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_20(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(21=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_21(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(22=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_22(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(23=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_23(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(24=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_24(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(25=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_25(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(26=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_26(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(27=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_27(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(28=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_28(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(29=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_29(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(30=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_30(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(31=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_31(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(32=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_32(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(33=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_33(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(34=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_34(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(35=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_35(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(36=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_36(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(37=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_37(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(38=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_38(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(39=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_39(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(40=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_40(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(41=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_41(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(42=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_42(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(43=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_43(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(44=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_44(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(45=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_45(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(46=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_46(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(47=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_47(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(48=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_48(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(49=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_49(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(50=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_50(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(51=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_51(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(52=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_52(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(53=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_53(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(54=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_54(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(55=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_55(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(56=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_56(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(57=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_57(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(58=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_58(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(59=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_59(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(60=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_60(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(61=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_61(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(62=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_62(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(63=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_63(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(64=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_64(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(65=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_65(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(66=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_66(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(67=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_67(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(68=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_13(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(69=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_69(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(70=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_70(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(71=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_71(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(72=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_72(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(73=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_73(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(74=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_13(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(75=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_75(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(76=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_76(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(77=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_13(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(78=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_78(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(79=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_79(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(80=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_80(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(81=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_13(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(82=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_82(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(83=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_83(S, Cat, Ss, Stack, T, Ts, Tzr);
+%% yeccpars2(84=S, Cat, Ss, Stack, T, Ts, Tzr) ->
+%% yeccpars2_84(S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccpars2(Other, _, _, _, _, _, _) ->
+ erlang:error({yecc_bug,"1.4",{missing_state_in_action_table, Other}}).
+
+yeccpars2_0(S, event_def, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 3, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, function_def, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 4, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, num_var, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 5, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(S, str_var, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr);
+yeccpars2_0(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_0_(Stack),
+ yeccpars2_1(1, Cat, [0 | Ss], NewStack, T, Ts, Tzr).
+
+yeccpars2_1(_S, '$end', _Ss, Stack, _T, _Ts, _Tzr) ->
+ {ok, hd(Stack)};
+yeccpars2_1(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_2(S, event_def, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 3, Ss, Stack, T, Ts, Tzr);
+yeccpars2_2(S, function_def, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 4, Ss, Stack, T, Ts, Tzr);
+yeccpars2_2(S, num_var, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 5, Ss, Stack, T, Ts, Tzr);
+yeccpars2_2(S, str_var, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr);
+yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_2_(Stack),
+ yeccpars2_84(_S, Cat, [2 | Ss], NewStack, T, Ts, Tzr).
+
+yeccpars2_3(S, function, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 80, Ss, Stack, T, Ts, Tzr);
+yeccpars2_3(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_4(S, function, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 12, Ss, Stack, T, Ts, Tzr);
+yeccpars2_4(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_5(S, function, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 10, Ss, Stack, T, Ts, Tzr);
+yeccpars2_5(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_6(S, function, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 7, Ss, Stack, T, Ts, Tzr);
+yeccpars2_6(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_7(S, integer, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 8, Ss, Stack, T, Ts, Tzr);
+yeccpars2_7(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_8(S, dot, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 9, Ss, Stack, T, Ts, Tzr);
+yeccpars2_8(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_9(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_,_|Nss] = Ss,
+ NewStack = yeccpars2_9_(Stack),
+ yeccgoto_declaration(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_10(S, dot, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 11, Ss, Stack, T, Ts, Tzr);
+yeccpars2_10(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_11(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_11_(Stack),
+ yeccgoto_declaration(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_12(S, '->', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 13, Ss, Stack, T, Ts, Tzr);
+yeccpars2_12(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_13(S, abs, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 16, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, add, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 17, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, 'band', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 18, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, 'bor', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 19, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, 'bxor', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 20, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, 'case', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 21, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, debug, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 22, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, dec, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 23, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, 'div', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 24, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, function, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 25, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, inc, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 26, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, is_eq, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 27, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, is_gt, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 28, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, is_gteq, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 29, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, is_lt, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 30, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, is_lteq, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 31, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, is_neq, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 32, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, jmp, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 33, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, jnz, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 34, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, jz, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 35, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, land, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 36, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, lor, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 37, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, lshift, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 38, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, mod, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 39, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, mul, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 40, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, neg, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 41, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, nop, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 42, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, num_get, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 43, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, num_set, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 44, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, push, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 45, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, restore, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 46, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, return, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 47, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, rshift, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 48, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, save, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 49, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, savep, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 50, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, str_get, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 51, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, str_set, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 52, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, sub, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 53, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(S, syscall, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 54, Ss, Stack, T, Ts, Tzr);
+yeccpars2_13(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_14(S, dot, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 79, Ss, Stack, T, Ts, Tzr);
+yeccpars2_14(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_15(S, ',', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 77, Ss, Stack, T, Ts, Tzr);
+yeccpars2_15(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_15_(Stack),
+ yeccgoto_instructions(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_16(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_16_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_17(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_17_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_18(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_18_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_19(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_19_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_20(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_20_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_21(S, integer, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 67, Ss, Stack, T, Ts, Tzr);
+yeccpars2_21(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_22(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_22_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_23(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_23_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_24(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_24_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_25(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_25_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_26(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_26_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_27(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_27_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_28_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_29(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_29_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_30(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_30_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_31(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_31_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_32(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_32_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_33(S, integer, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 64, Ss, Stack, T, Ts, Tzr);
+yeccpars2_33(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_34(S, integer, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 63, Ss, Stack, T, Ts, Tzr);
+yeccpars2_34(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_35(S, integer, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 62, Ss, Stack, T, Ts, Tzr);
+yeccpars2_35(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_36(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_36_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_37(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_37_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_38(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_38_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_39(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_39_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_40(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_40_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_41(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_41_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_42(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_42_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_43(S, function, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 61, Ss, Stack, T, Ts, Tzr);
+yeccpars2_43(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_44(S, function, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 60, Ss, Stack, T, Ts, Tzr);
+yeccpars2_44(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_45(S, float, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 57, Ss, Stack, T, Ts, Tzr);
+yeccpars2_45(S, integer, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 58, Ss, Stack, T, Ts, Tzr);
+yeccpars2_45(S, string, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 59, Ss, Stack, T, Ts, Tzr);
+yeccpars2_45(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_46(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_46_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_47(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_47_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_48(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_48_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_49(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_49_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_50(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_50_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_51(S, function, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 56, Ss, Stack, T, Ts, Tzr);
+yeccpars2_51(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_52(S, function, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 55, Ss, Stack, T, Ts, Tzr);
+yeccpars2_52(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_53(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_53_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_54(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_54_(Stack),
+ yeccgoto_instruction(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_55(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_55_(Stack),
+ yeccgoto_instruction(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_56(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_56_(Stack),
+ yeccgoto_instruction(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_57(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_57_(Stack),
+ yeccgoto_instruction(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_58(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_58_(Stack),
+ yeccgoto_instruction(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_59(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_59_(Stack),
+ yeccgoto_instruction(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_60(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_60_(Stack),
+ yeccgoto_instruction(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_61(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_61_(Stack),
+ yeccgoto_instruction(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_62(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_62_(Stack),
+ yeccgoto_instruction(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_63(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_63_(Stack),
+ yeccgoto_instruction(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_64(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_64_(Stack),
+ yeccgoto_instruction(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_65(S, 'end', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 76, Ss, Stack, T, Ts, Tzr);
+yeccpars2_65(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_66(S, ';', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 70, Ss, Stack, T, Ts, Tzr);
+yeccpars2_66(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ NewStack = yeccpars2_66_(Stack),
+ yeccgoto_case_tests(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+
+yeccpars2_67(S, '->', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 68, Ss, Stack, T, Ts, Tzr);
+yeccpars2_67(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+%% yeccpars2_68: see yeccpars2_13
+
+yeccpars2_69(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_69_(Stack),
+ yeccgoto_case_test(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_70(S, default, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 73, Ss, Stack, T, Ts, Tzr);
+yeccpars2_70(S, integer, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 67, Ss, Stack, T, Ts, Tzr);
+yeccpars2_70(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_71(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_71_(Stack),
+ yeccgoto_case_tests(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_72(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_72_(Stack),
+ yeccgoto_case_tests(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_73(S, '->', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 74, Ss, Stack, T, Ts, Tzr);
+yeccpars2_73(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+%% yeccpars2_74: see yeccpars2_13
+
+yeccpars2_75(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_75_(Stack),
+ yeccgoto_case_default(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_76(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_76_(Stack),
+ yeccgoto_instruction(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+%% yeccpars2_77: see yeccpars2_13
+
+yeccpars2_78(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_|Nss] = Ss,
+ NewStack = yeccpars2_78_(Stack),
+ yeccgoto_instructions(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_79(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_,_,_|Nss] = Ss,
+ NewStack = yeccpars2_79_(Stack),
+ yeccgoto_declaration(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_80(S, '->', Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 81, Ss, Stack, T, Ts, Tzr);
+yeccpars2_80(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+%% yeccpars2_81: see yeccpars2_13
+
+yeccpars2_82(S, dot, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars1(S, 83, Ss, Stack, T, Ts, Tzr);
+yeccpars2_82(_, _, _, _, T, _, _) ->
+ yeccerror(T).
+
+yeccpars2_83(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_,_,_,_|Nss] = Ss,
+ NewStack = yeccpars2_83_(Stack),
+ yeccgoto_declaration(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccpars2_84(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ [_|Nss] = Ss,
+ NewStack = yeccpars2_84_(Stack),
+ yeccgoto_declarations(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+
+yeccgoto_case_default(70=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_72(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+yeccgoto_case_test(21, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_66(66, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_case_test(70, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_66(66, Cat, Ss, Stack, T, Ts, Tzr).
+
+yeccgoto_case_tests(21, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_65(65, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_case_tests(70=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_71(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+yeccgoto_declaration(0, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_2(2, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_declaration(2, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_2(2, Cat, Ss, Stack, T, Ts, Tzr).
+
+yeccgoto_declarations(0, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_1(1, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_declarations(2=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_84(_S, Cat, Ss, Stack, T, Ts, Tzr).
+
+yeccgoto_instruction(13, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_15(15, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_instruction(68, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_15(15, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_instruction(74, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_15(15, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_instruction(77, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_15(15, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_instruction(81, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_15(15, Cat, Ss, Stack, T, Ts, Tzr).
+
+yeccgoto_instructions(13, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_14(14, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_instructions(68=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_69(_S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_instructions(74=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_75(_S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_instructions(77=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_78(_S, Cat, Ss, Stack, T, Ts, Tzr);
+yeccgoto_instructions(81, Cat, Ss, Stack, T, Ts, Tzr) ->
+ yeccpars2_82(82, Cat, Ss, Stack, T, Ts, Tzr).
+
+-compile({inline,yeccpars2_0_/1}).
+-file("src/egs_script_parser.yrl", 25).
+yeccpars2_0_(__Stack0) ->
+ [begin
+ nil
+ end | __Stack0].
+
+-compile({inline,yeccpars2_2_/1}).
+-file("src/egs_script_parser.yrl", 25).
+yeccpars2_2_(__Stack0) ->
+ [begin
+ nil
+ end | __Stack0].
+
+-compile({inline,yeccpars2_9_/1}).
+-file("src/egs_script_parser.yrl", 30).
+yeccpars2_9_(__Stack0) ->
+ [__4,__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ { str_var , unwrap ( __2 ) , unwrap ( __3 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_11_/1}).
+-file("src/egs_script_parser.yrl", 29).
+yeccpars2_11_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ { num_var , unwrap ( __2 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_15_/1}).
+-file("src/egs_script_parser.yrl", 33).
+yeccpars2_15_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ { __1 , nil }
+ end | __Stack].
+
+-compile({inline,yeccpars2_16_/1}).
+-file("src/egs_script_parser.yrl", 35).
+yeccpars2_16_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ abs
+ end | __Stack].
+
+-compile({inline,yeccpars2_17_/1}).
+-file("src/egs_script_parser.yrl", 36).
+yeccpars2_17_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ add
+ end | __Stack].
+
+-compile({inline,yeccpars2_18_/1}).
+-file("src/egs_script_parser.yrl", 37).
+yeccpars2_18_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ 'band'
+ end | __Stack].
+
+-compile({inline,yeccpars2_19_/1}).
+-file("src/egs_script_parser.yrl", 38).
+yeccpars2_19_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ 'bor'
+ end | __Stack].
+
+-compile({inline,yeccpars2_20_/1}).
+-file("src/egs_script_parser.yrl", 39).
+yeccpars2_20_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ 'bxor'
+ end | __Stack].
+
+-compile({inline,yeccpars2_22_/1}).
+-file("src/egs_script_parser.yrl", 73).
+yeccpars2_22_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ debug
+ end | __Stack].
+
+-compile({inline,yeccpars2_23_/1}).
+-file("src/egs_script_parser.yrl", 40).
+yeccpars2_23_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ dec
+ end | __Stack].
+
+-compile({inline,yeccpars2_24_/1}).
+-file("src/egs_script_parser.yrl", 41).
+yeccpars2_24_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ 'div'
+ end | __Stack].
+
+-compile({inline,yeccpars2_25_/1}).
+-file("src/egs_script_parser.yrl", 74).
+yeccpars2_25_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ { function , unwrap ( __1 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_26_/1}).
+-file("src/egs_script_parser.yrl", 42).
+yeccpars2_26_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ inc
+ end | __Stack].
+
+-compile({inline,yeccpars2_27_/1}).
+-file("src/egs_script_parser.yrl", 43).
+yeccpars2_27_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ is_eq
+ end | __Stack].
+
+-compile({inline,yeccpars2_28_/1}).
+-file("src/egs_script_parser.yrl", 44).
+yeccpars2_28_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ is_gt
+ end | __Stack].
+
+-compile({inline,yeccpars2_29_/1}).
+-file("src/egs_script_parser.yrl", 45).
+yeccpars2_29_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ is_gteq
+ end | __Stack].
+
+-compile({inline,yeccpars2_30_/1}).
+-file("src/egs_script_parser.yrl", 46).
+yeccpars2_30_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ is_lt
+ end | __Stack].
+
+-compile({inline,yeccpars2_31_/1}).
+-file("src/egs_script_parser.yrl", 47).
+yeccpars2_31_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ is_lteq
+ end | __Stack].
+
+-compile({inline,yeccpars2_32_/1}).
+-file("src/egs_script_parser.yrl", 48).
+yeccpars2_32_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ is_neq
+ end | __Stack].
+
+-compile({inline,yeccpars2_36_/1}).
+-file("src/egs_script_parser.yrl", 52).
+yeccpars2_36_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ land
+ end | __Stack].
+
+-compile({inline,yeccpars2_37_/1}).
+-file("src/egs_script_parser.yrl", 53).
+yeccpars2_37_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ lor
+ end | __Stack].
+
+-compile({inline,yeccpars2_38_/1}).
+-file("src/egs_script_parser.yrl", 54).
+yeccpars2_38_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ lshift
+ end | __Stack].
+
+-compile({inline,yeccpars2_39_/1}).
+-file("src/egs_script_parser.yrl", 55).
+yeccpars2_39_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ mod
+ end | __Stack].
+
+-compile({inline,yeccpars2_40_/1}).
+-file("src/egs_script_parser.yrl", 56).
+yeccpars2_40_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ mul
+ end | __Stack].
+
+-compile({inline,yeccpars2_41_/1}).
+-file("src/egs_script_parser.yrl", 57).
+yeccpars2_41_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ neg
+ end | __Stack].
+
+-compile({inline,yeccpars2_42_/1}).
+-file("src/egs_script_parser.yrl", 58).
+yeccpars2_42_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ nop
+ end | __Stack].
+
+-compile({inline,yeccpars2_46_/1}).
+-file("src/egs_script_parser.yrl", 64).
+yeccpars2_46_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ restore
+ end | __Stack].
+
+-compile({inline,yeccpars2_47_/1}).
+-file("src/egs_script_parser.yrl", 65).
+yeccpars2_47_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ return
+ end | __Stack].
+
+-compile({inline,yeccpars2_48_/1}).
+-file("src/egs_script_parser.yrl", 66).
+yeccpars2_48_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ rshift
+ end | __Stack].
+
+-compile({inline,yeccpars2_49_/1}).
+-file("src/egs_script_parser.yrl", 67).
+yeccpars2_49_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ save
+ end | __Stack].
+
+-compile({inline,yeccpars2_50_/1}).
+-file("src/egs_script_parser.yrl", 68).
+yeccpars2_50_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ savep
+ end | __Stack].
+
+-compile({inline,yeccpars2_53_/1}).
+-file("src/egs_script_parser.yrl", 71).
+yeccpars2_53_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ sub
+ end | __Stack].
+
+-compile({inline,yeccpars2_54_/1}).
+-file("src/egs_script_parser.yrl", 75).
+yeccpars2_54_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ { syscall , unwrap ( __1 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_55_/1}).
+-file("src/egs_script_parser.yrl", 70).
+yeccpars2_55_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ { str_set , unwrap ( __2 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_56_/1}).
+-file("src/egs_script_parser.yrl", 69).
+yeccpars2_56_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ { str_get , unwrap ( __2 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_57_/1}).
+-file("src/egs_script_parser.yrl", 62).
+yeccpars2_57_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ { push , unwrap ( __2 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_58_/1}).
+-file("src/egs_script_parser.yrl", 61).
+yeccpars2_58_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ { push , unwrap ( __2 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_59_/1}).
+-file("src/egs_script_parser.yrl", 63).
+yeccpars2_59_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ { push , unwrap ( __2 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_60_/1}).
+-file("src/egs_script_parser.yrl", 60).
+yeccpars2_60_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ { num_set , unwrap ( __2 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_61_/1}).
+-file("src/egs_script_parser.yrl", 59).
+yeccpars2_61_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ { num_get , unwrap ( __2 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_62_/1}).
+-file("src/egs_script_parser.yrl", 51).
+yeccpars2_62_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ { jz , unwrap ( __2 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_63_/1}).
+-file("src/egs_script_parser.yrl", 50).
+yeccpars2_63_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ { jnz , unwrap ( __2 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_64_/1}).
+-file("src/egs_script_parser.yrl", 49).
+yeccpars2_64_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ { jmp , unwrap ( __2 ) }
+ end | __Stack].
+
+-compile({inline,yeccpars2_66_/1}).
+-file("src/egs_script_parser.yrl", 80).
+yeccpars2_66_(__Stack0) ->
+ [__1 | __Stack] = __Stack0,
+ [begin
+ { __1 , nil }
+ end | __Stack].
+
+-compile({inline,yeccpars2_69_/1}).
+-file("src/egs_script_parser.yrl", 81).
+yeccpars2_69_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ { case_test , unwrap ( __1 ) , __3 }
+ end | __Stack].
+
+-compile({inline,yeccpars2_71_/1}).
+-file("src/egs_script_parser.yrl", 78).
+yeccpars2_71_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ { __1 , __3 }
+ end | __Stack].
+
+-compile({inline,yeccpars2_72_/1}).
+-file("src/egs_script_parser.yrl", 79).
+yeccpars2_72_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ { __1 , { __3 , nil } }
+ end | __Stack].
+
+-compile({inline,yeccpars2_75_/1}).
+-file("src/egs_script_parser.yrl", 82).
+yeccpars2_75_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ { case_default , __3 }
+ end | __Stack].
+
+-compile({inline,yeccpars2_76_/1}).
+-file("src/egs_script_parser.yrl", 77).
+yeccpars2_76_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ { 'case' , __2 }
+ end | __Stack].
+
+-compile({inline,yeccpars2_78_/1}).
+-file("src/egs_script_parser.yrl", 32).
+yeccpars2_78_(__Stack0) ->
+ [__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ { __1 , __3 }
+ end | __Stack].
+
+-compile({inline,yeccpars2_79_/1}).
+-file("src/egs_script_parser.yrl", 28).
+yeccpars2_79_(__Stack0) ->
+ [__5,__4,__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ { function_def , unwrap ( __2 ) , __4 }
+ end | __Stack].
+
+-compile({inline,yeccpars2_83_/1}).
+-file("src/egs_script_parser.yrl", 27).
+yeccpars2_83_(__Stack0) ->
+ [__5,__4,__3,__2,__1 | __Stack] = __Stack0,
+ [begin
+ { event_def , unwrap ( __2 ) , __4 }
+ end | __Stack].
+
+-compile({inline,yeccpars2_84_/1}).
+-file("src/egs_script_parser.yrl", 24).
+yeccpars2_84_(__Stack0) ->
+ [__2,__1 | __Stack] = __Stack0,
+ [begin
+ { __1 , __2 }
+ end | __Stack].
+
+
+-file("src/egs_script_parser.yrl", 91).
diff --git a/src/egs_script_parser.yrl b/apps/egs/src/egs_script_parser.yrl
similarity index 100%
rename from src/egs_script_parser.yrl
rename to apps/egs/src/egs_script_parser.yrl
diff --git a/src/egs_seasons.erl b/apps/egs/src/egs_seasons.erl
similarity index 100%
rename from src/egs_seasons.erl
rename to apps/egs/src/egs_seasons.erl
diff --git a/src/egs_shops_db.erl b/apps/egs/src/egs_shops_db.erl
similarity index 100%
rename from src/egs_shops_db.erl
rename to apps/egs/src/egs_shops_db.erl
diff --git a/src/egs_sup.erl b/apps/egs/src/egs_sup.erl
similarity index 100%
rename from src/egs_sup.erl
rename to apps/egs/src/egs_sup.erl
diff --git a/src/egs_universes.erl b/apps/egs/src/egs_universes.erl
similarity index 100%
rename from src/egs_universes.erl
rename to apps/egs/src/egs_universes.erl
diff --git a/src/egs_users.erl b/apps/egs/src/egs_users.erl
similarity index 100%
rename from src/egs_users.erl
rename to apps/egs/src/egs_users.erl
diff --git a/src/egs_zones.erl b/apps/egs/src/egs_zones.erl
similarity index 100%
rename from src/egs_zones.erl
rename to apps/egs/src/egs_zones.erl
diff --git a/src/egs_zones_sup.erl b/apps/egs/src/egs_zones_sup.erl
similarity index 100%
rename from src/egs_zones_sup.erl
rename to apps/egs/src/egs_zones_sup.erl
diff --git a/src/objects/egs_obj_chair.erl b/apps/egs/src/objects/egs_obj_chair.erl
similarity index 100%
rename from src/objects/egs_obj_chair.erl
rename to apps/egs/src/objects/egs_obj_chair.erl
diff --git a/src/objects/egs_obj_door.erl b/apps/egs/src/objects/egs_obj_door.erl
similarity index 100%
rename from src/objects/egs_obj_door.erl
rename to apps/egs/src/objects/egs_obj_door.erl
diff --git a/src/objects/egs_obj_entrance.erl b/apps/egs/src/objects/egs_obj_entrance.erl
similarity index 100%
rename from src/objects/egs_obj_entrance.erl
rename to apps/egs/src/objects/egs_obj_entrance.erl
diff --git a/src/objects/egs_obj_exit.erl b/apps/egs/src/objects/egs_obj_exit.erl
similarity index 100%
rename from src/objects/egs_obj_exit.erl
rename to apps/egs/src/objects/egs_obj_exit.erl
diff --git a/src/objects/egs_obj_invisible_block.erl b/apps/egs/src/objects/egs_obj_invisible_block.erl
similarity index 100%
rename from src/objects/egs_obj_invisible_block.erl
rename to apps/egs/src/objects/egs_obj_invisible_block.erl
diff --git a/src/objects/egs_obj_label.erl b/apps/egs/src/objects/egs_obj_label.erl
similarity index 100%
rename from src/objects/egs_obj_label.erl
rename to apps/egs/src/objects/egs_obj_label.erl
diff --git a/src/objects/egs_obj_npc.erl b/apps/egs/src/objects/egs_obj_npc.erl
similarity index 100%
rename from src/objects/egs_obj_npc.erl
rename to apps/egs/src/objects/egs_obj_npc.erl
diff --git a/src/objects/egs_obj_pp_cube.erl b/apps/egs/src/objects/egs_obj_pp_cube.erl
similarity index 100%
rename from src/objects/egs_obj_pp_cube.erl
rename to apps/egs/src/objects/egs_obj_pp_cube.erl
diff --git a/src/objects/egs_obj_sensor.erl b/apps/egs/src/objects/egs_obj_sensor.erl
similarity index 100%
rename from src/objects/egs_obj_sensor.erl
rename to apps/egs/src/objects/egs_obj_sensor.erl
diff --git a/src/objects/egs_obj_static_model.erl b/apps/egs/src/objects/egs_obj_static_model.erl
similarity index 100%
rename from src/objects/egs_obj_static_model.erl
rename to apps/egs/src/objects/egs_obj_static_model.erl
diff --git a/src/objects/egs_obj_type_counter.erl b/apps/egs/src/objects/egs_obj_type_counter.erl
similarity index 100%
rename from src/objects/egs_obj_type_counter.erl
rename to apps/egs/src/objects/egs_obj_type_counter.erl
diff --git a/src/objects/egs_obj_uni_cube.erl b/apps/egs/src/objects/egs_obj_uni_cube.erl
similarity index 100%
rename from src/objects/egs_obj_uni_cube.erl
rename to apps/egs/src/objects/egs_obj_uni_cube.erl
diff --git a/src/psu/psu_appearance.erl b/apps/egs/src/psu/psu_appearance.erl
similarity index 100%
rename from src/psu/psu_appearance.erl
rename to apps/egs/src/psu/psu_appearance.erl
diff --git a/src/psu/psu_characters.erl b/apps/egs/src/psu/psu_characters.erl
similarity index 100%
rename from src/psu/psu_characters.erl
rename to apps/egs/src/psu/psu_characters.erl
diff --git a/src/psu/psu_party.erl b/apps/egs/src/psu/psu_party.erl
similarity index 100%
rename from src/psu/psu_party.erl
rename to apps/egs/src/psu/psu_party.erl
diff --git a/data/lobby/.gitignore b/data/lobby/.gitignore
deleted file mode 100644
index 72e8ffc..0000000
--- a/data/lobby/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*
diff --git a/data/missions/.gitignore b/data/missions/.gitignore
deleted file mode 100644
index 72e8ffc..0000000
--- a/data/missions/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*
diff --git a/data/rooms/.gitignore b/data/rooms/.gitignore
deleted file mode 100644
index 72e8ffc..0000000
--- a/data/rooms/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*
diff --git a/data/tutorial/.gitignore b/data/tutorial/.gitignore
deleted file mode 100644
index 72e8ffc..0000000
--- a/data/tutorial/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*
diff --git a/rebar.config b/rebar.config
index 8521aa2..1a3e200 100644
--- a/rebar.config
+++ b/rebar.config
@@ -1,6 +1,5 @@
-{deps, [
- {ex_reloader, ".*", {git, "git://github.com/extend/ex_reloader.git", "HEAD"}},
- {cowboy, ".*", {git, "git://github.com/extend/cowboy.git", "HEAD"}}
+{sub_dirs, [
+ "apps/egs"
]}.
{dialyzer_opts, [src, {warnings, [
behaviours,
diff --git a/start.sh b/start.sh
index 9dcfb52..eb5abe5 100755
--- a/start.sh
+++ b/start.sh
@@ -2,4 +2,4 @@
echo "EGS is free software available under the GNU GPL version 3"
echo "Copyright (C) 2010-2011 Loic Hoguin"
echo
-erl -sname egs -pa ebin -pa deps/*/ebin -boot start_sasl -s ex_reloader -s egs
+erl -sname egs -pa apps/*/ebin -pa deps/*/ebin -boot start_sasl -s ex_reloader -s egs