diff options
37 files changed, 3491 insertions, 2744 deletions
diff --git a/crawl-ref/docs/level-design.txt b/crawl-ref/docs/level-design.txt index df23716945..adde72ece9 100644 --- a/crawl-ref/docs/level-design.txt +++ b/crawl-ref/docs/level-design.txt @@ -174,8 +174,8 @@ Terrain w - deep water - can be randomly turned into shallow water by the level-builder; you can prevent this conversion with the no_pool_fixup TAG. Also, water may automatically receive water creatures! For entry - vaults, avoid this with the no_monster_gen TAG. - l - lava - again, use the no_monster_gen TAG for entry vaults! + vaults, avoid this with the no_monster_gen TAG or KMASK. + l - lava - again, use the no_monster_gen TAG or KMASK for entry vaults! Features -------- @@ -364,6 +364,7 @@ TAGS: generate_awake, no_item_gen, no_monster_gen, no_pool_fixup, orc_entry, * "no_monster_gen": Prevents random monster generation at the time of the vault's creation. Highly advised for entry vaults with a player-hostile geography, MUST-HAVE for those with water/lava. + Can be applied only to particular symbols with KMASK. * "no_pool_fixup": prevents water squares next to land from being randomly converted from deep water (the default) to shallow. * "branch_entry" eg. "orc_entry", "lair_entry" etc. @@ -390,6 +391,32 @@ FLAGS: no_rotate, no_hmirror, no_vmirror * "no_hmirror": Like no_rotate, but for horizontal mirroring. * "no_vmirror": Like no_rotate, but for vertical mirroring. +LFLAGS: Persistent, changeable per-level flags which affect game + behavior (FLAGS just controls how the vault is placed); should + only be used for vaults with ORIENT encompass or with PLACE. + This causes a level's flags to be set when the level is first + created. These flags can later be altered using Lua markers; + see the slime pit vault in lair.des, and the vaults in hell.des + and elf.des for examples. + + Valid flags are: no_tele_control, which prevents the player + from using teleport control; not_mappable, which prevents + the player from remembering where they've been (like in + the Abyss), and no_magic_map, which prevents magic mapping + from working. + +BFLAGS: Persistent, changeable per-*branch* flags which affect game + behavior; should only be used for vaults which go on the fist + level of a particular branch. These flags can later be altered + using Lua markers; see the Tomb vaults in vaults.lua for an + example. + + Valid flags are: no_tele_control, which prevents the player + from using teleport control; not_mappable, which prevents + the player from remembering where they've been (like in + the Abyss), and no_magic_map, which prevents magic mapping + from working. + ITEM: (list of items, separated by comma) These are used to help place specified items at specific places within a vault. They create an array with up to 8 positions. What's @@ -569,6 +596,42 @@ KMONS: ? = orc priest / w:3 deep elf priest Or if you want to pick randomly: KMONS: n = Terence / Michael / Erica, human +KMASK: Z = no_monster_gen + + KMASK allows you set or unset various masks for particular + symbols, rather than for the entire vault like if you did it + with TAGS. Valid masks are + + * "no_item_gen": Prevents random item on that symbol. Items + explicitly placed on that symbol aren't affected. + * "no_monster_gen": Prevents random monster generation on that + symbol. MUST-HAVE for those with water/lava symbols in + entry vaults. + * "no_pool_fixup": prevents a water square next to land from being + randomly converted from deep water (the default) to shallow. + * "no_secret_doors": prevents a door from randomly being turned + into a secret door. + + For example + + KMASK: W = no_monster_gen + + will prevent monsters from randomly being generated on shallow + water squares. Note that if shuffling and substitutions cause + W to end up as water 10% of the time and floor 90% of the time, + then those floor squares will still have no_monster_gen set, but + that's still a higher degree of control than you get with TAGS. + + If TAGS has been used to set a mask for the entire vault, you + can use KMASK to remove that mask from particular symbols. + For instance: + + TAGS: no_monster_gen + KMASK: W = !no_monster_gen + + would make it so that monsters are only randomly generated + on shallow water squares. + KITEM: ? = potion of healing / potion of restore abilities KITEM: places the specified item at all occurrences of the placeholder. It can be combined with KFEAT: and KMONS: lines for @@ -1094,7 +1157,11 @@ default_depth, name, depth, place, tags, tags_remove, chance, weight, orient, shuffle, shuffle_remove, subst, subst_remove, map, mons, item, kfeat, kitem, kmons, grid, points_connected, gly_point, gly_points, original_map, glyphs_connected, orig_glyphs_connected, orig_gly_point, -orig_gly_points. +orig_gly_points, load_des_file, feature_number, feature_name, +dgn_event_type, register_listener, remove_listener, remove_marker, +num_matching_markers, feature_desc, feature_desc_at, item_from_index, +mons_from_index, change_level_flags, change_branch_flags + Lua API - global game state diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index ce04b6e51f..71809c47ad 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -890,6 +890,19 @@ static void handle_wizard_command( void ) break; case '{': + if (testbits(env.level_flags, LFLAG_NOT_MAPPABLE) + || testbits(get_branch_flags(), BFLAG_NOT_MAPPABLE)) + { + if (!yesno("Force level to be mappable? ")) + { + canned_msg( MSG_OK ); + return; + } + + unset_level_flags(LFLAG_NOT_MAPPABLE | LFLAG_NO_MAGIC_MAP); + unset_branch_flags(BFLAG_NOT_MAPPABLE | BFLAG_NO_MAGIC_MAP); + } + magic_mapping(1000, 100, true, true); break; diff --git a/crawl-ref/source/branch.cc b/crawl-ref/source/branch.cc index 3f81d87d32..f5a1a33769 100644 --- a/crawl-ref/source/branch.cc +++ b/crawl-ref/source/branch.cc @@ -6,6 +6,8 @@ #include "branch.h" #include "externs.h" #include "mon-pick.h" +#include "player.h" +#include "spells3.h" Branch& your_branch() { @@ -22,9 +24,92 @@ branch_type str_to_branch(const std::string &branch, branch_type err) return (err); } +bool set_branch_flags(unsigned long flags, bool silent, + branch_type branch) +{ + if (branch == NUM_BRANCHES) + branch = you.where_are_you; + + bool could_control = allow_control_teleport(true); + bool could_map = player_in_mappable_area(); + + unsigned long old_flags = branches[static_cast<int>(branch)].branch_flags; + branches[static_cast<int>(branch)].branch_flags |= flags; + + bool can_control = allow_control_teleport(true); + bool can_map = player_in_mappable_area(); + + if (you.level_type == LEVEL_DUNGEON && branch == you.where_are_you + && you.skills[SK_TRANSLOCATIONS] > 0 + && could_control && !can_control && !silent) + { + mpr("You sense the appearence of a powerful magical force " + "which warps space.", MSGCH_WARN); + } + + if (you.level_type == LEVEL_DUNGEON && branch == you.where_are_you + && could_map && !can_map && !silent) + { + mpr("A powerful force appears that prevents you from " + "remembering where you've been.", MSGCH_WARN); + } + + return (old_flags != branches[static_cast<int>(branch)].branch_flags); +} + +bool unset_branch_flags(unsigned long flags, bool silent, + branch_type branch) +{ + if (branch == NUM_BRANCHES) + branch = you.where_are_you; + + bool could_control = allow_control_teleport(true); + bool could_map = player_in_mappable_area(); + + unsigned long old_flags = branches[static_cast<int>(branch)].branch_flags; + branches[static_cast<int>(branch)].branch_flags &= ~flags; + + bool can_control = allow_control_teleport(true); + bool can_map = player_in_mappable_area(); + + if (you.level_type == LEVEL_DUNGEON && branch == you.where_are_you + && you.skills[SK_TRANSLOCATIONS] > 0 + && !could_control && can_control && !silent) + { + // Isn't really a "recovery", but I couldn't think of where + // else to send it. + mpr("You sense the disappearence of a powerful magical force " + "which warped space.", MSGCH_RECOVERY); + } + + if (you.level_type == LEVEL_DUNGEON && branch == you.where_are_you + && !could_map && can_map && !silent) + { + // Isn't really a "recovery", but I couldn't think of where + // else to send it. + mpr("You sense the disappearence the force that prevented you " + "from remembering where you've been.", MSGCH_RECOVERY); + } + + return (old_flags != branches[static_cast<int>(branch)].branch_flags); +} + +unsigned long get_branch_flags(branch_type branch) +{ + if (branch == NUM_BRANCHES) + { + if (you.level_type != LEVEL_DUNGEON) + return (0); + + branch = you.where_are_you; + } + + return branches[static_cast<int>(branch)].branch_flags; +} + Branch branches[] = { - { BRANCH_MAIN_DUNGEON, BRANCH_MAIN_DUNGEON, 27, -1, + { BRANCH_MAIN_DUNGEON, BRANCH_MAIN_DUNGEON, 27, -1, 0, 0, NUM_FEATURES, NUM_FEATURES, // sentinel values "Dungeon", "the Dungeon", "D", NULL, @@ -32,7 +117,7 @@ Branch branches[] = { mons_standard_rare, mons_standard_level, 8, 'D', false }, - { BRANCH_ECUMENICAL_TEMPLE, BRANCH_MAIN_DUNGEON, 1, 5, + { BRANCH_ECUMENICAL_TEMPLE, BRANCH_MAIN_DUNGEON, 1, 5, 0, 0, DNGN_ENTER_TEMPLE, DNGN_RETURN_FROM_TEMPLE, "Temple", "the Ecumenical Temple", "Temple", NULL, @@ -40,7 +125,7 @@ Branch branches[] = { mons_standard_rare, mons_standard_level, 0, 'T', false }, - { BRANCH_ORCISH_MINES, BRANCH_MAIN_DUNGEON, 4, 6, + { BRANCH_ORCISH_MINES, BRANCH_MAIN_DUNGEON, 4, 6, 0, 0, DNGN_ENTER_ORCISH_MINES, DNGN_RETURN_FROM_ORCISH_MINES, "Orcish Mines", "the Orcish Mines", "Orc", NULL, @@ -48,7 +133,7 @@ Branch branches[] = { mons_mineorc_rare, mons_mineorc_level, 20, 'O', false }, - { BRANCH_ELVEN_HALLS, BRANCH_ORCISH_MINES, 7, 4, + { BRANCH_ELVEN_HALLS, BRANCH_ORCISH_MINES, 7, 4, 0, 0, DNGN_ENTER_ELVEN_HALLS, DNGN_RETURN_FROM_ELVEN_HALLS, "Elven Halls", "the Elven Halls", "Elf", NULL, @@ -56,7 +141,7 @@ Branch branches[] = { mons_hallelf_rare, mons_hallelf_level, 8, 'E', false }, - { BRANCH_LAIR, BRANCH_MAIN_DUNGEON, 10, 8, + { BRANCH_LAIR, BRANCH_MAIN_DUNGEON, 10, 8, 0, 0, DNGN_ENTER_LAIR, DNGN_RETURN_FROM_LAIR, "Lair", "the Lair of Beasts", "Lair", NULL, @@ -64,7 +149,7 @@ Branch branches[] = { mons_lair_rare, mons_lair_level, 5, 'L', false }, - { BRANCH_SWAMP, BRANCH_LAIR, 5, 3, + { BRANCH_SWAMP, BRANCH_LAIR, 5, 3, 0, 0, DNGN_ENTER_SWAMP, DNGN_RETURN_FROM_SWAMP, "Swamp", "the Swamp", "Swamp", NULL, @@ -72,7 +157,7 @@ Branch branches[] = { mons_swamp_rare, mons_swamp_level, 0, 'S', false }, - { BRANCH_SHOALS, BRANCH_LAIR, 5, 4, + { BRANCH_SHOALS, BRANCH_LAIR, 5, 4, 0, 0, DNGN_ENTER_SHOALS, DNGN_RETURN_FROM_SHOALS, "Shoals", "the Shoals", "Shoal", NULL, @@ -80,7 +165,7 @@ Branch branches[] = { mons_shoals_rare, mons_shoals_level, 0, 'A', false }, - { BRANCH_SLIME_PITS, BRANCH_LAIR, 6, 4, + { BRANCH_SLIME_PITS, BRANCH_LAIR, 6, 4, 0, 0, DNGN_ENTER_SLIME_PITS, DNGN_RETURN_FROM_SLIME_PITS, "Slime Pits", "the Pits of Slime", "Slime", NULL, @@ -88,7 +173,7 @@ Branch branches[] = { mons_pitslime_rare, mons_pitslime_level, 5, 'M', false }, - { BRANCH_SNAKE_PIT, BRANCH_LAIR, 5, 7, + { BRANCH_SNAKE_PIT, BRANCH_LAIR, 5, 7, 0, 0, DNGN_ENTER_SNAKE_PIT, DNGN_RETURN_FROM_SNAKE_PIT, "Snake Pit", "the Snake Pit", "Snake", NULL, @@ -96,7 +181,7 @@ Branch branches[] = { mons_pitsnake_rare, mons_pitsnake_level, 10, 'P', false }, - { BRANCH_HIVE, BRANCH_MAIN_DUNGEON, 4, 15, + { BRANCH_HIVE, BRANCH_MAIN_DUNGEON, 4, 15, 0, 0, DNGN_ENTER_HIVE, DNGN_RETURN_FROM_HIVE, "Hive", "the Hive", "Hive", "You hear a buzzing sound coming from all directions.", @@ -104,7 +189,7 @@ Branch branches[] = { mons_hive_rare, mons_hive_level, 0, 'H', false }, - { BRANCH_VAULTS, BRANCH_MAIN_DUNGEON, 8, 17, + { BRANCH_VAULTS, BRANCH_MAIN_DUNGEON, 8, 17, 0, 0, DNGN_ENTER_VAULTS, DNGN_RETURN_FROM_VAULTS, "Vaults", "the Vaults", "Vault", NULL, @@ -113,7 +198,7 @@ Branch branches[] = { 5, 'V', false }, - { BRANCH_HALL_OF_BLADES, BRANCH_VAULTS, 1, 4, + { BRANCH_HALL_OF_BLADES, BRANCH_VAULTS, 1, 4, 0, 0, DNGN_ENTER_HALL_OF_BLADES, DNGN_RETURN_FROM_HALL_OF_BLADES, "Hall of Blades", "the Hall of Blades", "Blade", NULL, @@ -121,7 +206,7 @@ Branch branches[] = { mons_hallblade_rare, mons_hallblade_level, 0, 'B', false }, - { BRANCH_CRYPT, BRANCH_VAULTS, 5, 3, + { BRANCH_CRYPT, BRANCH_VAULTS, 5, 3, 0, 0, DNGN_ENTER_CRYPT, DNGN_RETURN_FROM_CRYPT, "Crypt", "the Crypt", "Crypt", NULL, @@ -129,7 +214,7 @@ Branch branches[] = { mons_crypt_rare, mons_crypt_level, 5, 'C', false }, - { BRANCH_TOMB, BRANCH_CRYPT, 3, 5, + { BRANCH_TOMB, BRANCH_CRYPT, 3, 5, 0, 0, DNGN_ENTER_TOMB, DNGN_RETURN_FROM_TOMB, "Tomb", "the Tomb of the Ancients", "Tomb", NULL, @@ -137,7 +222,7 @@ Branch branches[] = { mons_tomb_rare, mons_tomb_level, 0, 'G', false }, - { BRANCH_VESTIBULE_OF_HELL, BRANCH_MAIN_DUNGEON, 1, -1, + { BRANCH_VESTIBULE_OF_HELL, BRANCH_MAIN_DUNGEON, 1, -1, 0, 0, DNGN_ENTER_HELL, NUM_FEATURES, // sentinel "Hell", "The Vestibule of Hell", "Hell", NULL, @@ -145,7 +230,7 @@ Branch branches[] = { mons_standard_rare, mons_standard_level, 0, 'U', false }, - { BRANCH_DIS, BRANCH_VESTIBULE_OF_HELL, 7, -1, + { BRANCH_DIS, BRANCH_VESTIBULE_OF_HELL, 7, -1, 0, 0, DNGN_ENTER_DIS, NUM_FEATURES, // sentinel "Dis", "the Iron City of Dis", "Dis", NULL, @@ -153,7 +238,7 @@ Branch branches[] = { mons_dis_rare, mons_dis_level, 0, 'I', true }, - { BRANCH_GEHENNA, BRANCH_VESTIBULE_OF_HELL, 7, -1, + { BRANCH_GEHENNA, BRANCH_VESTIBULE_OF_HELL, 7, -1, 0, 0, DNGN_ENTER_GEHENNA, NUM_FEATURES, // sentinel "Gehenna", "Gehenna", "Geh", NULL, @@ -161,7 +246,7 @@ Branch branches[] = { mons_gehenna_rare, mons_gehenna_level, 0, 'N', true }, - { BRANCH_COCYTUS, BRANCH_VESTIBULE_OF_HELL, 7, -1, + { BRANCH_COCYTUS, BRANCH_VESTIBULE_OF_HELL, 7, -1, 0, 0, DNGN_ENTER_COCYTUS, NUM_FEATURES, // sentinel "Cocytus", "Cocytus", "Coc", NULL, @@ -169,7 +254,7 @@ Branch branches[] = { mons_cocytus_rare, mons_cocytus_level, 0, 'X', true }, - { BRANCH_TARTARUS, BRANCH_VESTIBULE_OF_HELL, 7, -1, + { BRANCH_TARTARUS, BRANCH_VESTIBULE_OF_HELL, 7, -1, 0, 0, DNGN_ENTER_TARTARUS, NUM_FEATURES, // sentinel "Tartarus", "Tartarus", "Tar", NULL, @@ -177,7 +262,7 @@ Branch branches[] = { mons_tartarus_rare, mons_tartarus_level, 0, 'Y', true }, - { BRANCH_INFERNO, BRANCH_MAIN_DUNGEON, -1, -1, + { BRANCH_INFERNO, BRANCH_MAIN_DUNGEON, -1, -1, 0, 0, NUM_FEATURES, NUM_FEATURES, NULL, NULL, NULL, NULL, @@ -185,7 +270,7 @@ Branch branches[] = { NULL, NULL, 0, 'R', false }, - { BRANCH_THE_PIT, BRANCH_MAIN_DUNGEON, -1, -1, + { BRANCH_THE_PIT, BRANCH_MAIN_DUNGEON, -1, -1, 0, 0, NUM_FEATURES, NUM_FEATURES, NULL, NULL, NULL, NULL, @@ -193,7 +278,7 @@ Branch branches[] = { NULL, NULL, 0, '0', false }, - { BRANCH_HALL_OF_ZOT, BRANCH_MAIN_DUNGEON, 5, 27, + { BRANCH_HALL_OF_ZOT, BRANCH_MAIN_DUNGEON, 5, 27, 0, 0, DNGN_ENTER_ZOT, DNGN_RETURN_FROM_ZOT, "Zot", "the Realm of Zot", "Zot", NULL, @@ -201,7 +286,7 @@ Branch branches[] = { mons_hallzot_rare, mons_hallzot_level, 1, 'Z', false }, - { BRANCH_CAVERNS, BRANCH_MAIN_DUNGEON, -1, -1, + { BRANCH_CAVERNS, BRANCH_MAIN_DUNGEON, -1, -1, 0, 0, NUM_FEATURES, NUM_FEATURES, NULL, NULL, NULL, NULL, diff --git a/crawl-ref/source/branch.h b/crawl-ref/source/branch.h index 009bb89bca..9ddc1a1d0a 100644 --- a/crawl-ref/source/branch.h +++ b/crawl-ref/source/branch.h @@ -12,6 +12,15 @@ #include "enum.h" +enum branch_flag_type +{ + BFLAG_NONE = 0, + + BFLAG_NO_TELE_CONTROL = (1 << 0), // Teleport control not allowed. + BFLAG_NOT_MAPPABLE = (1 << 1), // Branch levels not mappable. + BFLAG_NO_MAGIC_MAP = (1 << 2) // Branch levels can't be magic mapped. +}; + struct Branch { branch_type id; @@ -19,6 +28,8 @@ struct Branch int depth; int startdepth; // which level of the parent branch, // 1 for first level + unsigned long branch_flags; + unsigned long default_level_flags; dungeon_feature_type entry_stairs; dungeon_feature_type exit_stairs; const char* shortname; // "Slime Pits" @@ -42,4 +53,10 @@ Branch& your_branch(); branch_type str_to_branch(const std::string &branch, branch_type err = NUM_BRANCHES); +bool set_branch_flags(unsigned long flags, bool silent = false, + branch_type branch = NUM_BRANCHES); +bool unset_branch_flags(unsigned long flags, bool silent = false, + branch_type branch = NUM_BRANCHES); +unsigned long get_branch_flags(branch_type branch = NUM_BRANCHES); + #endif diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index cf16990557..3094ef8d71 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -373,7 +373,6 @@ void CLua::vfnreturns(const char *format, va_list args) lua_pop(ls, nrets); } -static void push_monster(lua_State *ls, monsters *mons); static int push_activity_interrupt(lua_State *ls, activity_interrupt_data *t); int CLua::push_args(lua_State *ls, const char *format, va_list args, va_list *targ) @@ -2263,7 +2262,7 @@ static int push_activity_interrupt(lua_State *ls, activity_interrupt_data *t) return 0; } -static void push_monster(lua_State *ls, monsters *mons) +void push_monster(lua_State *ls, monsters *mons) { MonsterWrap *mw = clua_new_userdata< MonsterWrap >(ls, MONS_METATABLE); mw->turn = you.num_turns; diff --git a/crawl-ref/source/clua.h b/crawl-ref/source/clua.h index 99a4e24bc3..554c85d79f 100644 --- a/crawl-ref/source/clua.h +++ b/crawl-ref/source/clua.h @@ -235,6 +235,8 @@ template <class T> T *clua_new_userdata( return static_cast<T*>( udata ); } +void push_monster(lua_State *ls, monsters *mons); + #define MAP_METATABLE "dgn.mtmap" #define DEVENT_METATABLE "dgn.devent" #define MAPMARK_METATABLE "dgn.mapmark" diff --git a/crawl-ref/source/dat/clua/lm_flags.lua b/crawl-ref/source/dat/clua/lm_flags.lua new file mode 100644 index 0000000000..770c80110e --- /dev/null +++ b/crawl-ref/source/dat/clua/lm_flags.lua @@ -0,0 +1,347 @@ +--------------------------------------------------------------------------- +-- lm_flags.lua +-- Changing level flags and branch flags +-------------------------------------------------------------------------- + +-------------------------------------------------------------------------- +-- There are three different types of pre-packaged "change level and +-- branch flags" marker types. All three share the following parameters: +-- +-- * level_flags: A space separated list of level flag names to set or unset. +-- To unset a flag, prefix the name with "!". +-- +-- * branch_flags: Like level_flags, but for branch flags to set or unset. +-- +-- * group: Different flag change markers on the same level can be put +-- into the same group by giving them the same group name. +-- Of all of the markers in the same group, only the last one +-- to have its conditions met will cause the flags to change. +-- This is useful if, for example, there are two magical fountains, +-- and you only want the flags to change when both dry up. +-- +-- * msg: A message to give the user when the flags are changed; suppress +-- any messages Crawl would normally give for the changes effected. +-- The message is not given if nothing is changed (i.e., if all +-- the flags to be set were already set and all the flags to be +-- unset were already unset). +-- +-- The three different marker types can be created with the following +-- functions: +-- +-- * mons_dies_change_flags(): Creates a marker which changes the flags +-- when a named monster dies. Accepts the parameter "mon_name" +-- as the name of the monster to watch. The marker can be +-- placed anywhere on the level, and doesn't have to be near the +-- monster when it dies. +-- +-- * feat_change_change_flags(): Creates a marker which acts when the +-- feature of its grid changes. Accepts the optional string +-- parameter "final_feat", which will cause the change to only +-- take place when the changed feature contains final_feat as +-- a substring. For example, a sparkling fountain can dry up +-- either by turning directly into a dry_fountain_ii feature, +-- or by first turning into a blue_fountain feature, and then +-- into a dry_fountain_i feature. Without final_feat, the +-- flags will change if the sparkling fountain changes into +-- a blue fountain. However, if "final_feat" is set to +-- "dry_fountain", the marker will ignore the feature turning +-- into blue_fountain, and will only act when it changes into +-- dry_fountain_i or dry_fountain_ii +-- +-- * item_pickup_change_flags(): Creates a marker which acts when +-- an item on its grid gets picked up. Accepts the parameter +-- "item", which is the plain name of the item its watching +-- (i.e., "Orb of Zot" and "golden rune" rather than "the Orb of Zot" +-- or "a golden rune"). +-------------------------------------------------------------------------- + +ChangeFlags = { } +ChangeFlags.__index = ChangeFlags + +function ChangeFlags:_new() + local cf = { } + setmetatable(cf, self) + self.__index = self + + return cf +end + +function ChangeFlags:new(pars) + pars = pars or { } + + pars.level_flags = pars.level_flags or "" + pars.branch_flags = pars.branch_flags or "" + pars.msg = pars.msg or "" + + if not (pars.level_flags ~= "" or pars.branch_flags ~= "") then + error("Must provide at least one of level_flags or branch_flags.") + end + + local cf = self:_new() + cf.level_flags = pars.level_flags + cf.branch_flags = pars.branch_flags + cf.msg = pars.msg + cf.props = { flag_group = pars.group } + + return cf +end + +function ChangeFlags:do_change(marker) + local did_change1 = false + local did_change2 = false + local silent = self.msg and self.msg ~= "" + + if self.props.flag_group and self.props.flag_group ~= "" then + local num_markers = dgn.num_matching_markers("flag_group", + self.props.group) + + if num_markers > 1 then + return false, false + end + end + + if self.level_flags and self.level_flags ~= "" then + did_change1 = dgn.change_level_flags(self.level_flags, silent) + end + + if self.branch_flags and self.branch_flags ~= "" then + did_change2 = dgn.change_branch_flags(self.branch_flags, silent) + end + + if did_change1 or did_change2 then + if self.msg and self.msg ~= "" then + crawl.mpr(self.smg) + end + + return true, true + end + + return true, false +end + +function ChangeFlags:property(marker, pname) + return self.props[pname] or '' +end + +function ChangeFlags:write(marker, th) + file.marshall(th, self.level_flags) + file.marshall(th, self.branch_flags) + file.marshall(th, self.msg) + lmark.marshall_table(th, self.props) +end + +function ChangeFlags:read(marker, th) + self.level_flags = file.unmarshall_string(th) + self.branch_flags = file.unmarshall_string(th) + self.msg = file.unmarshall_string(th) + self.props = lmark.unmarshall_table(th) + setmetatable(self, ChangeFlags) + + return self +end + +-------------------------------------------------------------------------- +-------------------------------------------------------------------------- + +MonDiesChangeFlags = ChangeFlags:_new() +MonDiesChangeFlags.__index = MonDiesChangeFlags + +function MonDiesChangeFlags:_new(pars) + local mdcf + + if pars then + mdcf = ChangeFlags:new(pars) + else + mdcf = ChangeFlags:_new() + end + + setmetatable(mdcf, self) + self.__index = self + + return mdcf +end + +function MonDiesChangeFlags:new(pars) + pars = pars or { } + + if not pars.mon_name then + error("No monster name provided.") + end + + local mdcf = self:_new(pars) + mdcf.mon_name = pars.mon_name + + return mdcf +end + +function MonDiesChangeFlags:activate(marker) + dgn.register_listener(dgn.dgn_event_type('monster_dies'), marker) +end + +function MonDiesChangeFlags:event(marker, ev) + local midx = ev:arg1() + local mons = dgn.mons_from_index(midx) + + if not mons then + error("MonDiesChangeFlags:event() didn't get a valid monster index") + end + + if mons.name == self.mon_name then + ChangeFlags.do_change(self, marker) + dgn.remove_listener(marker) + dgn.remove_marker(marker) + end +end + +function MonDiesChangeFlags:write(marker, th) + ChangeFlags.write(self, marker, th) + file.marshall(th, self.mon_name) +end + +function MonDiesChangeFlags:read(marker, th) + ChangeFlags.read(self, marker, th) + self.mon_name = file.unmarshall_string(th) + setmetatable(self, MonDiesChangeFlags) + + return self +end + +function mons_dies_change_flags(pars) + return MonDiesChangeFlags:new(pars) +end + +----------------------------------------------------------------------------- +----------------------------------------------------------------------------- +FeatChangeChangeFlags = ChangeFlags:_new() +FeatChangeChangeFlags.__index = FeatChangeChangeFlags + +function FeatChangeChangeFlags:_new(pars) + local fccf + + if pars then + fccf = ChangeFlags:new(pars) + else + fccf = ChangeFlags:_new() + end + + setmetatable(fccf, self) + self.__index = self + + return fccf +end + +function FeatChangeChangeFlags:new(pars) + pars = pars or { } + + local fccf = self:_new(pars) + + fccf.final_feat = pars.final_feat + + return fccf +end + +function FeatChangeChangeFlags:activate(marker) + dgn.register_listener(dgn.dgn_event_type('feat_change'), marker, + marker:pos()) +end + +function FeatChangeChangeFlags:event(marker, ev) + if self.final_feat and self.final_feat ~= "" then + local feat = dgn.feature_name(dgn.grid(ev:pos())) + if not string.find(feat, self.final_feat) then + return + end + end + + ChangeFlags.do_change(self, marker) + dgn.remove_listener(marker, marker:pos()) + dgn.remove_marker(marker) +end + +function FeatChangeChangeFlags:write(marker, th) + ChangeFlags.write(self, marker, th) + file.marshall(th, self.final_feat) +end + +function FeatChangeChangeFlags:read(marker, th) + ChangeFlags.read(self, marker, th) + self.final_feat = file.unmarshall_string(th) + setmetatable(self, FeatChangeChangeFlags) + + return self +end + +function feat_change_change_flags(pars) + return FeatChangeChangeFlags:new(pars) +end + +-------------------------------------------------------------------------- +-------------------------------------------------------------------------- + +ItemPickupChangeFlags = ChangeFlags:_new() +ItemPickupChangeFlags.__index = ItemPickupChangeFlags + +function ItemPickupChangeFlags:_new(pars) + local ipcf + + if pars then + ipcf = ChangeFlags:new(pars) + else + ipcf = ChangeFlags:_new() + end + + setmetatable(ipcf, self) + self.__index = self + + return ipcf +end + +function ItemPickupChangeFlags:new(pars) + pars = pars or { } + + if not pars.item then + error("No item name provided.") + end + + local ipcf = self:_new(pars) + ipcf.item = pars.item + + return ipcf +end + +function ItemPickupChangeFlags:activate(marker) + dgn.register_listener(dgn.dgn_event_type('item_pickup'), marker, + marker:pos()) +end + +function ItemPickupChangeFlags:event(marker, ev) + local obj_idx = ev:arg1() + local it = dgn.item_from_index(obj_idx) + + if not it then + error("ItemPickupChangeFlags:event() didn't get a valid item index") + end + + if item.name(it) == self.item then + ChangeFlags.do_change(self, marker) + dgn.remove_listener(marker, marker:pos()) + dgn.remove_marker(marker) + end +end + +function ItemPickupChangeFlags:write(marker, th) + ChangeFlags.write(self, marker, th) + file.marshall(th, self.item) +end + +function ItemPickupChangeFlags:read(marker, th) + ChangeFlags.read(self, marker, th) + self.item = file.unmarshall_string(th) + setmetatable(self, ItemPickupChangeFlags) + + return self +end + +function item_pickup_change_flags(pars) + return ItemPickupChangeFlags:new(pars) +end diff --git a/crawl-ref/source/dat/clua/luamark.lua b/crawl-ref/source/dat/clua/luamark.lua index 58eeda6c68..0c29327ab5 100644 --- a/crawl-ref/source/dat/clua/luamark.lua +++ b/crawl-ref/source/dat/clua/luamark.lua @@ -6,6 +6,7 @@ dofile('clua/lm_pdesc.lua') dofile('clua/lm_1way.lua') dofile('clua/lm_timed.lua') +dofile('clua/lm_flags.lua') function dlua_marker_function(table, name) return table[name] diff --git a/crawl-ref/source/dat/elf.des b/crawl-ref/source/dat/elf.des index b1d692f674..5bd1eb2824 100644 --- a/crawl-ref/source/dat/elf.des +++ b/crawl-ref/source/dat/elf.des @@ -97,6 +97,7 @@ NAME: elf_hall PLACE: Elf:7 ORIENT: northwest FLAGS: no_rotate +LFLAGS: no_tele_control MONS: deep elf high priest, deep elf demonologist, deep elf annihilator MONS: deep elf sorcerer, deep elf death mage MONS: deep elf blademaster, deep elf master archer @@ -110,6 +111,10 @@ SUBST: v : xvb SUBST: | = | *:2 SUBST: $ = $:20 *:4 |:1 SUBST: * = * |:3 +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx @@ -157,6 +162,7 @@ NAME: elf_hall_gauntlet_wide PLACE: Elf:7 TAGS: no_pool_fixup FLAGS: no_rotate +LFLAGS: no_tele_control ORIENT: float CHANCE: 5 MONS: deep elf high priest, deep elf demonologist @@ -173,6 +179,10 @@ KMONS: A = deep elf master archer KFEAT: A = | KMONS: B = deep elf blademaster KFEAT: B = | +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP cccccccccccccccccccccccccc c2ccccccc........ccccccccc @@ -204,6 +214,7 @@ ENDMAP NAME: elf_hall_gauntlet_narrow PLACE: Elf:7 FLAGS: no_rotate +LFLAGS: no_tele_control TAGS: no_pool_fixup ORIENT: float CHANCE: 5 @@ -226,6 +237,10 @@ SUBST: | = | *:2 SUBST: * = * |:3 KITEM: 6 = | KITEM: 7 = | +#MARKER: U = lua:feat_change_change_flags { \ +# level_flags="!no_tele_control", final_feat="dry_fountain", \ +# group="fountain" \ +# } MAP ccccccccccccccccccccccccc c2ccccccc.......ccccccccc @@ -260,7 +275,8 @@ NAME: elf_hall_rogue_1 PLACE: Elf:7 CHANCE: 1 ORIENT: float -FLAGS: no_rotate +FLAGS: no_rotate +LFLAGS: no_tele_control ITEM: scroll of teleportation, any scroll MONS: deep elf high priest, deep elf demonologist MONS: deep elf annihilator, deep elf sorcerer @@ -272,6 +288,10 @@ SUBST: !=15, ?=.?, ?:23, 4=4. SUBST: % = % *:1 SUBST: | = | *:2 SUBST: * = * |:3 +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP ccccccccccccccccccccccccccccccccccccccccccc cxcccc$$ce**|||**eccccccce%*%%%*%ec$$ccccxc @@ -305,7 +325,8 @@ NAME: elf_hall_rogue_2 PLACE: Elf:7 CHANCE: 1 ORIENT: float -FLAGS: no_rotate +FLAGS: no_rotate +LFLAGS: no_tele_control ITEM: scroll of teleportation, any scroll MONS: deep elf high priest, deep elf demonologist MONS: deep elf annihilator, deep elf sorcerer @@ -317,6 +338,10 @@ SUBST: !=15, ?=.?, ?:23, 4=4. SUBST: % = % *:1 SUBST: | = | *:2 SUBST: * = * |:3 +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP ccccccccccccccccccccccccccccccccccccccccccc cxcccc$$ce%*%%%%%ecccccc=e**|||**ec$$ccccxc @@ -350,7 +375,8 @@ NAME: elf_hall_rogue_3 PLACE: Elf:7 CHANCE: 1 ORIENT: float -FLAGS: no_rotate +FLAGS: no_rotate +LFLAGS: no_tele_control ITEM: scroll of teleportation, any scroll MONS: deep elf high priest, deep elf demonologist MONS: deep elf annihilator, deep elf sorcerer @@ -362,6 +388,10 @@ SUBST: !=15, ?=.?, ?:23, 4=4. SUBST: % = % *:1 SUBST: | = | *:2 SUBST: * = * |:3 +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP ccccccccccccccccccccccccccccccccccccccccccc cxcccc$$ce%%%%%*%eccccccce**|||**ec$$=cccxc @@ -395,7 +425,8 @@ NAME: elf_hall_rogue_4 PLACE: Elf:7 CHANCE: 1 ORIENT: float -FLAGS: no_rotate +FLAGS: no_rotate +LFLAGS: no_tele_control ITEM: scroll of teleportation, any scroll MONS: deep elf high priest, deep elf demonologist MONS: deep elf annihilator, deep elf sorcerer @@ -407,6 +438,10 @@ SUBST: !=15, ?=.?, ?:23, 4=4. SUBST: % = % *:1 SUBST: | = | *:2 SUBST: * = * |:3 +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP ccccccccccccccccccccccccccccccccccccccccccc cxcccc$$ce%*%%%%%eccccccce**|||**ec$$ccccxc @@ -440,7 +475,8 @@ NAME: elf_hall_rogue_5 PLACE: Elf:7 CHANCE: 1 ORIENT: float -FLAGS: no_rotate +FLAGS: no_rotate +LFLAGS: no_tele_control ITEM: scroll of teleportation, any scroll MONS: deep elf high priest, deep elf demonologist MONS: deep elf annihilator, deep elf sorcerer @@ -452,6 +488,10 @@ SUBST: !=15, ?=.?, ?:23, 4=4. SUBST: % = % *:1 SUBST: | = | *:2 SUBST: * = * |:3 +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP ccccccccccccccccccccccccccccccccccccccccccc cxcccc$$cd%%%%%%%dc==c===e%%%%%%%ec$$ccccxc @@ -485,7 +525,8 @@ NAME: elf_hall_rogue_6 PLACE: Elf:7 CHANCE: 1 ORIENT: float -FLAGS: no_rotate +FLAGS: no_rotate +LFLAGS: no_tele_control ITEM: scroll of teleportation, any scroll MONS: deep elf high priest, deep elf demonologist MONS: deep elf annihilator, deep elf sorcerer @@ -497,6 +538,10 @@ SUBST: !=15, ?=.?, ?:23, 4=4. SUBST: % = % *:1 SUBST: | = | *:2 SUBST: * = * |:3 +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP ccccccccccccccccccccccccccccccccccccccccccc cxcccc$$ce%%%%%%%eccccccce**|||**ec$$ccccxc @@ -530,7 +575,8 @@ NAME: elf_hall_rogue_7 PLACE: Elf:7 CHANCE: 1 ORIENT: float -FLAGS: no_rotate +FLAGS: no_rotate +LFLAGS: no_tele_control ITEM: scroll of teleportation, any scroll MONS: deep elf high priest, deep elf demonologist MONS: deep elf annihilator, deep elf sorcerer @@ -542,6 +588,10 @@ SUBST: !=15, ?=.?, ?:23, 4=4. SUBST: % = % *:1 SUBST: | = | *:2 SUBST: * = * |:3 +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP ccccccccccccccccccccccccccccccccccccccccccc cxcccc$$cd|*|||**dcccccccd*||*|**dc$$ccccxc @@ -575,7 +625,8 @@ NAME: elf_hall_rogue_8 PLACE: Elf:7 CHANCE: 1 ORIENT: float -FLAGS: no_rotate +FLAGS: no_rotate +LFLAGS: no_tele_control ITEM: scroll of teleportation, any scroll MONS: deep elf high priest, deep elf demonologist MONS: deep elf annihilator, deep elf sorcerer @@ -587,6 +638,10 @@ SUBST: !=15, ?=.?, ?:23, 4=4. SUBST: % = % *:1 SUBST: | = | *:2 SUBST: * = * |:3 +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP ccccccccccccccccccccccccccccccccccccccccccc cxcccc$$ce*|||||*ec==ccc=e*|||||*ec$$ccccxc @@ -620,7 +675,8 @@ NAME: elf_hall_rogue_9 PLACE: Elf:7 CHANCE: 1 ORIENT: float -FLAGS: no_rotate +FLAGS: no_rotate +LFLAGS: no_tele_control ITEM: scroll of teleportation, any scroll MONS: deep elf high priest, deep elf demonologist MONS: deep elf annihilator, deep elf sorcerer @@ -632,6 +688,10 @@ SUBST: !=15, ?=.?, ?:23, 4=4. SUBST: % = % *:1 SUBST: | = | *:2 SUBST: * = * |:3 +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP ccccccccccccccccccccccccccccccccccccccccccc cxcccc$$=e**|||**eccccccce%%|%|%%e=$$ccccxc @@ -665,7 +725,8 @@ NAME: elf_hall_rogue_10 PLACE: Elf:7 CHANCE: 1 ORIENT: float -FLAGS: no_rotate +FLAGS: no_rotate +LFLAGS: no_tele_control ITEM: scroll of teleportation, any scroll MONS: deep elf high priest, deep elf demonologist MONS: deep elf annihilator, deep elf sorcerer @@ -677,6 +738,10 @@ SUBST: !=15, ?=.?, ?:23, 4=4. SUBST: % = % *:1 SUBST: | = | *:2 SUBST: * = * |:3 +MARKER: U = lua:feat_change_change_flags { \ + level_flags="!no_tele_control", final_feat="dry_fountain", \ + group="fountain" \ + } MAP ccccccccccccccccccccccccccccccccccccccccccc cxccc====ccccc=======cccc====ccccccccccccxc diff --git a/crawl-ref/source/dat/hells.des b/crawl-ref/source/dat/hells.des index 032d916352..3a00aadf68 100644 --- a/crawl-ref/source/dat/hells.des +++ b/crawl-ref/source/dat/hells.des @@ -203,6 +203,10 @@ NAME: castle_dis PLACE: Dis:7 TAGS: dis ORIENT: north +LFLAGS: no_tele_control +MARKER: O = lua:item_pickup_change_flags { \ + level_flags="!no_tele_control", item="iron rune" \ + } MAP xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx @@ -253,6 +257,10 @@ MONS: random, random NAME: asmodeus PLACE: Geh:7 ORIENT: encompass +LFLAGS: no_tele_control +MARKER: O = lua:item_pickup_change_flags { \ + level_flags="!no_tele_control", item="obsidian rune" \ + } MAP xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx @@ -337,12 +345,16 @@ MONS: Serpent of Hell, random, random NAME: antaeus_david_1 PLACE: Coc:7 ORIENT: encompass +LFLAGS: no_tele_control MONS: Antaeus, Ice Fiend, ice dragon / nothing ITEM: any, any misc, any misc, any misc SHUFFLE: O1d / e0% / f9* / g8| KMONS: d = ice devil w:5 / Ice Fiend / nothing w:5 KITEM: d = any SUBST: ' = w . +MARKER: O = lua:item_pickup_change_flags { \ + level_flags="!no_tele_control", item="icy rune" \ + } MAP xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx @@ -423,9 +435,13 @@ ENDMAP NAME: antaeus_in_days_of_yore PLACE: Coc:7 ORIENT: encompass +LFLAGS: no_tele_control SHUFFLE: $|, 2X SUBST: X=., 3=3. MONS: Antaeus, Ice Fiend, ice dragon, Ice Fiend +MARKER: O = lua:item_pickup_change_flags { \ + level_flags="!no_tele_control", item="icy rune" \ + } MAP xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx @@ -508,8 +524,12 @@ ENDMAP NAME: ereshkigal PLACE: Tar:7 ORIENT: encompass +LFLAGS: no_tele_control MONS: Ereshkigal, necrophage, wraith, shadow, small zombie MONS: small skeleton, Shadow Fiend +MARKER: O = lua:item_pickup_change_flags { \ + level_flags="!no_tele_control", item="bone rune" \ + } MAP xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx diff --git a/crawl-ref/source/dat/lair.des b/crawl-ref/source/dat/lair.des index 11bb0086fc..3e516e49ee 100644 --- a/crawl-ref/source/dat/lair.des +++ b/crawl-ref/source/dat/lair.des @@ -606,9 +606,14 @@ ENDMAP NAME: slime_pit PLACE: Slime:6 ORIENT: encompass +LFLAGS: no_tele_control +MARKER: X = lua:mons_dies_change_flags { \ + level_flags="!no_tele_control", mon_name="royal jelly" \ + } MONS: royal jelly, acid blob, great orb of eyes / nothing SUBST: ' : ' .:1, ' : ' x:1, ' = .x SUBST: " : " .:3, " = .c +SUBST: X = . SHUFFLE: ([{ MAP xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx @@ -643,7 +648,7 @@ xxxxxxxxxxxx'................"cc**|*cc..cc*|**cc"................'''xxxxxxxxxxxx xxxxxxxxxxxx'................"ccc**c|cc4c|c**ccc"..................xxxxxxxxxxxxx xxxxxxxxxxx'................."cccccccc.3cccccccc"..................'xxxxxxxxxxxx xxxxxxxxxxx'................."c.4.c.4.1..4.c.4.c"..................''xxxxxxxxxxx -xxxxxxxxxxx'..................2.c.4.c....c.4.c.2....................'xxxxxxxxxxx +xxxxxxxxxxx'..................2.c.4.c.X..c.4.c.2....................'xxxxxxxxxxx xxxxxxxxxx'..........)......."cccccccc3.cccccccc"...................'xxxxxxxxxxx xxxxxxxxxx'.................."ccc**c|cc4c|c**ccc"...................'xxxxxxxxxxx xxxxxxxxxx'.................."cc**|*cc..cc*|**cc"..................'xxxxxxxxxxxx diff --git a/crawl-ref/source/dat/vaults.des b/crawl-ref/source/dat/vaults.des index 96dec29926..361e6fe30e 100644 --- a/crawl-ref/source/dat/vaults.des +++ b/crawl-ref/source/dat/vaults.des @@ -364,6 +364,8 @@ ENDMAP NAME: tomb_1 PLACE: Tomb:1 ORIENT: encompass +# The whole branch starts off with teleport control prevention. +BFLAGS: no_tele_control # SHUFFLE: ([{, AB), ]}, FIJKL/fijkl, _- SUBST: A=|*, B=|* @@ -580,6 +582,9 @@ SUBST: $ = *:2 |:1 $:17 # MONS: mummy, guardian mummy, mummy priest, greater mummy # +MARKER: O = lua:item_pickup_change_flags { \ + branch_flags="!no_tele_control", item="golden rune" \ + } MAP xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx diff --git a/crawl-ref/source/dat/zot.des b/crawl-ref/source/dat/zot.des index d832d224a2..9edba91f88 100644 --- a/crawl-ref/source/dat/zot.des +++ b/crawl-ref/source/dat/zot.des @@ -9,6 +9,7 @@ NAME: hall_of_Zot PLACE: Zot:5 ORIENT: north +LFLAGS: no_tele_control #traps SUBST: C = c:1000 = @@ -35,6 +36,10 @@ SUBST: K = 4:30 5 8 9 SUBST: L = 4 5:30 8 9 SUBST: M = 4 5 8:30 9 +MARKER: Z = lua:item_pickup_change_flags { \ + level_flags="!no_tele_control", item="Orb of Zot" \ + } + MAP xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx diff --git a/crawl-ref/source/dgnevent.cc b/crawl-ref/source/dgnevent.cc index 96d87fecc4..b1a58a5aa7 100644 --- a/crawl-ref/source/dgnevent.cc +++ b/crawl-ref/source/dgnevent.cc @@ -41,11 +41,17 @@ bool dgn_event_dispatcher::has_listeners_at(const coord_def &pos) const void dgn_event_dispatcher::fire_position_event( dgn_event_type event, const coord_def &pos) { + const dgn_event et(event, pos); + fire_position_event(et, pos); +} + +void dgn_event_dispatcher::fire_position_event( + const dgn_event &et, const coord_def &pos) +{ dgn_square_alarm *alarm = grid_triggers[pos.x][pos.y].get(); - if (alarm && (alarm->eventmask & event)) + if (alarm && (alarm->eventmask & et.type)) { dgn_square_alarm alcopy = *alarm; - const dgn_event et(event, pos); for (std::list<dgn_event_listener*>::iterator i = alcopy.listeners.begin(); i != alcopy.listeners.end(); ++i) @@ -53,6 +59,7 @@ void dgn_event_dispatcher::fire_position_event( (*i)->notify_dgn_event(et); } } + } void dgn_event_dispatcher::fire_event(const dgn_event &e) diff --git a/crawl-ref/source/dgnevent.h b/crawl-ref/source/dgnevent.h index 61134966b7..77791528b4 100644 --- a/crawl-ref/source/dgnevent.h +++ b/crawl-ref/source/dgnevent.h @@ -15,15 +15,18 @@ // Keep event names in luadgn.cc in sync. enum dgn_event_type { - DET_NONE = 0x0000, + DET_NONE = 0x0000, - DET_TURN_ELAPSED = 0x0001, - DET_MONSTER_MOVED = 0x0002, - DET_PLAYER_MOVED = 0x0004, - DET_LEAVING_LEVEL = 0x0008, - DET_ENTERING_LEVEL = 0x0010, - DET_PLAYER_IN_LOS = 0x0020, // Player just entered LOS. - DET_PLAYER_CLIMBS = 0x0040 // Player climbing stairs. + DET_TURN_ELAPSED = 0x0001, + DET_MONSTER_MOVED = 0x0002, + DET_PLAYER_MOVED = 0x0004, + DET_LEAVING_LEVEL = 0x0008, + DET_ENTERING_LEVEL = 0x0010, + DET_PLAYER_IN_LOS = 0x0020, // Player just entered LOS. + DET_PLAYER_CLIMBS = 0x0040, // Player climbing stairs. + DET_MONSTER_DIED = 0x0080, + DET_ITEM_PICKUP = 0x0100, + DET_FEAT_CHANGE = 0x0200 }; class dgn_event @@ -32,11 +35,12 @@ public: dgn_event_type type; coord_def place; int elapsed_ticks; + long arg1, arg2; public: dgn_event(dgn_event_type t, const coord_def &p = coord_def(), - int ticks = you.time_taken) - : type(t), place(p), elapsed_ticks(ticks) + int ticks = you.time_taken, long a1 = 0, long a2 = 0) + : type(t), place(p), elapsed_ticks(ticks), arg1(a1), arg2(a2) { } }; @@ -88,6 +92,7 @@ public: void move_listeners(const coord_def &from, const coord_def &to); void fire_position_event(dgn_event_type et, const coord_def &pos); + void fire_position_event(const dgn_event &e, const coord_def &pos); void fire_event(dgn_event_type et); void fire_event(const dgn_event &e); diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index af0495e0e5..e96d23fc1e 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -311,6 +311,64 @@ void level_clear_vault_memory() dgn_map_mask.init(0); } +bool set_level_flags(unsigned long flags, bool silent) +{ + bool could_control = allow_control_teleport(true); + bool could_map = player_in_mappable_area(); + + unsigned long old_flags = env.level_flags; + env.level_flags |= flags; + + bool can_control = allow_control_teleport(true); + bool can_map = player_in_mappable_area(); + + if (you.skills[SK_TRANSLOCATIONS] > 0 + && could_control && !can_control && !silent) + { + mpr("You sense the appearence of a powerful magical force " + "which warps space.", MSGCH_WARN); + } + + if (could_map && !can_map && !silent) + { + mpr("A powerful force appears that prevents you from " + "remembering where you've been.", MSGCH_WARN); + } + + return (old_flags != env.level_flags); +} + +bool unset_level_flags(unsigned long flags, bool silent) +{ + bool could_control = allow_control_teleport(true); + bool could_map = player_in_mappable_area(); + + unsigned long old_flags = env.level_flags; + env.level_flags &= ~flags; + + bool can_control = allow_control_teleport(true); + bool can_map = player_in_mappable_area(); + + if (you.skills[SK_TRANSLOCATIONS] > 0 + && !could_control && can_control && !silent) + { + // Isn't really a "recovery", but I couldn't think of where + // else to send it. + mpr("You sense the disappearence of a powerful magical force " + "which warped space.", MSGCH_RECOVERY); + } + + if (!could_map && can_map && !silent) + { + // Isn't really a "recovery", but I couldn't think of where + // else to send it. + mpr("You sense the disappearence the force that prevented you " + "from remembering where you've been.", MSGCH_RECOVERY); + } + + return (old_flags != env.level_flags); +} + static void dgn_register_vault(const map_def &map) { if (map.has_tag("uniq")) @@ -461,6 +519,27 @@ static void register_place(const vault_placement &place) if (!place.map.has_tag("transparent")) mask_vault(place, MMT_OPAQUE); + + // Now do per-square by-symbol masking + for (int y = place.y + place.height - 1; y >= place.y; --y) + for (int x = place.x + place.width - 1; x >= place.x; --x) + if (place.map.in_map(coord_def(x - place.x, y - place.y))) + { + int key = place.map.map.glyph(x - place.x, y - place.y); + const keyed_mapspec* spec = place.map.mapspec_for_key(key); + + if (spec != NULL) + { + dgn_map_mask[x][y] |= (short)spec->map_mask.flags_set; + dgn_map_mask[x][y] &= ~((short)spec->map_mask.flags_unset); + } + } + + set_branch_flags(place.map.branch_flags.flags_set, true); + unset_branch_flags(place.map.branch_flags.flags_unset, true); + + set_level_flags(place.map.level_flags.flags_set, true); + unset_level_flags(place.map.level_flags.flags_unset, true); } static bool ensure_vault_placed(bool vault_success) @@ -548,6 +627,23 @@ static void reset_level() // clear all markers env.markers.clear(); + + // Set default level flags + if (you.level_type == LEVEL_DUNGEON) + env.level_flags = branches[you.where_are_you].default_level_flags; + else if (you.level_type == LEVEL_LABYRINTH || + you.level_type == LEVEL_ABYSS) + { + env.level_flags = LFLAG_NO_TELE_CONTROL | LFLAG_NOT_MAPPABLE; + + if (!(you.level_type == LEVEL_LABYRINTH + && you.species != SP_MINOTAUR)) + { + env.level_flags |= LFLAG_NO_MAGIC_MAP; + } + } + else + env.level_flags = 0; } static void build_layout_skeleton(int level_number, int level_type, diff --git a/crawl-ref/source/dungeon.h b/crawl-ref/source/dungeon.h index b7fc8bca02..72b3b24889 100644 --- a/crawl-ref/source/dungeon.h +++ b/crawl-ref/source/dungeon.h @@ -317,4 +317,7 @@ bool dgn_place_monster(const mons_spec &mspec, int monster_level, int vx, int vy, bool generate_awake); +bool set_level_flags(unsigned long flags, bool silent = false); +bool unset_level_flags(unsigned long flags, bool silent = false); + #endif diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 1343e4d5f9..6a0f817ac8 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -581,6 +581,8 @@ enum command_type CMD_MAP_GOTO_TARGET, + CMD_MAP_WIZARD_TELEPORT, + CMD_MAP_EXIT_MAP, /* targeting commands */ @@ -765,6 +767,15 @@ enum game_direction_type GDT_ASCENDING }; +enum level_flag_type +{ + LFLAG_NONE = 0, + + LFLAG_NO_TELE_CONTROL = (1 << 0), // Teleport control not allowed. + LFLAG_NOT_MAPPABLE = (1 << 1), // Level not mappable (like Abyss). + LFLAG_NO_MAGIC_MAP = (1 << 2) // Level can't be magic mapped. +}; + // NOTE: The order of these is very important to their usage! // [dshaligram] If adding/removing from this list, also update view.cc! enum dungeon_char_type diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index a54827e4bf..7dbdcbe9eb 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -1149,6 +1149,8 @@ public: map_marker *find(map_marker_type type); void move(const coord_def &from, const coord_def &to); std::vector<map_marker*> get_all(map_marker_type type = MAT_ANY); + std::vector<map_marker*> get_all(const std::string &key, + const std::string &val = ""); std::vector<map_marker*> get_markers_at(const coord_def &c); std::string property_at(const coord_def &c, map_marker_type type, const std::string &key); @@ -1209,6 +1211,10 @@ public: // Number of turns the player has spent on this level. int turns_on_level; + + // Flags for things like preventing teleport control; see + // level_flag_type in enum.h + unsigned long level_flags; }; extern struct crawl_environment env; diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 4970d4fc81..ba39906bb7 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -3169,7 +3169,10 @@ bool drink_fountain() if (one_chance_in(10)) gone_dry = true; else if ( random2(50) > 40 ) // no message! + { grd[you.x_pos][you.y_pos] = DNGN_BLUE_FOUNTAIN; + set_terrain_changed(you.x_pos, you.y_pos); + } } if (gone_dry) @@ -3180,6 +3183,8 @@ bool drink_fountain() else grd[you.x_pos][you.y_pos] = DNGN_DRY_FOUNTAIN_II; + set_terrain_changed(you.x_pos, you.y_pos); + crawl_state.cancel_cmd_repeat(); } diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index e26558acdc..a54882e3d0 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1434,6 +1434,10 @@ int move_item_to_player( int obj, int quant_got, bool quiet ) return (-1); } + coord_def pos(mitm[obj].x, mitm[obj].y); + dungeon_events.fire_position_event( + dgn_event(DET_ITEM_PICKUP, pos, 0, obj, -1), pos); + item_def &item = you.inv[freeslot]; // copy item item = mitm[obj]; diff --git a/crawl-ref/source/luadgn.cc b/crawl-ref/source/luadgn.cc index 043ae46966..82039db1bf 100644 --- a/crawl-ref/source/luadgn.cc +++ b/crawl-ref/source/luadgn.cc @@ -9,11 +9,13 @@ #include <sstream> +#include "branch.h" #include "clua.h" #include "direct.h" #include "dungeon.h" #include "files.h" #include "initfile.h" +#include "items.h" #include "luadgn.h" #include "mapdef.h" #include "mapmark.h" @@ -430,6 +432,94 @@ static int dgn_tags_remove(lua_State *ls) PLUARET(string, map->tags.c_str()); } +static const std::string level_flag_names[] = + {"no_tele_control", "not_mappable", "no_magic_map", ""}; + +static int dgn_lflags(lua_State *ls) +{ + MAP(ls, 1, map); + + try { + map->level_flags = map_flags::parse(level_flag_names, + luaL_checkstring(ls, 2)); + } + catch (const std::string &error) + { + luaL_argerror(ls, 2, error.c_str()); + } + + return (0); +} + +static int dgn_change_level_flags(lua_State *ls) +{ + map_flags flags; + + try { + flags = map_flags::parse(level_flag_names, + luaL_checkstring(ls, 1)); + } + catch (const std::string &error) + { + luaL_argerror(ls, 2, error.c_str()); + lua_pushboolean(ls, false); + return (1); + } + + bool silent = lua_toboolean(ls, 2); + + bool changed1 = set_level_flags(flags.flags_set, silent); + bool changed2 = unset_level_flags(flags.flags_unset, silent); + + lua_pushboolean(ls, changed1 || changed2); + + return (1); +} + +static const std::string branch_flag_names[] = + {"no_tele_control", "not_mappable", "no_magic_map", ""}; + +static int dgn_bflags(lua_State *ls) +{ + MAP(ls, 1, map); + + try { + map->branch_flags = map_flags::parse(branch_flag_names, + luaL_checkstring(ls, 2)); + } + catch (const std::string &error) + { + luaL_argerror(ls, 2, error.c_str()); + } + + return (0); +} + +static int dgn_change_branch_flags(lua_State *ls) +{ + map_flags flags; + + try { + flags = map_flags::parse(branch_flag_names, + luaL_checkstring(ls, 1)); + } + catch (const std::string &error) + { + luaL_argerror(ls, 2, error.c_str()); + lua_pushboolean(ls, false); + return (1); + } + + bool silent = lua_toboolean(ls, 2); + + bool changed1 = set_branch_flags(flags.flags_set, silent); + bool changed2 = unset_branch_flags(flags.flags_unset, silent); + + lua_pushboolean(ls, changed1 || changed2); + + return (1); +} + static int dgn_weight(lua_State *ls) { MAP(ls, 1, map); @@ -700,6 +790,15 @@ static int dgn_kitem(lua_State *ls) return (0); } +static int dgn_kmask(lua_State *ls) +{ + MAP(ls, 1, map); + std::string err = map->add_key_mask(luaL_checkstring(ls, 2)); + if (!err.empty()) + luaL_error(ls, err.c_str()); + return (0); +} + static int dgn_name(lua_State *ls) { MAP(ls, 1, map); @@ -920,7 +1019,8 @@ static int dgn_feature_name(lua_State *ls) static const char *dgn_event_type_names[] = { "none", "turn", "mons_move", "player_move", "leave_level", "enter_level", - "player_los", "player_climb" + "player_los", "player_climb", "monster_dies", "item_pickup", + "feat_change" }; static dgn_event_type dgn_event_type_by_name(const std::string &name) @@ -1004,6 +1104,22 @@ static int dgn_remove_marker(lua_State *ls) return (0); } +static int dgn_num_matching_markers(lua_State *ls) +{ + const char* key = luaL_checkstring(ls, 1); + const char* val_ptr = lua_tostring(ls, 2); + const char* val; + + if (val_ptr == NULL) + val = ""; + else + val = val_ptr; + + std::vector<map_marker*> markers = env.markers.get_all(key, val); + + PLUARET(number, markers.size()); +} + static int dgn_feature_desc(lua_State *ls) { const dungeon_feature_type feat = @@ -1048,6 +1164,34 @@ static int dgn_terrain_changed(lua_State *ls) return (0); } +static int dgn_item_from_index(lua_State *ls) +{ + const int index = luaL_checkint(ls, 1); + + item_def *item = &mitm[index]; + + if (is_valid_item(*item)) + lua_pushlightuserdata(ls, item); + else + lua_pushnil(ls); + + return (1); +} + +static int dgn_mons_from_index(lua_State *ls) +{ + const int index = luaL_checkint(ls, 1); + + monsters *mons = &menv[index]; + + if (mons->type != -1) + push_monster(ls, mons); + else + lua_pushnil(ls); + + return (1); +} + static const struct luaL_reg dgn_lib[] = { { "default_depth", dgn_default_depth }, @@ -1056,6 +1200,8 @@ static const struct luaL_reg dgn_lib[] = { "place", dgn_place }, { "tags", dgn_tags }, { "tags_remove", dgn_tags_remove }, + { "lflags", dgn_lflags }, + { "bflags", dgn_bflags }, { "chance", dgn_weight }, { "welcome", dgn_welcome }, { "weight", dgn_weight }, @@ -1072,6 +1218,7 @@ static const struct luaL_reg dgn_lib[] = { "kfeat", dgn_kfeat }, { "kitem", dgn_kitem }, { "kmons", dgn_kmons }, + { "kmask", dgn_kmask }, { "grid", dgn_grid }, { "terrain_changed", dgn_terrain_changed }, { "points_connected", dgn_points_connected }, @@ -1087,8 +1234,14 @@ static const struct luaL_reg dgn_lib[] = { "register_listener", dgn_register_listener }, { "remove_listener", dgn_remove_listener }, { "remove_marker", dgn_remove_marker }, + { "num_matching_markers", dgn_num_matching_markers}, { "feature_desc", dgn_feature_desc }, { "feature_desc_at", dgn_feature_desc_at }, + { "item_from_index", dgn_item_from_index }, + { "mons_from_index", dgn_mons_from_index }, + { "change_level_flags", dgn_change_level_flags}, + { "change_branch_flags", dgn_change_branch_flags}, + { NULL, NULL } }; @@ -1246,11 +1399,25 @@ static int dgnevent_ticks(lua_State *ls) PLUARET(number, dev->elapsed_ticks); } +static int dgnevent_arg1(lua_State *ls) +{ + DEVENT(ls, 1, dev); + PLUARET(number, dev->arg1); +} + +static int dgnevent_arg2(lua_State *ls) +{ + DEVENT(ls, 1, dev); + PLUARET(number, dev->arg2); +} + static const struct luaL_reg dgnevent_lib[] = { { "type", dgnevent_type }, - { "pos", dgnevent_place }, + { "pos", dgnevent_place }, { "ticks", dgnevent_ticks }, + { "arg1", dgnevent_arg1 }, + { "arg2", dgnevent_arg2 }, { NULL, NULL } }; diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index f661c6f18a..28fc83fd57 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -1606,6 +1606,12 @@ bool map_def::has_tag_suffix(const std::string &suffix) const && tags.find(suffix + " ") != std::string::npos; } +const keyed_mapspec *map_def::mapspec_for_key(int key) const +{ + keyed_specs::const_iterator i = keyspecs.find(key); + return i != keyspecs.end()? &i->second : NULL; +} + keyed_mapspec *map_def::mapspec_for_key(int key) { keyed_specs::iterator i = keyspecs.find(key); @@ -1643,6 +1649,11 @@ std::string map_def::add_key_mons(const std::string &s) return add_key_field(s, &keyed_mapspec::set_mons); } +std::string map_def::add_key_mask(const std::string &s) +{ + return add_key_field(s, &keyed_mapspec::set_mask); +} + std::vector<std::string> map_def::get_shuffle_strings() const { return map.get_shuffle_strings(); @@ -2351,6 +2362,50 @@ map_transformer *map_marker_spec::clone() const } ////////////////////////////////////////////////////////////////////////// +// map_flags +map_flags::map_flags() + : flags_set(0), flags_unset(0) +{ +} + +typedef std::map<std::string, unsigned long> flag_map; + +map_flags map_flags::parse(const std::string flag_list[], + const std::string &s) throw(std::string) +{ + map_flags mf; + + const std::vector<std::string> segs = split_string("/", s); + + flag_map flag_vals; + for (int i = 0; flag_list[i] != ""; i++) + flag_vals[flag_list[i]] = 1 << i; + + for (int i = 0, size = segs.size(); i < size; i++) + { + std::string flag = segs[i]; + bool negate = false; + + if (flag[0] == '!') + { + flag = flag.substr(1); + negate = true; + } + + flag_map::const_iterator val = flag_vals.find(flag); + if (val == flag_vals.end()) + throw make_stringf("Unknown flag: '%s'", flag.c_str()); + + if (negate) + mf.flags_unset |= val->second; + else + mf.flags_set |= val->second; + } + + return mf; +} + +////////////////////////////////////////////////////////////////////////// // keyed_mapspec keyed_mapspec::keyed_mapspec() @@ -2477,6 +2532,28 @@ std::string keyed_mapspec::set_item(const std::string &s, bool fix) return (err); } +std::string keyed_mapspec::set_mask(const std::string &s, bool garbage) +{ + UNUSED(garbage); + + err.clear(); + + try + { + static std::string flag_list[] = + {"vault", "no_item_gen", "no_monster_gen", "no_pool_fixup", + "no_secret_doors", "opaque", ""}; + map_mask = map_flags::parse(flag_list, s); + } + catch (const std::string &error) + { + err = error; + return (err); + } + + return (err); +} + feature_spec keyed_mapspec::get_feat() { return feat.get_feat(key_glyph); @@ -2492,6 +2569,11 @@ item_list &keyed_mapspec::get_items() return (item); } +map_flags &keyed_mapspec::get_mask() +{ + return (map_mask); +} + ////////////////////////////////////////////////////////////////////////// // feature_slot diff --git a/crawl-ref/source/mapdef.h b/crawl-ref/source/mapdef.h index 919ed43a51..e3fd3e3d04 100644 --- a/crawl-ref/source/mapdef.h +++ b/crawl-ref/source/mapdef.h @@ -449,6 +449,17 @@ struct feature_slot feature_spec get_feat(int default_glyph); }; +struct map_flags +{ + unsigned long flags_set, flags_unset; + + map_flags(); + + static map_flags parse(const std::string flag_list[], + const std::string &s) throw(std::string); +}; + + struct keyed_mapspec { public: @@ -457,6 +468,7 @@ public: feature_slot feat; item_list item; mons_list mons; + map_flags map_mask; public: keyed_mapspec(); @@ -464,10 +476,12 @@ public: std::string set_feat(const std::string &s, bool fix); std::string set_mons(const std::string &s, bool fix); std::string set_item(const std::string &s, bool fix); + std::string set_mask(const std::string &s, bool garbage); feature_spec get_feat(); - mons_list &get_monsters(); - item_list &get_items(); + mons_list &get_monsters(); + item_list &get_items(); + map_flags &get_mask(); private: std::string err; @@ -527,6 +541,8 @@ public: mons_list mons; item_list items; + map_flags level_flags, branch_flags; + keyed_specs keyspecs; dlua_chunk prelude, main, validate, veto; @@ -584,6 +600,7 @@ public: bool is_usable_in(const level_id &lid) const; keyed_mapspec *mapspec_for_key(int key); + const keyed_mapspec *mapspec_for_key(int key) const; bool has_depth() const; void add_depth(const level_range &depth); @@ -593,6 +610,7 @@ public: std::string add_key_item(const std::string &s); std::string add_key_mons(const std::string &s); std::string add_key_feat(const std::string &s); + std::string add_key_mask(const std::string &s); bool can_dock(map_section_type) const; coord_def dock_pos(map_section_type) const; diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc index fbcbbf6d73..3c6901eaea 100644 --- a/crawl-ref/source/mapmark.cc +++ b/crawl-ref/source/mapmark.cc @@ -648,6 +648,24 @@ std::vector<map_marker*> map_markers::get_all(map_marker_type mat) return (rmarkers); } +std::vector<map_marker*> map_markers::get_all(const std::string &key, + const std::string &val) +{ + std::vector<map_marker*> rmarkers; + + for (dgn_marker_map::const_iterator i = markers.begin(); + i != markers.end(); ++i) + { + map_marker* marker = i->second; + const std::string prop = marker->property(key); + + if ((val == "" && !prop.empty()) || (val != "" && val == prop)) + rmarkers.push_back(marker); + } + + return (rmarkers); +} + std::vector<map_marker*> map_markers::get_markers_at(const coord_def &c) { std::pair<dgn_marker_map::const_iterator, dgn_marker_map::const_iterator> diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index d773f0032d..c3260b93b8 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -2680,6 +2680,11 @@ bool monsters::pickup(item_def &item, int slot, int near, bool force_merge) { if (items_stack(item, mitm[inv[slot]], force_merge)) { + dungeon_events.fire_position_event( + dgn_event(DET_ITEM_PICKUP, pos(), 0, item.index(), + monster_index(this)), + pos()); + pickup_message(item, near); inc_mitm_item_quantity( inv[slot], item.quantity ); destroy_item(item.index()); @@ -2689,6 +2694,11 @@ bool monsters::pickup(item_def &item, int slot, int near, bool force_merge) } return (false); } + + dungeon_events.fire_position_event( + dgn_event(DET_ITEM_PICKUP, pos(), 0, item.index(), + monster_index(this)), + pos()); const int index = item.index(); unlink_item(index); diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index ef499b6f53..d0a8290703 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -36,6 +36,7 @@ #include "cloud.h" #include "debug.h" #include "describe.h" +#include "dgnevent.h" #include "fight.h" #include "hiscores.h" #include "it_use2.h" @@ -851,6 +852,10 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent) } } + dungeon_events.fire_event( + dgn_event(DET_MONSTER_DIED, monster->pos(), 0, + monster_index(monster), killer)); + const coord_def mwhere = monster->pos(); if (!hard_reset) monster_drop_ething(monster, YOU_KILL(killer) || pet_kill); diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 3d992a3eb1..f7bf812bda 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -374,7 +374,8 @@ bool is_grid_dangerous(int grid) bool player_in_mappable_area( void ) { - return (you.level_type != LEVEL_LABYRINTH && you.level_type != LEVEL_ABYSS); + return (!(testbits(env.level_flags, LFLAG_NOT_MAPPABLE) + || testbits(get_branch_flags(), BFLAG_NOT_MAPPABLE))); } bool player_in_branch( int branch ) diff --git a/crawl-ref/source/prebuilt/levcomp.lex.cc b/crawl-ref/source/prebuilt/levcomp.lex.cc index a8979e6e6e..bf2d480778 100644 --- a/crawl-ref/source/prebuilt/levcomp.lex.cc +++ b/crawl-ref/source/prebuilt/levcomp.lex.cc @@ -1,94 +1,33 @@ #line 2 "levcomp.lex.cc" - -#line 4 "levcomp.lex.cc" - -#define YY_INT_ALIGNED short int - /* A lexical scanner generated by flex */ +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 33 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ #include <stdio.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ - -#if __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif -#include <inttypes.h> -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus #endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) #endif -#endif /* ! FLEXINT_H */ #ifdef __cplusplus +#include <stdlib.h> +#include <unistd.h> + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST @@ -96,17 +35,34 @@ typedef unsigned int flex_uint32_t; #if __STDC__ +#define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include <io.h> +#include <stdlib.h> +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -121,88 +77,71 @@ typedef unsigned int flex_uint32_t; * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ -#define BEGIN (yy_start) = 1 + 2 * +#define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ -#define YY_START (((yy_start) - 1) / 2) +#define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ -#ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 -#endif -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif extern int yyleng; - extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE yylex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-yylineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < yyleng; ++yyl )\ - if ( yytext[yyl] == '\n' )\ - --yylineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ + *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) +#define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T typedef unsigned int yy_size_t; -#endif -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE + struct yy_buffer_state { FILE *yy_input_file; @@ -239,16 +178,12 @@ struct yy_buffer_state */ int yy_at_bol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; - #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process @@ -262,38 +197,28 @@ struct yy_buffer_state * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ +static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". - * - * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) +#define YY_CURRENT_BUFFER yy_current_buffer -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; + static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ +static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches @@ -301,182 +226,272 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); - -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +void yyrestart YY_PROTO(( FILE *input_file )); -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) -/* Begin user sect3 */ +#define YY_USES_REJECT typedef unsigned char YY_CHAR; - FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; - typedef int yy_state_type; - extern int yylineno; - int yylineno = 1; - extern char *yytext; #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; + yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 62 -#define YY_END_OF_BUFFER 63 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[782] = +#define YY_NUM_RULES 65 +#define YY_END_OF_BUFFER 66 +static yyconst short int yy_acclist[902] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 63, 61, - 59, 60, 61, 57, 58, 61, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, 59, 30, - 32, 61, 61, 61, 61, 61, 61, 62, 6, 62, - 62, 4, 2, 3, 62, 2, 2, 2, 2, 9, - 10, 62, 9, 9, 62, 12, 62, 61, 26, 61, - 57, 58, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 30, 32, 61, 61, 61, - 61, 61, 61, 61, 24, 21, 24, 23, 58, 61, - - 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 24, 30, 32, 61, 61, 61, 61, 61, - 61, 14, 15, 61, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, - 13, 13, 13, 13, 13, 17, 19, 20, 62, 18, - 62, 29, 62, 62, 59, 60, 58, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 59, 30, 32, 0, 0, - 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, - 35, 6, 5, 0, 0, 2, 3, 2, 0, 2, - - 2, 2, 2, 9, 9, 10, 9, 9, 9, 0, - 11, 12, 25, 0, 26, 25, 25, 25, 25, 25, + 66, 64, 65, 62, 64, 65, 63, 65, 64, 65, + 60, 64, 65, 61, 64, 65, 64, 65, 64, 65, + 64, 65, 64, 65, 64, 65, 64, 65, 64, 65, + 64, 65, 64, 65, 64, 65, 64, 65, 64, 65, + 64, 65, 64, 65, 64, 65, 62, 64, 65, 30, + 64, 65, 32, 64, 65, 64, 65, 64, 65, 64, + 65, 64, 65, 64, 65, 64, 65, 65, 6, 65, + 65, 65, 4, 65, 2, 65, 3, 6, 65, 65, + 2, 65, 2, 4, 65, 2, 65, 2, 65, 9, + 65, 10, 65, 65, 9, 65, 9, 65, 65, 12, + + 65, 65, 64, 65, 26, 63, 65, 64, 65, 60, + 64, 65, 61, 64, 65, 64, 65, 64, 65, 64, + 65, 64, 65, 64, 65, 64, 65, 64, 65, 64, + 65, 64, 65, 64, 65, 64, 65, 64, 65, 64, + 65, 64, 65, 64, 65, 30, 64, 65, 32, 64, + 65, 64, 65, 64, 65, 64, 65, 64, 65, 64, + 65, 64, 65, 64, 65, 24, 62, 64, 65, 21, + 63, 65, 24, 64, 65, 23, 60, 64, 65, 61, + 64, 65, 64, 65, 64, 65, 64, 65, 64, 65, + 64, 65, 64, 65, 64, 65, 64, 65, 64, 65, + + 64, 65, 64, 65, 64, 65, 64, 65, 64, 65, + 64, 65, 24, 62, 64, 65, 30, 64, 65, 32, + 64, 65, 64, 65, 64, 65, 64, 65, 64, 65, + 64, 65, 64, 65, 14, 62, 64, 65, 15, 63, + 65, 64, 65, 13, 64, 65, 13, 61, 64, 65, + 13, 64, 65, 13, 64, 65, 13, 64, 65, 13, + 64, 65, 13, 64, 65, 13, 64, 65, 13, 64, + 65, 13, 64, 65, 13, 64, 65, 13, 64, 65, + 13, 64, 65, 13, 64, 65, 13, 64, 65, 13, + 64, 65, 13, 64, 65, 14, 62, 64, 65, 13, + + 64, 65, 13, 64, 65, 13, 64, 65, 13, 64, + 65, 13, 64, 65, 17, 65, 19, 65, 20, 65, + 65, 18, 65, 65, 29, 65, 65, 65, 62, 63, + 61, 62, 30, 32, 30, 35, 6, 5, 2, 3, + 6, 2, 5, 2, 2, 2, 2, 9, 9, 10, + 9, 9, 9, 11, 12, 25, 26, 63, 25, 61, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 30, 25, 25, 25, 25, - 25, 25, 25, 25, 0, 24, 21, 24, 21, 58, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 24, 30, - 0, 0, 0, 0, 0, 0, 0, 35, 14, 15, - 0, 15, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 30, 30, 25, 25, 25, 25, 25, 25, 25, + 25, 35, 24, 62, 21, 24, 21, 63, 61, 24, - 13, 13, 14, 13, 13, 13, 13, 13, 13, 13, - 16, 0, 19, 20, 0, 0, 28, 0, 28, 0, - 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, 9, 9, 9, - 7, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 62, 30, 35, 14, 62, 15, 15, 63, 13, 13, + 61, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 14, 62, 13, 13, 13, 13, 13, 13, 13, + 16, 19, 20, 28, 28, 29, 27, 28, 2, 9, + 9, 9, 7, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 22, 22, 61, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 30, 22, 22, 22, 22, 22, 22, 22, 22, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 31, 0, 0, 0, 0, 0, 2, 9, 8, - 9, 7, 25, 25, 25, 25, 25, 25, 25, 25, + 13, 13, 13, 13, 31, 2, 9, 8, 9, 7, + 8, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 0, 0, 25, 25, 25, 25, 22, 22, 22, + 25, 25, 25, 25, 25, 25, 25, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 0, 0, 22, 22, - 22, 22, 13, 13, 13, 13, 13, 13, 13, 13, + 22, 22, 22, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 0, 0, 0, 51, 0, 0, - 0, 0, 50, 38, 0, 0, 0, 0, 0, 47, - 0, 0, 0, 34, 0, 0, 0, 0, 2, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 0, 25, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 13, 13, 13, 13, 13, 13, 13, 13, 53, 52, + 38, 47, 34, 2, 25, 25, 25, 25, 25, 53, + 25, 25, 25, 25, 25, 25, 25, 52, 25, 38, + 25, 25, 25, 25, 25, 25, 47, 25, 25, 25, + 25, 34, 25, 25, 25, 22, 22, 22, 22, 22, + 53, 22, 22, 22, 22, 22, 22, 22, 52, 22, + 38, 22, 22, 22, 22, 22, 22, 47, 22, 22, + 22, 22, 34, 22, 22, 22, 13, 13, 13, 13, - 22, 22, 22, 22, 22, 0, 22, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 0, 40, 46, 54, 55, 56, - 0, 0, 0, 42, 0, 48, 0, 0, 0, 0, - 0, 37, 1, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 44, - 52, 49, 41, 0, 45, 0, 0, 0, 0, 1, + 13, 13, 13, 13, 13, 13, 40, 46, 56, 57, + 59, 58, 42, 50, 37, 1, 2, 25, 25, 25, + 40, 25, 46, 25, 56, 25, 57, 25, 59, 25, + 58, 25, 25, 25, 25, 25, 42, 25, 25, 50, + 25, 25, 25, 25, 25, 25, 37, 22, 22, 22, + 40, 22, 46, 22, 56, 22, 57, 22, 59, 22, + 58, 22, 22, 22, 22, 22, 42, 22, 22, 50, + 22, 22, 22, 22, 22, 22, 37, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 49, + + 44, 48, 54, 51, 41, 45, 1, 2, 25, 49, + 25, 44, 25, 48, 25, 54, 25, 51, 25, 41, + 25, 25, 45, 25, 25, 25, 25, 22, 49, 22, + 44, 22, 48, 22, 54, 22, 51, 22, 41, 22, + 22, 45, 22, 22, 22, 22, 13, 13, 13, 13, + 13, 55, 43, 25, 55, 25, 43, 25, 25, 25, + 22, 55, 22, 43, 22, 22, 22, 13, 13, 33, + 25, 25, 33, 25, 22, 22, 33, 22, 13, 36, + 25, 25, 36, 22, 22, 36, 13, 25, 22, 13, + 25, 22, 13, 25, 22, 13, 39, 25, 39, 22, + + 39 + } ; - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 13, 13, 13, 13, 13, 53, 43, 0, 0, 0, - 0, 25, 25, 25, 0, 25, 25, 22, 22, 22, - 0, 22, 22, 13, 13, 0, 33, 0, 0, 25, - 25, 0, 25, 22, 22, 0, 22, 13, 0, 36, - 25, 25, 22, 22, 13, 0, 25, 22, 13, 0, - 25, 22, 13, 0, 25, 22, 13, 39, 25, 22, - 0 +static yyconst short int yy_accept[852] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 4, 7, 9, 11, 14, 17, 19, 21, 23, 25, + 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, + 47, 50, 53, 56, 58, 60, 62, 64, 66, 68, + 69, 71, 72, 73, 75, 77, 80, 81, 83, 86, + 88, 90, 92, 94, 95, 97, 99, 100, 102, 103, + 105, 108, 110, 113, 116, 118, 120, 122, 124, 126, + 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, + 149, 152, 154, 156, 158, 160, 162, 164, 166, 170, + + 173, 176, 180, 183, 185, 187, 189, 191, 193, 195, + 197, 199, 201, 203, 205, 207, 209, 211, 213, 217, + 220, 223, 225, 227, 229, 231, 233, 235, 239, 242, + 244, 247, 251, 254, 257, 260, 263, 266, 269, 272, + 275, 278, 281, 284, 287, 290, 293, 296, 300, 303, + 306, 309, 312, 315, 317, 319, 321, 322, 324, 325, + 327, 328, 329, 330, 331, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 332, 333, 334, 335, 335, + 335, 335, 335, 336, 336, 336, 336, 336, 336, 336, + + 336, 337, 338, 339, 339, 339, 340, 342, 344, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 354, 355, 356, 357, 357, 359, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 393, 393, 395, 396, + 397, 399, 400, 400, 400, 400, 400, 400, 400, 400, + 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, + 400, 400, 400, 402, 403, 403, 403, 403, 403, 403, + 403, 403, 404, 406, 407, 407, 409, 410, 412, 413, + + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 430, 431, 432, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 442, 443, + 444, 444, 444, 445, 445, 447, 447, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 449, 449, 449, 449, 450, 451, 452, 453, + 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, + 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, + + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, + 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 546, 546, 546, 546, 546, 546, 547, + 548, 549, 550, 552, 553, 554, 555, 556, 557, 558, + + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 574, 574, 575, 576, + 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 600, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, + 625, 626, 627, 628, 629, 629, 629, 629, 629, 630, + 630, 630, 630, 630, 630, 630, 631, 632, 632, 632, + 632, 632, 632, 633, 633, 633, 633, 634, 634, 634, + + 634, 634, 635, 636, 637, 638, 639, 641, 642, 643, + 644, 645, 646, 647, 649, 651, 652, 653, 654, 655, + 656, 658, 659, 660, 661, 663, 664, 665, 665, 666, + 667, 668, 669, 670, 672, 673, 674, 675, 676, 677, + 678, 680, 682, 683, 684, 685, 686, 687, 689, 690, + 691, 692, 694, 695, 696, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, + 711, 712, 713, 714, 715, 716, 717, 717, 717, 718, + 719, 720, 721, 722, 723, 723, 723, 723, 723, 724, + 724, 725, 725, 725, 725, 725, 725, 726, 728, 729, + + 730, 732, 734, 736, 738, 740, 742, 743, 744, 745, + 746, 748, 749, 751, 752, 753, 754, 755, 756, 758, + 759, 760, 762, 764, 766, 768, 770, 772, 773, 774, + 775, 776, 778, 779, 781, 782, 783, 784, 785, 786, + 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, + 798, 799, 800, 801, 802, 803, 804, 805, 806, 806, + 807, 807, 807, 807, 807, 809, 811, 813, 815, 817, + 819, 821, 822, 824, 825, 826, 827, 828, 830, 832, + 834, 836, 838, 840, 841, 843, 844, 845, 846, 847, + 848, 849, 850, 851, 852, 853, 854, 854, 854, 854, + + 854, 856, 858, 859, 859, 860, 861, 863, 865, 866, + 866, 867, 868, 869, 870, 870, 871, 871, 871, 872, + 874, 874, 875, 876, 878, 878, 879, 880, 880, 881, + 882, 884, 885, 887, 888, 888, 889, 890, 891, 891, + 892, 893, 894, 894, 895, 896, 897, 898, 900, 902, + 902 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, @@ -508,7 +523,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[49] = +static yyconst int yy_meta[49] = { 0, 1, 2, 3, 4, 1, 1, 5, 6, 6, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, @@ -517,681 +532,710 @@ static yyconst flex_int32_t yy_meta[49] = 6, 6, 6, 6, 6, 6, 1, 1 } ; -static yyconst flex_int16_t yy_base[806] = +static yyconst short int yy_base[872] = { 0, - 0, 34, 80, 85, 89, 91, 7, 14, 138, 172, - 219, 253, 301, 348, 94, 100, 106, 112, 2034, 2035, - 10, 2035, 2030, 2035, 2023, 2013, 2015, 2007, 1999, 95, - 95, 97, 2000, 2004, 2, 2014, 2009, 1988, 394, 0, - 2035, 101, 1977, 1979, 90, 84, 1973, 2035, 2035, 2016, - 118, 2035, 0, 2035, 2015, 357, 0, 1993, 112, 1968, - 2035, 2012, 81, 1966, 2010, 2035, 2009, 144, 2035, 2008, - 166, 225, 361, 365, 370, 379, 401, 405, 410, 421, - 427, 432, 440, 450, 454, 247, 459, 465, 469, 473, - 477, 483, 489, 0, 493, 2035, 499, 2035, 2001, 1991, - - 1993, 1985, 1977, 137, 125, 340, 1978, 1982, 207, 1992, - 1987, 1966, 503, 23, 0, 353, 1955, 1957, 333, 206, - 1951, 507, 2035, 1994, 0, 1987, 1977, 1979, 1971, 1963, - 374, 377, 390, 1964, 1968, 355, 1978, 1973, 1952, 519, - 402, 1941, 1943, 334, 433, 350, 523, 2035, 1981, 2035, - 379, 2035, 425, 481, 417, 2035, 1974, 1971, 1955, 1969, - 1964, 1963, 1948, 1951, 1945, 1944, 1944, 1936, 1937, 1944, - 1924, 1936, 1927, 424, 1907, 0, 0, 2035, 1897, 1894, - 484, 1883, 0, 104, 1892, 1884, 1907, 437, 1868, 1862, - 2035, 2035, 2035, 1902, 526, 0, 2035, 0, 1891, 529, - - 1819, 1808, 520, 1783, 1782, 2035, 188, 1781, 535, 1824, - 2035, 2035, 537, 541, 2035, 545, 551, 555, 562, 567, - 572, 584, 589, 593, 597, 601, 605, 613, 623, 634, - 638, 642, 647, 651, 656, 663, 668, 672, 676, 680, - 684, 694, 688, 698, 546, 710, 2035, 714, 2035, 556, - 573, 628, 699, 614, 719, 718, 606, 621, 704, 720, - 724, 733, 734, 735, 739, 744, 748, 753, 0, 755, - 761, 766, 767, 771, 772, 773, 778, 779, 788, 2035, - 1823, 2035, 0, 1814, 1806, 1785, 1795, 1790, 1776, 1750, - 1753, 1750, 1734, 1725, 1706, 1716, 1720, 1700, 1712, 1699, - - 775, 1676, 0, 553, 1675, 1660, 1683, 449, 1642, 1631, - 796, 798, 802, 2035, 1660, 609, 2035, 806, 2035, 811, - 2035, 1631, 1613, 1623, 1609, 1617, 1609, 1596, 1595, 1582, - 1576, 1572, 1568, 1559, 1547, 1530, 1526, 1528, 1528, 1504, - 815, 819, 1493, 1499, 1479, 1473, 1486, 823, 827, 831, - 2035, 835, 840, 844, 849, 853, 858, 863, 872, 876, - 880, 884, 895, 901, 907, 911, 915, 920, 925, 929, - 942, 946, 950, 954, 959, 963, 845, 889, 916, 955, - 964, 930, 968, 970, 972, 981, 985, 986, 993, 1002, - 1006, 1004, 1010, 1016, 1020, 1021, 1022, 1026, 1037, 1027, - - 1041, 1043, 1045, 1047, 1049, 1055, 1480, 1467, 1474, 1457, - 1457, 1449, 1434, 1435, 1422, 1423, 1416, 1407, 1390, 1383, - 1367, 1363, 1361, 1364, 1338, 1056, 1060, 1327, 1339, 1323, - 1317, 1340, 1331, 1317, 1330, 1307, 1309, 1302, 1309, 1300, - 1299, 1276, 1275, 1280, 1260, 1233, 1245, 1227, 1211, 1180, - 1061, 2035, 1066, 1174, 1171, 1178, 1070, 1197, 1074, 2035, - 1079, 2035, 1081, 1087, 1095, 1099, 1106, 1110, 1114, 1124, - 1136, 1143, 1132, 1147, 1152, 1157, 1161, 1170, 1174, 1179, - 1183, 1191, 1195, 1201, 1205, 1209, 1213, 1119, 1184, 1196, - 1217, 1091, 1218, 1224, 1153, 1228, 1229, 1230, 1235, 1242, - - 1249, 1244, 1251, 1261, 1262, 1266, 1267, 1272, 1273, 1278, - 1279, 1280, 1178, 1164, 1149, 1160, 1140, 1141, 1122, 1129, - 1133, 1121, 1102, 1101, 1091, 1086, 1069, 1078, 1060, 1048, - 1022, 1008, 1007, 1284, 1021, 1025, 1006, 2035, 1004, 1000, - 990, 972, 2035, 2035, 965, 963, 972, 956, 966, 2035, - 942, 926, 903, 2035, 907, 903, 1286, 881, 900, 1288, - 1292, 1296, 1303, 1312, 1324, 1333, 1337, 1342, 1346, 1350, - 1354, 1358, 1365, 1370, 1380, 1384, 1388, 1392, 1396, 1400, - 1404, 1410, 1414, 1310, 1371, 1415, 1316, 1419, 1425, 1431, - 1405, 1421, 1437, 1438, 1442, 1443, 1444, 1449, 1450, 1458, - - 1460, 1467, 1468, 1473, 1472, 1474, 1479, 893, 897, 892, - 891, 882, 880, 856, 841, 827, 842, 819, 825, 802, - 804, 784, 785, 777, 786, 2035, 2035, 2035, 2035, 2035, - 776, 775, 769, 2035, 749, 2035, 746, 733, 698, 696, - 686, 2035, 703, 1484, 1488, 1493, 1497, 1506, 1510, 1514, - 1518, 1525, 1529, 1534, 1538, 1542, 1546, 1551, 1555, 1560, - 1564, 1565, 1480, 1498, 1569, 1571, 1575, 1576, 1577, 1583, - 1587, 1592, 1594, 1596, 1598, 1600, 1606, 1607, 1612, 687, - 673, 669, 665, 656, 653, 647, 613, 610, 593, 2035, - 2035, 2035, 2035, 612, 2035, 594, 592, 1613, 561, 587, - - 1617, 1621, 1625, 1629, 1633, 1643, 1648, 1657, 1652, 1662, - 1634, 1644, 1666, 1667, 1668, 1672, 1674, 1678, 1680, 1685, - 580, 575, 562, 1686, 533, 2035, 2035, 518, 1687, 497, - 1691, 1696, 1700, 1705, 1709, 1713, 1717, 1701, 1721, 1723, - 1727, 1735, 1739, 465, 1740, 418, 2035, 1741, 400, 1745, - 1749, 1757, 1761, 1750, 1765, 1766, 1767, 404, 357, 2035, - 1771, 1779, 1787, 1788, 345, 202, 1792, 1793, 121, 121, - 1797, 1798, 98, 23, 1805, 1814, 12, 2035, 1816, 1820, - 2035, 1837, 1843, 1849, 1855, 1861, 1867, 1873, 1879, 1885, - 1891, 1897, 1903, 1909, 1915, 1921, 1927, 1933, 1939, 1945, - - 0, 1951, 1957, 1963, 1969 + 0, 47, 55, 60, 52, 64, 47, 68, 112, 159, + 206, 253, 300, 347, 74, 80, 70, 159, 2137, 2138, + 87, 2138, 2133, 2138, 2126, 2118, 2115, 2117, 2109, 2101, + 82, 2113, 85, 69, 2101, 2105, 81, 2115, 2110, 2089, + 393, 0, 2138, 155, 2078, 2080, 144, 71, 2074, 2138, + 2138, 2117, 167, 2138, 0, 2138, 2116, 171, 0, 2094, + 153, 2069, 2138, 2113, 135, 2067, 2111, 2138, 2110, 184, + 2138, 2109, 188, 260, 266, 270, 275, 354, 358, 362, + 279, 400, 369, 387, 404, 411, 416, 431, 426, 199, + 440, 445, 449, 453, 458, 463, 467, 0, 471, 2138, + + 475, 2138, 2102, 2094, 2091, 2093, 2085, 2077, 270, 2089, + 170, 80, 2077, 2081, 167, 2091, 2086, 2065, 480, 253, + 0, 262, 2054, 2056, 156, 342, 2050, 484, 2138, 2093, + 0, 2086, 2078, 2075, 2077, 2069, 2061, 349, 2073, 344, + 166, 2061, 2062, 248, 2069, 2064, 2043, 488, 371, 2023, + 2025, 394, 377, 349, 500, 2138, 2063, 2138, 253, 2138, + 347, 504, 417, 2138, 2051, 2034, 2044, 2028, 2037, 2027, + 2022, 2002, 413, 2008, 1992, 1994, 1994, 1976, 1945, 1951, + 1931, 1948, 1942, 478, 1920, 0, 0, 2138, 1909, 1904, + 431, 1895, 0, 271, 1908, 1905, 1923, 400, 1881, 1868, + + 2138, 2138, 2138, 1905, 507, 0, 2138, 0, 1884, 512, + 1868, 1854, 484, 1828, 1818, 2138, 465, 1814, 516, 1857, + 2138, 2138, 518, 524, 2138, 528, 536, 540, 544, 548, + 552, 558, 564, 570, 574, 578, 582, 586, 595, 599, + 606, 610, 617, 622, 626, 630, 639, 645, 649, 653, + 657, 663, 667, 675, 679, 683, 529, 691, 2138, 695, + 2138, 611, 699, 587, 700, 631, 658, 701, 706, 707, + 715, 717, 722, 726, 728, 734, 736, 738, 740, 746, + 752, 754, 0, 760, 767, 768, 773, 774, 775, 781, + 779, 786, 800, 2138, 1842, 2138, 0, 1832, 1815, 1820, + + 1804, 1811, 1795, 1772, 1753, 514, 1759, 1750, 1746, 1729, + 1718, 1725, 1729, 1706, 1718, 1707, 770, 1672, 0, 357, + 1669, 1663, 1670, 512, 1633, 1623, 794, 795, 807, 2138, + 1660, 562, 2138, 811, 2138, 819, 2138, 1643, 1626, 1617, + 1623, 1616, 1624, 1614, 1600, 1600, 1609, 1594, 1582, 1591, + 1590, 1579, 1580, 1572, 1559, 1555, 1547, 1545, 1513, 823, + 825, 1505, 1507, 1494, 1486, 1493, 829, 833, 837, 2138, + 842, 850, 854, 858, 863, 885, 889, 874, 893, 901, + 905, 909, 914, 918, 923, 929, 939, 943, 947, 952, + 957, 961, 974, 978, 982, 986, 991, 995, 843, 864, + + 859, 934, 987, 996, 930, 962, 1000, 1002, 1004, 1006, + 919, 1017, 1018, 1022, 1034, 1035, 1036, 1041, 1042, 1048, + 1049, 1053, 1059, 1054, 1066, 1070, 1071, 1072, 1076, 1077, + 1082, 1499, 1463, 1454, 1462, 1441, 1443, 1438, 1412, 1412, + 1421, 1407, 1394, 1406, 1405, 1396, 1397, 1390, 1372, 1371, + 1378, 1380, 1354, 1086, 1088, 1347, 1353, 1337, 1334, 1352, + 1352, 1345, 1330, 1335, 1312, 1304, 1305, 1286, 1291, 1289, + 1292, 1286, 1267, 1270, 1270, 1263, 1240, 1249, 1230, 1218, + 1189, 1093, 2138, 1098, 1183, 1179, 1189, 1099, 1208, 1103, + 2138, 1109, 2138, 1116, 1121, 1125, 1134, 1145, 1154, 1159, + + 1163, 1167, 1171, 1175, 1187, 1194, 1198, 1203, 1207, 1212, + 1216, 1227, 1231, 1236, 1242, 1248, 1252, 1258, 1262, 1266, + 1270, 1135, 1271, 1126, 1237, 1176, 1253, 1275, 1276, 1281, + 1208, 1286, 1301, 1308, 1287, 1288, 1314, 1318, 1319, 1320, + 1326, 1330, 1331, 1335, 1337, 1341, 1345, 1347, 1349, 1198, + 1193, 1183, 1166, 1183, 1158, 1162, 1153, 1142, 1149, 1145, + 1144, 1143, 1120, 1118, 1126, 1116, 1095, 1107, 1098, 1077, + 1049, 1047, 1051, 1351, 1052, 1052, 1050, 1032, 2138, 1022, + 1021, 1016, 1008, 986, 983, 2138, 2138, 974, 956, 971, + 952, 962, 2138, 939, 937, 911, 2138, 912, 882, 1355, + + 861, 875, 1357, 1362, 1368, 1387, 1378, 1399, 1403, 1410, + 1414, 1421, 1425, 1429, 1433, 1437, 1441, 1446, 1453, 1457, + 1467, 1472, 1476, 1480, 1484, 1488, 1492, 1498, 1502, 1366, + 1458, 1503, 1507, 1105, 1513, 1519, 1525, 1526, 1463, 1493, + 1442, 1509, 1532, 1536, 1537, 1538, 1546, 1548, 1550, 1552, + 1557, 1561, 1565, 1567, 1566, 1571, 872, 884, 882, 878, + 874, 872, 870, 861, 829, 823, 820, 812, 827, 811, + 819, 790, 794, 776, 773, 773, 785, 777, 2138, 2138, + 2138, 2138, 2138, 2138, 772, 756, 751, 750, 2138, 740, + 2138, 740, 719, 685, 690, 671, 2138, 708, 1576, 1580, + + 1587, 1593, 1599, 1603, 1607, 1612, 1617, 1621, 1628, 1632, + 1639, 1643, 1647, 1651, 1655, 1660, 1664, 1669, 1673, 1674, + 1678, 1572, 1680, 1684, 1685, 1689, 1690, 1691, 1695, 1701, + 1705, 1707, 1712, 1714, 1716, 1718, 1720, 1726, 1727, 1732, + 697, 681, 679, 672, 668, 660, 649, 646, 637, 602, + 603, 593, 2138, 2138, 2138, 2138, 2138, 2138, 613, 2138, + 597, 594, 1733, 550, 572, 1737, 1741, 1745, 1749, 1753, + 1758, 1763, 1770, 1774, 1781, 1786, 1790, 1754, 1764, 1791, + 1795, 1796, 1797, 1801, 1802, 1803, 1807, 1812, 1814, 561, + 551, 539, 1816, 508, 2138, 2138, 490, 1818, 412, 1822, + + 1824, 1830, 1834, 1838, 1842, 1846, 1850, 1851, 1852, 1856, + 1862, 1868, 418, 1869, 413, 2138, 1870, 360, 1875, 1879, + 1886, 1890, 1894, 1895, 1896, 1900, 366, 359, 2138, 1909, + 1902, 1916, 1917, 320, 247, 1921, 1922, 223, 224, 1926, + 1930, 147, 99, 1934, 1943, 59, 2138, 1947, 1953, 2138, + 1967, 1973, 1979, 1985, 1991, 1997, 2003, 2009, 2015, 2021, + 2027, 2033, 2039, 2045, 2051, 2057, 48, 2063, 2069, 2075, + 2081 } ; -static yyconst flex_int16_t yy_def[806] = +static yyconst short int yy_def[872] = { 0, - 782, 781, 783, 784, 785, 785, 786, 786, 787, 781, - 788, 781, 781, 13, 789, 789, 790, 790, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 791, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 792, 781, 793, 781, 781, 794, 793, 793, 793, 795, - 781, 781, 795, 795, 796, 781, 781, 797, 781, 781, - 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, - 797, 797, 797, 797, 797, 798, 797, 797, 797, 797, - 797, 797, 797, 799, 781, 781, 781, 781, 799, 799, - - 799, 799, 799, 799, 799, 799, 799, 799, 799, 799, - 799, 799, 39, 800, 799, 799, 799, 799, 799, 799, - 799, 781, 781, 781, 801, 801, 801, 801, 801, 801, - 801, 801, 801, 801, 801, 801, 801, 801, 801, 39, - 801, 801, 801, 801, 801, 802, 781, 781, 781, 781, - 803, 781, 803, 803, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 39, 791, 781, 781, 781, - 781, 781, 791, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 793, 781, 793, 781, 793, - - 793, 793, 793, 795, 795, 781, 795, 795, 795, 796, - 781, 781, 797, 797, 781, 797, 797, 797, 797, 797, - 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, - 797, 797, 797, 797, 798, 798, 797, 797, 797, 797, - 797, 797, 797, 797, 804, 781, 781, 781, 781, 804, - 804, 804, 804, 804, 804, 804, 804, 804, 804, 804, - 804, 804, 804, 804, 804, 804, 804, 804, 113, 805, - 804, 804, 804, 804, 804, 804, 804, 804, 781, 781, - 781, 781, 801, 801, 801, 801, 801, 801, 801, 801, - 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, - - 801, 801, 140, 801, 801, 801, 801, 801, 801, 801, - 802, 802, 781, 781, 781, 803, 781, 803, 781, 803, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 793, 795, 795, 795, - 781, 797, 797, 797, 797, 797, 797, 797, 797, 797, - 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, - 797, 797, 797, 797, 797, 797, 804, 804, 804, 804, - 804, 804, 804, 804, 804, 804, 804, 804, 804, 804, - 804, 804, 804, 804, 804, 804, 804, 805, 804, 804, - - 804, 804, 804, 804, 804, 804, 801, 801, 801, 801, - 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, - 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, - 801, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 793, 795, 781, - 795, 781, 797, 797, 797, 797, 797, 797, 797, 797, - 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, - 797, 797, 797, 797, 797, 797, 797, 804, 804, 804, - 804, 804, 804, 804, 804, 804, 804, 804, 804, 804, - - 804, 804, 804, 804, 804, 804, 804, 804, 804, 804, - 804, 804, 801, 801, 801, 801, 801, 801, 801, 801, - 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, - 801, 801, 801, 801, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 793, 797, - 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, - 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, - 797, 797, 797, 804, 804, 804, 804, 804, 804, 804, - 804, 804, 804, 804, 804, 804, 804, 804, 804, 804, - - 804, 804, 804, 804, 804, 804, 804, 801, 801, 801, - 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, - 801, 801, 801, 801, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 793, 797, 797, 797, 797, 797, 797, 797, - 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, - 797, 804, 804, 804, 804, 804, 804, 804, 804, 804, - 804, 804, 804, 804, 804, 804, 804, 804, 804, 801, - 801, 801, 801, 801, 801, 801, 801, 801, 801, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 793, - - 797, 797, 797, 797, 797, 797, 797, 797, 797, 797, - 804, 804, 804, 804, 804, 804, 804, 804, 804, 804, - 801, 801, 801, 801, 801, 781, 781, 781, 781, 781, - 781, 797, 797, 797, 797, 797, 797, 804, 804, 804, - 804, 804, 804, 801, 801, 781, 781, 781, 781, 797, - 797, 797, 797, 804, 804, 804, 804, 801, 781, 781, - 797, 797, 804, 804, 801, 781, 797, 804, 801, 781, - 797, 804, 801, 781, 797, 804, 801, 781, 797, 804, - 0, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - - 781, 781, 781, 781, 781 + 850, 1, 851, 852, 853, 853, 854, 854, 850, 9, + 850, 11, 850, 13, 855, 855, 856, 856, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 857, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 858, 850, 859, 850, 850, 860, 859, 859, + 859, 861, 850, 850, 861, 861, 862, 850, 850, 863, + 850, 850, 863, 863, 863, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 863, 863, 863, 864, + 863, 863, 863, 863, 863, 863, 863, 865, 850, 850, + + 850, 850, 865, 865, 865, 865, 865, 865, 865, 865, + 865, 865, 865, 865, 865, 865, 865, 865, 41, 866, + 865, 865, 865, 865, 865, 865, 865, 850, 850, 850, + 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 41, 867, 867, + 867, 867, 867, 868, 850, 850, 850, 850, 869, 850, + 869, 869, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 41, 857, 850, 850, 850, + 850, 850, 857, 850, 850, 850, 850, 850, 850, 850, + + 850, 850, 850, 850, 850, 859, 850, 859, 850, 859, + 859, 859, 859, 861, 861, 850, 861, 861, 861, 862, + 850, 850, 863, 863, 850, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 864, 864, 863, 863, + 863, 863, 863, 863, 863, 863, 870, 850, 850, 850, + 850, 870, 870, 870, 870, 870, 870, 870, 870, 870, + 870, 870, 870, 870, 870, 870, 870, 870, 870, 870, + 870, 870, 119, 871, 870, 870, 870, 870, 870, 870, + 870, 870, 850, 850, 850, 850, 867, 867, 867, 867, + + 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, 148, 867, + 867, 867, 867, 867, 867, 867, 868, 868, 850, 850, + 850, 869, 850, 869, 850, 869, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 859, 861, 861, 861, 850, + 863, 863, 863, 863, 863, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 863, 863, 870, 870, + + 870, 870, 870, 870, 870, 870, 870, 870, 870, 870, + 870, 870, 870, 870, 870, 870, 870, 870, 870, 870, + 870, 870, 871, 870, 870, 870, 870, 870, 870, 870, + 870, 867, 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, 867, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 859, 861, + 850, 861, 850, 863, 863, 863, 863, 863, 863, 863, + + 863, 863, 863, 863, 863, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 863, 863, 863, 863, + 863, 870, 870, 870, 870, 870, 870, 870, 870, 870, + 870, 870, 870, 870, 870, 870, 870, 870, 870, 870, + 870, 870, 870, 870, 870, 870, 870, 870, 870, 867, + 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + + 850, 859, 863, 863, 863, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 863, 863, 863, 870, + 870, 870, 870, 870, 870, 870, 870, 870, 870, 870, + 870, 870, 870, 870, 870, 870, 870, 870, 870, 870, + 870, 870, 870, 870, 870, 870, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 867, 867, 867, 867, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 859, 863, 863, + + 863, 863, 863, 863, 863, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 863, 863, 863, 870, + 870, 870, 870, 870, 870, 870, 870, 870, 870, 870, + 870, 870, 870, 870, 870, 870, 870, 870, 870, 870, + 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, + 867, 867, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 859, 863, 863, 863, 863, 863, + 863, 863, 863, 863, 863, 863, 863, 870, 870, 870, + 870, 870, 870, 870, 870, 870, 870, 870, 870, 867, + 867, 867, 867, 867, 850, 850, 850, 850, 850, 850, + + 863, 863, 863, 863, 863, 863, 870, 870, 870, 870, + 870, 870, 867, 867, 850, 850, 850, 850, 863, 863, + 863, 863, 870, 870, 870, 870, 867, 850, 850, 863, + 863, 870, 870, 867, 850, 863, 870, 867, 850, 863, + 870, 867, 850, 863, 870, 867, 850, 863, 870, 0, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850 } ; -static yyconst flex_int16_t yy_nxt[2084] = +static yyconst short int yy_nxt[2187] = { 0, - 781, 21, 22, 23, 21, 283, 24, 781, 25, 66, - 67, 155, 26, 27, 155, 28, 66, 67, 29, 171, - 30, 778, 31, 32, 33, 34, 183, 35, 36, 183, - 37, 172, 778, 38, 20, 39, 22, 23, 39, 40, - 24, 20, 25, 41, 20, 20, 26, 27, 20, 28, - 20, 20, 29, 20, 30, 20, 42, 32, 33, 34, - 20, 35, 36, 20, 37, 20, 20, 38, 20, 20, - 20, 20, 43, 20, 44, 20, 45, 20, 20, 46, - 47, 20, 49, 50, 51, 52, 48, 54, 55, 56, - 57, 61, 62, 61, 62, 147, 148, 149, 147, 58, - - 150, 147, 148, 149, 147, 165, 150, 167, 152, 153, - 162, 184, 187, 163, 152, 153, 189, 164, 190, 166, - 192, 194, 195, 207, 168, 166, 202, 59, 208, 341, - 329, 63, 188, 63, 777, 258, 64, 154, 64, 21, - 69, 70, 21, 154, 71, 214, 72, 214, 214, 259, - 73, 74, 255, 75, 203, 256, 76, 774, 77, 257, - 78, 79, 80, 81, 773, 82, 83, 214, 84, 214, - 214, 85, 68, 39, 69, 70, 39, 86, 71, 68, - 72, 87, 68, 68, 73, 74, 68, 75, 68, 68, - 76, 68, 77, 68, 88, 79, 80, 81, 68, 82, - - 83, 68, 84, 68, 68, 85, 68, 68, 68, 68, - 89, 68, 90, 68, 91, 68, 68, 92, 93, 68, - 95, 96, 97, 95, 264, 98, 214, 99, 214, 214, - 207, 100, 101, 216, 102, 208, 265, 103, 276, 104, - 277, 105, 106, 107, 108, 770, 109, 110, 236, 111, - 236, 236, 112, 94, 113, 96, 97, 113, 114, 98, - 94, 99, 115, 94, 94, 100, 101, 94, 102, 94, - 94, 103, 94, 104, 94, 116, 106, 107, 108, 94, - 109, 110, 94, 111, 94, 94, 112, 94, 94, 94, - 94, 117, 94, 118, 94, 119, 94, 94, 120, 121, - - 94, 20, 122, 123, 124, 122, 20, 24, 125, 126, - 20, 125, 125, 127, 128, 125, 129, 125, 125, 130, - 125, 131, 125, 132, 133, 134, 135, 125, 136, 137, - 125, 138, 20, 125, 139, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 20, 20, 140, - 260, 312, 140, 40, 312, 274, 307, 41, 193, 197, - 199, 200, 214, 271, 214, 214, 214, 261, 214, 214, - 141, 214, 298, 214, 214, 275, 308, 259, 217, 218, - 214, 317, 214, 214, 299, 769, 142, 292, 143, 289, - 144, 219, 290, 145, 47, 176, 291, 766, 176, 177, - - 294, 293, 214, 178, 214, 214, 214, 220, 214, 214, - 318, 214, 304, 214, 214, 224, 221, 295, 155, 222, - 226, 155, 214, 223, 214, 214, 293, 319, 214, 225, - 214, 214, 179, 214, 180, 214, 214, 227, 765, 181, - 182, 214, 338, 214, 214, 339, 760, 228, 229, 230, - 232, 214, 759, 214, 214, 214, 318, 214, 214, 187, - 214, 231, 214, 214, 233, 309, 214, 310, 214, 214, - 214, 307, 214, 214, 214, 237, 214, 214, 214, 188, - 214, 214, 320, 321, 214, 320, 214, 214, 234, 225, - 214, 308, 214, 214, 246, 247, 248, 246, 758, 240, - - 248, 249, 248, 248, 269, 247, 248, 269, 279, 280, - 281, 279, 318, 238, 239, 242, 189, 243, 190, 241, - 303, 280, 281, 303, 313, 314, 315, 313, 192, 194, - 195, 197, 199, 200, 202, 244, 350, 351, 214, 350, - 214, 214, 214, 747, 214, 214, 214, 245, 214, 214, - 245, 746, 214, 216, 214, 214, 214, 245, 214, 214, - 245, 352, 203, 214, 378, 214, 214, 745, 214, 744, - 214, 214, 354, 214, 245, 214, 214, 245, 426, 414, - 353, 355, 348, 379, 727, 214, 356, 214, 214, 726, - 214, 700, 214, 214, 214, 731, 214, 214, 214, 728, - - 214, 214, 214, 727, 214, 214, 214, 245, 214, 214, - 245, 317, 357, 358, 214, 245, 214, 214, 245, 359, - 360, 726, 245, 361, 214, 245, 214, 214, 382, 245, - 385, 363, 245, 364, 362, 214, 725, 214, 214, 214, - 318, 214, 214, 214, 724, 214, 214, 386, 214, 366, - 214, 214, 214, 380, 214, 214, 723, 236, 367, 236, - 236, 722, 695, 365, 236, 368, 236, 236, 369, 214, - 721, 214, 214, 214, 693, 214, 214, 214, 692, 214, - 214, 214, 691, 214, 214, 214, 370, 214, 214, 214, - 374, 214, 214, 371, 359, 214, 690, 214, 214, 214, - - 245, 214, 214, 245, 372, 245, 240, 700, 245, 381, - 373, 246, 247, 248, 246, 248, 247, 248, 248, 245, - 245, 245, 245, 245, 245, 245, 241, 387, 245, 699, - 698, 376, 375, 383, 245, 245, 245, 245, 245, 245, - 245, 697, 388, 245, 391, 245, 384, 696, 245, 245, - 393, 390, 245, 389, 245, 695, 270, 245, 183, 270, - 394, 183, 245, 694, 392, 245, 395, 245, 245, 396, - 245, 245, 245, 245, 245, 245, 245, 245, 693, 245, - 245, 402, 245, 245, 692, 691, 399, 386, 397, 279, - 280, 281, 279, 423, 403, 690, 424, 312, 400, 312, - - 312, 401, 312, 313, 314, 315, 313, 320, 321, 689, - 320, 405, 320, 321, 404, 320, 451, 452, 688, 451, - 453, 406, 687, 453, 459, 460, 686, 459, 461, 462, - 685, 461, 350, 351, 636, 350, 214, 318, 214, 214, - 684, 214, 318, 214, 214, 214, 245, 214, 214, 245, - 214, 634, 214, 214, 214, 683, 214, 214, 463, 214, - 465, 214, 214, 467, 214, 454, 214, 214, 464, 682, - 348, 466, 468, 214, 348, 214, 214, 214, 205, 214, - 214, 214, 681, 214, 214, 214, 469, 214, 214, 630, - 245, 629, 470, 245, 472, 473, 214, 378, 214, 214, - - 628, 627, 214, 471, 214, 214, 626, 680, 214, 474, - 214, 214, 214, 475, 214, 214, 214, 245, 214, 214, - 245, 214, 476, 214, 214, 643, 214, 642, 214, 214, - 214, 245, 214, 214, 245, 641, 479, 480, 477, 488, - 640, 639, 478, 482, 452, 214, 482, 483, 638, 214, - 483, 214, 491, 214, 214, 214, 245, 214, 214, 245, - 214, 481, 214, 214, 214, 245, 214, 214, 245, 245, - 637, 245, 245, 245, 245, 636, 245, 635, 492, 371, - 490, 634, 245, 489, 493, 245, 245, 245, 485, 245, - 245, 633, 484, 632, 245, 494, 486, 245, 631, 630, - - 497, 495, 487, 245, 498, 245, 245, 245, 245, 629, - 245, 245, 496, 628, 245, 627, 499, 245, 500, 501, - 245, 245, 245, 245, 245, 245, 245, 270, 508, 183, - 270, 508, 183, 505, 626, 625, 504, 502, 507, 452, - 624, 507, 245, 503, 245, 245, 245, 245, 245, 245, - 245, 245, 623, 245, 506, 402, 245, 451, 452, 245, - 451, 453, 451, 452, 453, 451, 622, 453, 399, 403, - 453, 557, 621, 509, 557, 459, 460, 620, 459, 510, - 461, 462, 214, 461, 214, 214, 511, 550, 214, 404, - 214, 214, 245, 560, 512, 245, 214, 619, 214, 214, - - 214, 618, 214, 214, 561, 617, 454, 214, 563, 214, - 214, 214, 454, 214, 214, 214, 558, 214, 214, 588, - 245, 205, 562, 245, 616, 214, 205, 214, 214, 615, - 544, 584, 565, 214, 564, 214, 214, 214, 567, 214, - 214, 566, 543, 614, 214, 568, 214, 214, 214, 613, - 214, 214, 569, 214, 245, 214, 214, 245, 214, 570, - 214, 214, 214, 612, 214, 214, 572, 591, 611, 538, - 571, 214, 573, 214, 214, 214, 610, 214, 214, 575, - 214, 609, 214, 214, 214, 245, 214, 214, 245, 574, - 608, 576, 482, 452, 214, 482, 483, 245, 214, 483, - - 245, 585, 214, 577, 214, 214, 214, 559, 214, 214, - 214, 556, 214, 214, 582, 555, 214, 582, 245, 245, - 554, 245, 245, 586, 553, 245, 587, 578, 245, 245, - 245, 245, 245, 245, 245, 552, 245, 592, 593, 245, - 589, 484, 581, 245, 551, 245, 245, 579, 245, 580, - 245, 590, 245, 245, 550, 245, 596, 594, 595, 583, - 599, 549, 245, 245, 597, 245, 245, 245, 507, 452, - 245, 507, 598, 508, 245, 548, 508, 245, 600, 245, - 245, 606, 245, 245, 606, 557, 601, 557, 557, 214, - 557, 214, 214, 214, 547, 214, 214, 214, 546, 214, - - 214, 645, 644, 545, 214, 646, 214, 214, 544, 543, - 602, 245, 605, 214, 245, 214, 214, 245, 509, 603, - 245, 647, 604, 542, 662, 214, 607, 214, 214, 541, - 558, 540, 558, 648, 214, 539, 214, 214, 214, 538, - 214, 214, 649, 214, 537, 214, 214, 214, 536, 214, - 214, 214, 535, 214, 214, 214, 534, 214, 214, 214, - 533, 214, 214, 650, 426, 532, 214, 653, 214, 214, - 531, 214, 245, 214, 214, 245, 530, 529, 651, 655, - 663, 214, 652, 214, 214, 214, 654, 214, 214, 214, - 528, 214, 214, 214, 527, 214, 214, 214, 526, 214, - - 214, 214, 525, 214, 214, 214, 245, 214, 214, 245, - 657, 582, 656, 214, 582, 214, 245, 214, 214, 245, - 245, 524, 245, 245, 664, 245, 245, 523, 665, 245, - 658, 668, 245, 659, 666, 245, 660, 522, 245, 245, - 667, 245, 245, 245, 245, 245, 245, 245, 245, 521, - 245, 245, 671, 245, 245, 520, 583, 519, 673, 245, - 661, 245, 245, 518, 245, 672, 669, 517, 245, 245, - 670, 245, 245, 245, 245, 606, 245, 245, 606, 516, - 245, 245, 675, 245, 245, 214, 674, 214, 214, 214, - 515, 214, 214, 701, 214, 514, 214, 214, 214, 245, - - 214, 214, 245, 513, 678, 676, 677, 214, 458, 214, - 214, 214, 457, 214, 214, 214, 456, 214, 214, 214, - 607, 214, 214, 702, 341, 679, 214, 703, 214, 214, - 214, 455, 214, 214, 704, 214, 450, 214, 214, 214, - 449, 214, 214, 214, 448, 214, 214, 214, 705, 214, - 214, 706, 214, 447, 214, 214, 214, 446, 214, 214, - 707, 214, 445, 214, 214, 214, 245, 214, 214, 245, - 245, 444, 245, 245, 711, 245, 245, 245, 245, 245, - 245, 245, 443, 442, 245, 712, 713, 245, 245, 709, - 441, 245, 714, 245, 708, 245, 245, 245, 245, 245, - - 245, 245, 245, 710, 245, 716, 715, 245, 245, 440, - 245, 245, 717, 245, 729, 439, 245, 729, 214, 438, - 214, 214, 214, 437, 214, 214, 214, 436, 214, 214, - 214, 435, 214, 214, 214, 245, 214, 214, 245, 434, - 719, 433, 732, 718, 214, 245, 214, 214, 245, 214, - 720, 214, 214, 735, 432, 214, 735, 733, 214, 730, - 214, 214, 314, 214, 734, 214, 214, 245, 245, 245, - 245, 245, 245, 245, 431, 245, 245, 738, 245, 245, - 430, 741, 245, 739, 741, 740, 245, 729, 729, 245, - 729, 729, 748, 429, 428, 748, 737, 214, 736, 214, - - 214, 214, 245, 214, 214, 245, 214, 427, 214, 214, - 735, 425, 214, 735, 214, 422, 214, 214, 752, 743, - 214, 752, 245, 421, 245, 245, 742, 245, 741, 420, - 419, 741, 730, 730, 418, 417, 245, 749, 750, 245, - 756, 748, 748, 756, 748, 748, 214, 416, 214, 214, - 214, 245, 214, 214, 245, 736, 754, 415, 752, 751, - 214, 752, 214, 753, 214, 214, 245, 756, 245, 245, - 756, 245, 214, 742, 214, 214, 414, 413, 412, 761, - 214, 755, 214, 214, 763, 757, 749, 749, 245, 245, - 411, 245, 245, 214, 245, 214, 214, 245, 214, 245, - - 214, 214, 245, 753, 410, 409, 214, 762, 214, 214, - 408, 767, 757, 764, 779, 245, 407, 214, 245, 214, - 214, 245, 284, 780, 245, 280, 211, 768, 349, 348, - 205, 201, 347, 775, 776, 771, 772, 20, 20, 20, - 20, 20, 20, 48, 48, 48, 48, 48, 48, 53, - 53, 53, 53, 53, 53, 60, 60, 60, 60, 60, - 60, 65, 65, 65, 65, 65, 65, 68, 68, 68, - 68, 68, 68, 94, 94, 94, 94, 94, 94, 146, - 146, 146, 146, 146, 146, 151, 151, 151, 151, 151, - 151, 183, 183, 197, 183, 183, 183, 193, 193, 193, - - 193, 193, 193, 196, 192, 346, 345, 196, 196, 198, - 198, 198, 198, 198, 198, 204, 204, 344, 343, 204, - 204, 210, 210, 210, 342, 210, 210, 213, 213, 191, - 213, 213, 213, 235, 235, 186, 235, 235, 235, 245, - 245, 185, 340, 337, 245, 270, 270, 336, 270, 270, - 270, 311, 311, 335, 334, 333, 311, 316, 316, 316, - 316, 316, 316, 377, 377, 332, 331, 330, 377, 398, - 398, 329, 398, 398, 398, 328, 327, 326, 325, 324, - 323, 322, 157, 314, 306, 305, 302, 301, 300, 297, - 296, 288, 287, 286, 285, 284, 282, 278, 273, 272, - - 268, 267, 266, 263, 262, 254, 253, 252, 251, 250, - 215, 212, 211, 209, 206, 205, 201, 197, 192, 191, - 186, 185, 175, 174, 173, 170, 169, 161, 160, 159, - 158, 157, 156, 781, 19, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781 + 20, 21, 22, 23, 21, 20, 24, 20, 25, 20, + 20, 26, 27, 28, 20, 29, 20, 20, 30, 20, + 31, 32, 33, 34, 35, 36, 20, 37, 38, 20, + 39, 20, 20, 40, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 41, 68, + 69, 41, 42, 297, 63, 64, 43, 51, 52, 53, + 54, 50, 56, 57, 58, 59, 63, 64, 847, 44, + 68, 69, 160, 161, 60, 155, 156, 157, 155, 177, + 158, 155, 156, 157, 155, 45, 158, 46, 163, 47, + 274, 163, 48, 49, 65, 175, 178, 171, 181, 66, + + 172, 162, 61, 199, 173, 200, 65, 275, 847, 176, + 182, 66, 70, 21, 71, 72, 21, 70, 73, 70, + 74, 70, 70, 75, 76, 77, 70, 78, 70, 70, + 79, 70, 80, 81, 82, 83, 84, 85, 70, 86, + 87, 70, 88, 70, 70, 89, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, + 41, 160, 161, 41, 90, 194, 197, 212, 91, 202, + 204, 205, 203, 207, 209, 210, 310, 217, 288, 176, + 272, 92, 218, 846, 278, 224, 198, 224, 224, 224, + 162, 224, 224, 311, 273, 213, 279, 93, 289, 94, + + 248, 95, 248, 248, 96, 97, 98, 99, 100, 101, + 99, 98, 102, 98, 103, 98, 98, 104, 105, 106, + 98, 107, 98, 98, 108, 98, 109, 110, 111, 112, + 113, 114, 98, 115, 116, 98, 117, 98, 98, 118, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 98, 98, 98, 119, 333, 193, 119, 120, 193, + 843, 224, 121, 224, 224, 314, 842, 224, 226, 224, + 224, 224, 285, 224, 224, 122, 224, 315, 224, 224, + 224, 227, 224, 224, 334, 268, 273, 228, 269, 229, + 839, 123, 270, 124, 235, 125, 360, 348, 126, 127, + + 20, 128, 129, 130, 128, 20, 24, 131, 132, 20, + 131, 133, 134, 135, 131, 136, 131, 131, 137, 131, + 138, 139, 140, 141, 142, 143, 131, 144, 145, 131, + 146, 20, 131, 147, 131, 131, 131, 131, 131, 131, + 131, 131, 131, 131, 131, 131, 20, 20, 148, 335, + 328, 148, 42, 328, 308, 224, 43, 224, 224, 224, + 838, 224, 224, 224, 304, 224, 224, 305, 309, 149, + 224, 306, 224, 224, 290, 230, 291, 232, 334, 238, + 233, 320, 454, 442, 234, 150, 231, 151, 224, 152, + 224, 224, 153, 49, 186, 309, 239, 186, 187, 835, + + 834, 224, 188, 224, 224, 224, 829, 224, 224, 325, + 236, 326, 224, 240, 224, 224, 323, 224, 163, 224, + 224, 163, 197, 345, 237, 241, 244, 224, 242, 224, + 224, 189, 224, 190, 224, 224, 324, 346, 191, 192, + 243, 224, 198, 224, 224, 245, 224, 828, 224, 224, + 224, 827, 224, 224, 224, 249, 224, 224, 816, 224, + 246, 224, 224, 199, 224, 200, 224, 224, 224, 237, + 224, 224, 258, 259, 260, 258, 260, 261, 260, 260, + 252, 283, 259, 260, 283, 293, 294, 295, 293, 319, + 294, 295, 319, 250, 251, 254, 357, 255, 212, 358, + + 253, 329, 330, 331, 329, 336, 337, 217, 336, 202, + 204, 205, 218, 256, 207, 209, 210, 369, 370, 224, + 369, 224, 224, 815, 439, 224, 213, 224, 224, 224, + 257, 224, 224, 257, 323, 334, 226, 224, 440, 224, + 224, 224, 814, 224, 224, 224, 813, 224, 224, 224, + 372, 224, 224, 224, 324, 224, 224, 371, 374, 224, + 796, 224, 224, 367, 333, 224, 375, 224, 224, 373, + 795, 224, 376, 224, 224, 224, 765, 224, 224, 224, + 378, 224, 224, 224, 800, 224, 224, 224, 257, 224, + 224, 257, 377, 334, 379, 380, 224, 402, 224, 224, + + 224, 797, 224, 224, 381, 382, 796, 224, 383, 224, + 224, 224, 257, 224, 224, 257, 386, 385, 224, 400, + 224, 224, 795, 224, 384, 224, 224, 224, 388, 224, + 224, 224, 257, 224, 224, 257, 794, 793, 389, 387, + 248, 404, 248, 248, 390, 792, 248, 391, 248, 248, + 224, 791, 224, 224, 224, 760, 224, 224, 224, 257, + 224, 224, 257, 790, 224, 392, 224, 224, 224, 758, + 224, 224, 405, 396, 393, 381, 224, 757, 224, 224, + 224, 756, 224, 224, 224, 394, 224, 224, 755, 252, + 754, 395, 258, 259, 260, 258, 260, 259, 260, 260, + + 257, 257, 257, 257, 257, 257, 753, 257, 257, 253, + 257, 257, 765, 397, 764, 406, 257, 408, 257, 257, + 401, 257, 398, 257, 763, 403, 257, 257, 762, 257, + 257, 409, 257, 761, 407, 257, 410, 257, 257, 257, + 257, 257, 257, 411, 257, 412, 416, 257, 413, 760, + 257, 418, 415, 257, 759, 257, 257, 414, 257, 758, + 757, 284, 419, 193, 284, 756, 193, 417, 257, 257, + 420, 257, 257, 421, 257, 257, 257, 257, 257, 257, + 257, 755, 257, 257, 427, 257, 754, 257, 451, 422, + 257, 452, 424, 411, 753, 328, 328, 428, 328, 328, + + 425, 293, 294, 295, 293, 752, 751, 426, 329, 330, + 331, 329, 336, 337, 750, 336, 749, 429, 748, 430, + 336, 337, 431, 336, 482, 483, 484, 482, 691, 484, + 490, 491, 747, 490, 492, 493, 689, 492, 369, 370, + 746, 369, 334, 224, 257, 224, 224, 257, 745, 744, + 334, 224, 494, 224, 224, 224, 743, 224, 224, 224, + 257, 224, 224, 257, 224, 257, 224, 224, 257, 522, + 684, 485, 400, 495, 497, 224, 367, 224, 224, 683, + 367, 682, 496, 681, 215, 498, 224, 680, 224, 224, + 224, 679, 224, 224, 224, 499, 224, 224, 742, 741, + + 698, 501, 224, 500, 224, 224, 224, 697, 224, 224, + 224, 503, 224, 224, 696, 224, 502, 224, 224, 224, + 257, 224, 224, 257, 224, 504, 224, 224, 506, 507, + 224, 257, 224, 224, 257, 257, 505, 508, 257, 532, + 224, 509, 224, 224, 224, 695, 224, 224, 224, 694, + 224, 224, 526, 224, 510, 224, 224, 523, 224, 693, + 224, 224, 224, 257, 224, 224, 257, 692, 513, 514, + 511, 691, 527, 690, 512, 516, 483, 224, 516, 517, + 689, 224, 517, 224, 688, 224, 224, 224, 257, 224, + 224, 257, 224, 515, 224, 224, 224, 257, 224, 224, + + 257, 257, 687, 257, 257, 257, 257, 257, 257, 686, + 257, 393, 525, 685, 528, 524, 531, 684, 257, 257, + 519, 257, 257, 257, 518, 683, 257, 530, 520, 529, + 682, 681, 534, 535, 521, 257, 257, 257, 257, 257, + 257, 680, 257, 257, 533, 257, 257, 537, 536, 257, + 257, 538, 257, 257, 257, 544, 483, 257, 544, 679, + 284, 542, 193, 284, 541, 193, 678, 545, 539, 540, + 545, 257, 257, 257, 257, 257, 257, 257, 257, 677, + 257, 257, 427, 257, 676, 543, 257, 482, 483, 484, + 482, 675, 484, 674, 482, 483, 424, 482, 428, 484, + + 600, 673, 484, 600, 490, 491, 257, 490, 547, 257, + 492, 493, 546, 492, 548, 672, 593, 224, 429, 224, + 224, 549, 224, 671, 224, 224, 224, 257, 224, 224, + 257, 670, 603, 604, 485, 224, 257, 224, 224, 257, + 669, 668, 605, 632, 485, 601, 224, 667, 224, 224, + 215, 630, 587, 586, 607, 224, 215, 224, 224, 666, + 224, 606, 224, 224, 224, 665, 224, 224, 224, 664, + 224, 224, 224, 663, 224, 224, 224, 257, 224, 224, + 257, 609, 608, 610, 662, 634, 661, 612, 224, 613, + 224, 224, 579, 660, 611, 224, 614, 224, 224, 224, + + 659, 224, 224, 615, 224, 658, 224, 224, 224, 257, + 224, 224, 257, 224, 657, 224, 224, 224, 602, 224, + 224, 618, 599, 598, 639, 616, 617, 619, 224, 597, + 224, 224, 224, 596, 224, 224, 621, 224, 257, 224, + 224, 257, 595, 224, 620, 224, 224, 594, 622, 516, + 483, 224, 516, 517, 257, 224, 517, 257, 593, 224, + 623, 224, 224, 224, 633, 224, 224, 224, 592, 224, + 224, 628, 257, 224, 628, 257, 257, 257, 591, 257, + 257, 635, 257, 631, 590, 257, 624, 257, 257, 257, + 257, 257, 257, 589, 588, 587, 637, 636, 518, 627, + + 640, 586, 257, 585, 625, 257, 626, 584, 638, 257, + 641, 644, 257, 583, 643, 257, 629, 642, 257, 257, + 257, 257, 257, 257, 257, 582, 581, 257, 645, 648, + 257, 257, 257, 646, 257, 257, 544, 483, 545, 544, + 580, 545, 257, 649, 579, 257, 257, 647, 257, 257, + 655, 257, 600, 655, 650, 600, 600, 578, 224, 600, + 224, 224, 577, 224, 576, 224, 224, 257, 575, 224, + 257, 224, 224, 574, 573, 651, 700, 701, 454, 224, + 654, 224, 224, 546, 699, 572, 571, 652, 224, 653, + 224, 224, 570, 720, 569, 656, 702, 601, 568, 567, + + 224, 601, 224, 224, 224, 566, 224, 224, 703, 565, + 564, 224, 704, 224, 224, 224, 563, 224, 224, 705, + 562, 561, 224, 706, 224, 224, 224, 560, 224, 224, + 224, 559, 224, 224, 224, 558, 224, 224, 224, 557, + 224, 224, 224, 257, 224, 224, 257, 224, 707, 224, + 224, 708, 556, 555, 224, 711, 224, 224, 224, 257, + 224, 224, 257, 554, 257, 709, 713, 257, 224, 710, + 224, 224, 721, 224, 712, 224, 224, 224, 553, 224, + 224, 224, 552, 224, 224, 224, 551, 224, 224, 224, + 728, 224, 224, 224, 257, 224, 224, 257, 715, 628, + + 714, 224, 628, 224, 257, 224, 224, 257, 257, 550, + 257, 257, 722, 257, 257, 489, 723, 257, 716, 729, + 257, 717, 724, 257, 718, 488, 257, 257, 725, 257, + 257, 487, 360, 257, 726, 727, 257, 257, 257, 257, + 257, 257, 257, 486, 629, 481, 732, 257, 719, 257, + 257, 257, 257, 257, 257, 734, 257, 480, 257, 733, + 730, 257, 257, 479, 731, 257, 257, 655, 257, 257, + 655, 257, 257, 257, 736, 257, 257, 224, 735, 224, + 224, 224, 478, 224, 224, 766, 477, 476, 224, 767, + 224, 224, 475, 474, 224, 737, 224, 224, 738, 739, + + 224, 473, 224, 224, 224, 472, 224, 224, 224, 471, + 224, 224, 656, 224, 470, 224, 224, 740, 224, 469, + 224, 224, 224, 468, 224, 224, 768, 467, 466, 224, + 769, 224, 224, 224, 465, 224, 224, 770, 464, 463, + 224, 771, 224, 224, 224, 462, 224, 224, 224, 461, + 224, 224, 224, 460, 224, 224, 224, 772, 224, 224, + 773, 224, 330, 224, 224, 224, 459, 224, 224, 774, + 224, 458, 224, 224, 224, 257, 224, 224, 257, 257, + 457, 257, 257, 778, 257, 257, 257, 779, 257, 257, + 257, 257, 257, 257, 257, 257, 257, 456, 776, 257, + + 780, 455, 257, 775, 781, 257, 257, 453, 257, 257, + 782, 257, 777, 257, 783, 257, 257, 257, 257, 257, + 257, 257, 257, 450, 257, 785, 784, 257, 257, 449, + 257, 257, 786, 257, 798, 448, 257, 798, 224, 447, + 224, 224, 224, 446, 224, 224, 224, 445, 224, 224, + 224, 444, 224, 224, 224, 257, 224, 224, 257, 224, + 788, 224, 224, 787, 224, 257, 224, 224, 257, 443, + 789, 224, 801, 224, 224, 224, 442, 224, 224, 799, + 441, 438, 224, 802, 224, 224, 437, 804, 803, 224, + 804, 224, 257, 224, 224, 257, 257, 257, 257, 257, + + 257, 257, 257, 257, 257, 257, 257, 257, 257, 436, + 807, 257, 808, 810, 809, 257, 810, 798, 257, 798, + 798, 435, 798, 817, 806, 224, 817, 224, 224, 434, + 433, 224, 805, 224, 224, 224, 432, 224, 224, 804, + 298, 224, 804, 224, 294, 224, 224, 821, 812, 224, + 821, 257, 257, 257, 257, 257, 257, 810, 811, 221, + 810, 368, 799, 257, 799, 367, 257, 819, 818, 825, + 817, 817, 825, 817, 817, 215, 224, 211, 224, 224, + 224, 366, 224, 224, 805, 823, 207, 821, 820, 224, + 821, 224, 822, 224, 224, 257, 257, 825, 257, 257, + + 825, 257, 811, 224, 257, 224, 224, 202, 824, 830, + 224, 365, 224, 224, 826, 818, 818, 257, 257, 364, + 257, 257, 224, 257, 224, 224, 257, 224, 832, 224, + 224, 257, 822, 363, 257, 224, 831, 224, 224, 362, + 361, 201, 826, 848, 257, 196, 833, 257, 224, 836, + 224, 224, 849, 195, 257, 359, 837, 257, 356, 355, + 354, 353, 844, 352, 840, 841, 845, 50, 50, 50, + 50, 50, 50, 55, 55, 55, 55, 55, 55, 62, + 62, 62, 62, 62, 62, 67, 67, 67, 67, 67, + 67, 154, 154, 154, 154, 154, 154, 159, 159, 159, + + 159, 159, 159, 193, 193, 351, 193, 193, 193, 203, + 203, 203, 203, 203, 203, 206, 350, 349, 348, 206, + 206, 208, 208, 208, 208, 208, 208, 214, 214, 347, + 344, 214, 214, 220, 220, 220, 343, 220, 220, 223, + 223, 342, 223, 223, 223, 247, 247, 341, 247, 247, + 247, 257, 257, 340, 339, 338, 257, 284, 284, 165, + 284, 284, 284, 327, 327, 330, 322, 321, 327, 332, + 332, 332, 332, 332, 332, 399, 399, 318, 317, 316, + 399, 423, 423, 313, 423, 423, 423, 312, 307, 303, + 302, 301, 300, 299, 298, 296, 292, 287, 286, 282, + + 281, 280, 277, 276, 271, 267, 266, 265, 264, 263, + 262, 225, 222, 221, 219, 216, 215, 211, 207, 202, + 201, 196, 195, 185, 184, 183, 180, 179, 174, 170, + 169, 168, 167, 166, 165, 164, 850, 19, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850 } ; -static yyconst flex_int16_t yy_chk[2084] = +static yyconst short int yy_chk[2187] = { 0, - 0, 1, 1, 1, 1, 801, 1, 0, 1, 7, - 7, 21, 1, 1, 21, 1, 8, 8, 1, 35, - 1, 777, 1, 1, 1, 1, 114, 1, 1, 114, - 1, 35, 774, 1, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, - 4, 5, 5, 6, 6, 15, 15, 15, 15, 4, - - 15, 16, 16, 16, 16, 31, 16, 32, 17, 17, - 30, 42, 45, 30, 18, 18, 46, 30, 46, 31, - 51, 51, 51, 63, 32, 42, 59, 4, 63, 184, - 184, 5, 45, 6, 773, 105, 5, 17, 6, 9, - 9, 9, 9, 18, 9, 68, 9, 68, 68, 105, - 9, 9, 104, 9, 59, 104, 9, 770, 9, 104, - 9, 9, 9, 9, 769, 9, 9, 71, 9, 71, - 71, 9, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 11, 11, 11, 11, 109, 11, 72, 11, 72, 72, - 207, 11, 11, 72, 11, 207, 109, 11, 120, 11, - 120, 11, 11, 11, 11, 766, 11, 11, 86, 11, - 86, 86, 11, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - - 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 7, + 7, 2, 2, 867, 5, 5, 2, 3, 3, 3, + 3, 4, 4, 4, 4, 4, 6, 6, 846, 2, + 8, 8, 17, 17, 4, 15, 15, 15, 15, 34, + 15, 16, 16, 16, 16, 2, 16, 2, 21, 2, + 112, 21, 2, 2, 5, 33, 34, 31, 37, 5, + + 31, 17, 4, 48, 31, 48, 6, 112, 843, 33, + 37, 6, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 10, 18, 18, 10, 10, 44, 47, 61, 10, 53, + 53, 53, 58, 58, 58, 58, 141, 65, 125, 44, + 111, 10, 65, 842, 115, 70, 47, 70, 70, 73, + 18, 73, 73, 141, 111, 61, 115, 10, 125, 10, + + 90, 10, 90, 90, 10, 10, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 12, 159, 120, 12, 12, 120, + 839, 74, 12, 74, 74, 144, 838, 75, 74, 75, + 75, 76, 122, 76, 76, 12, 77, 144, 77, 77, + 81, 75, 81, 81, 159, 109, 122, 76, 109, 77, + 835, 12, 109, 12, 81, 12, 194, 194, 12, 12, + + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, - 106, 146, 14, 14, 146, 119, 144, 14, 56, 56, - 56, 56, 73, 116, 73, 73, 74, 106, 74, 74, - 14, 75, 136, 75, 75, 119, 144, 116, 73, 74, - 76, 151, 76, 76, 136, 765, 14, 132, 14, 131, - 14, 75, 131, 14, 14, 39, 131, 759, 39, 39, - - 133, 132, 77, 39, 77, 77, 78, 76, 78, 78, - 151, 79, 141, 79, 79, 78, 77, 133, 155, 77, - 79, 155, 80, 77, 80, 80, 141, 153, 81, 78, - 81, 81, 39, 82, 39, 82, 82, 79, 758, 39, - 39, 83, 174, 83, 83, 174, 749, 80, 81, 82, - 83, 84, 746, 84, 84, 85, 153, 85, 85, 188, - 87, 82, 87, 87, 84, 145, 88, 145, 88, 88, - 89, 308, 89, 89, 90, 88, 90, 90, 91, 188, - 91, 91, 154, 154, 92, 154, 92, 92, 85, 88, - 93, 308, 93, 93, 95, 95, 95, 95, 744, 91, - - 97, 97, 97, 97, 113, 113, 113, 113, 122, 122, - 122, 122, 154, 89, 90, 92, 181, 92, 181, 91, - 140, 140, 140, 140, 147, 147, 147, 147, 195, 195, - 195, 200, 200, 200, 203, 93, 209, 209, 213, 209, - 213, 213, 214, 730, 214, 214, 216, 245, 216, 216, - 245, 728, 217, 216, 217, 217, 218, 250, 218, 218, - 250, 217, 203, 219, 250, 219, 219, 725, 220, 723, - 220, 220, 219, 221, 251, 221, 221, 251, 304, 304, - 218, 220, 209, 251, 722, 222, 221, 222, 222, 721, - 223, 700, 223, 223, 224, 699, 224, 224, 225, 697, - - 225, 225, 226, 696, 226, 226, 227, 257, 227, 227, - 257, 316, 222, 223, 228, 254, 228, 228, 254, 224, - 225, 694, 258, 226, 229, 258, 229, 229, 254, 252, - 257, 228, 252, 229, 227, 230, 689, 230, 230, 231, - 316, 231, 231, 232, 688, 232, 232, 258, 233, 231, - 233, 233, 234, 252, 234, 234, 687, 235, 232, 235, - 235, 686, 685, 230, 236, 233, 236, 236, 233, 237, - 684, 237, 237, 238, 683, 238, 238, 239, 682, 239, - 239, 240, 681, 240, 240, 241, 234, 241, 241, 243, - 240, 243, 243, 237, 237, 242, 680, 242, 242, 244, - - 253, 244, 244, 253, 238, 259, 241, 643, 259, 253, - 239, 246, 246, 246, 246, 248, 248, 248, 248, 256, - 255, 260, 256, 255, 260, 261, 241, 259, 261, 641, - 640, 243, 242, 255, 262, 263, 264, 262, 263, 264, - 265, 639, 260, 265, 263, 266, 256, 638, 266, 267, - 265, 262, 267, 261, 268, 637, 270, 268, 270, 270, - 266, 270, 271, 635, 264, 271, 267, 272, 273, 267, - 272, 273, 274, 275, 276, 274, 275, 276, 633, 277, - 278, 274, 277, 278, 632, 631, 271, 271, 268, 279, - 279, 279, 279, 301, 275, 625, 301, 311, 272, 312, - - 311, 273, 312, 313, 313, 313, 313, 318, 318, 624, - 318, 276, 320, 320, 275, 320, 341, 341, 623, 341, - 342, 277, 622, 342, 348, 348, 621, 348, 349, 349, - 620, 349, 350, 350, 619, 350, 352, 318, 352, 352, - 618, 353, 320, 353, 353, 354, 377, 354, 354, 377, - 355, 617, 355, 355, 356, 616, 356, 356, 352, 357, - 354, 357, 357, 356, 358, 342, 358, 358, 353, 615, - 348, 355, 357, 359, 349, 359, 359, 360, 350, 360, - 360, 361, 614, 361, 361, 362, 358, 362, 362, 613, - 378, 612, 359, 378, 361, 362, 363, 378, 363, 363, - - 611, 610, 364, 360, 364, 364, 609, 608, 365, 363, - 365, 365, 366, 364, 366, 366, 367, 379, 367, 367, - 379, 368, 365, 368, 368, 559, 369, 558, 369, 369, - 370, 382, 370, 370, 382, 556, 368, 369, 366, 379, - 555, 553, 367, 371, 371, 371, 371, 372, 552, 372, - 372, 373, 382, 373, 373, 374, 380, 374, 374, 380, - 375, 370, 375, 375, 376, 381, 376, 376, 381, 383, - 551, 384, 383, 385, 384, 549, 385, 548, 383, 374, - 381, 547, 386, 380, 384, 386, 387, 388, 373, 387, - 388, 546, 372, 545, 389, 385, 375, 389, 542, 541, - - 388, 386, 376, 390, 389, 392, 390, 391, 392, 540, - 391, 393, 387, 539, 393, 537, 390, 394, 391, 392, - 394, 395, 396, 397, 395, 396, 397, 398, 400, 398, - 398, 400, 398, 396, 536, 535, 395, 393, 399, 399, - 533, 399, 401, 394, 402, 401, 403, 402, 404, 403, - 405, 404, 532, 405, 397, 403, 406, 426, 426, 406, - 426, 427, 451, 451, 427, 451, 531, 453, 402, 404, - 453, 457, 530, 400, 457, 459, 459, 529, 459, 401, - 461, 461, 463, 461, 463, 463, 405, 528, 464, 404, - 464, 464, 492, 463, 406, 492, 465, 527, 465, 465, - - 466, 526, 466, 466, 464, 525, 427, 467, 466, 467, - 467, 468, 453, 468, 468, 469, 457, 469, 469, 492, - 488, 459, 465, 488, 524, 470, 461, 470, 470, 523, - 522, 488, 468, 473, 467, 473, 473, 471, 470, 471, - 471, 469, 521, 520, 472, 471, 472, 472, 474, 519, - 474, 474, 472, 475, 495, 475, 475, 495, 476, 473, - 476, 476, 477, 518, 477, 477, 475, 495, 517, 516, - 474, 478, 476, 478, 478, 479, 515, 479, 479, 478, - 480, 514, 480, 480, 481, 489, 481, 481, 489, 477, - 513, 479, 482, 482, 482, 482, 483, 490, 483, 483, - - 490, 489, 484, 480, 484, 484, 485, 458, 485, 485, - 486, 456, 486, 486, 487, 455, 487, 487, 491, 493, - 454, 491, 493, 490, 450, 494, 491, 481, 494, 496, - 497, 498, 496, 497, 498, 449, 499, 496, 497, 499, - 493, 483, 486, 500, 448, 502, 500, 484, 502, 485, - 501, 494, 503, 501, 447, 503, 500, 498, 499, 487, - 503, 446, 504, 505, 501, 504, 505, 506, 507, 507, - 506, 507, 502, 508, 509, 445, 508, 509, 504, 510, - 511, 512, 510, 511, 512, 534, 505, 557, 534, 560, - 557, 560, 560, 561, 444, 561, 561, 562, 443, 562, - - 562, 561, 560, 442, 563, 562, 563, 563, 441, 440, - 506, 584, 511, 564, 584, 564, 564, 587, 508, 509, - 587, 564, 510, 439, 584, 565, 512, 565, 565, 438, - 534, 437, 557, 565, 566, 436, 566, 566, 567, 435, - 567, 567, 566, 568, 434, 568, 568, 569, 433, 569, - 569, 570, 432, 570, 570, 571, 431, 571, 571, 572, - 430, 572, 572, 567, 429, 428, 573, 572, 573, 573, - 425, 574, 585, 574, 574, 585, 424, 423, 570, 574, - 585, 575, 571, 575, 575, 576, 573, 576, 576, 577, - 422, 577, 577, 578, 421, 578, 578, 579, 420, 579, - - 579, 580, 419, 580, 580, 581, 591, 581, 581, 591, - 577, 582, 576, 582, 582, 583, 586, 583, 583, 586, - 588, 418, 592, 588, 586, 592, 589, 417, 588, 589, - 578, 591, 590, 580, 589, 590, 581, 416, 593, 594, - 590, 593, 594, 595, 596, 597, 595, 596, 597, 415, - 598, 599, 596, 598, 599, 414, 582, 413, 598, 600, - 583, 601, 600, 412, 601, 597, 594, 411, 602, 603, - 595, 602, 603, 605, 604, 606, 605, 604, 606, 410, - 607, 663, 601, 607, 663, 644, 600, 644, 644, 645, - 409, 645, 645, 644, 646, 408, 646, 646, 647, 664, - - 647, 647, 664, 407, 605, 602, 604, 648, 347, 648, - 648, 649, 346, 649, 649, 650, 345, 650, 650, 651, - 606, 651, 651, 650, 344, 607, 652, 651, 652, 652, - 653, 343, 653, 653, 652, 654, 340, 654, 654, 655, - 339, 655, 655, 656, 338, 656, 656, 657, 654, 657, - 657, 656, 658, 337, 658, 658, 659, 336, 659, 659, - 657, 660, 335, 660, 660, 661, 662, 661, 661, 662, - 665, 334, 666, 665, 662, 666, 667, 668, 669, 667, - 668, 669, 333, 332, 670, 668, 669, 670, 671, 659, - 331, 671, 670, 672, 658, 673, 672, 674, 673, 675, - - 674, 676, 675, 660, 676, 674, 672, 677, 678, 330, - 677, 678, 675, 679, 698, 329, 679, 698, 701, 328, - 701, 701, 702, 327, 702, 702, 703, 326, 703, 703, - 704, 325, 704, 704, 705, 711, 705, 705, 711, 324, - 677, 323, 705, 676, 706, 712, 706, 706, 712, 707, - 678, 707, 707, 709, 322, 709, 709, 707, 708, 698, - 708, 708, 315, 710, 708, 710, 710, 713, 714, 715, - 713, 714, 715, 716, 310, 717, 716, 715, 717, 718, - 309, 719, 718, 717, 719, 718, 720, 724, 729, 720, - 724, 729, 731, 307, 306, 731, 710, 732, 709, 732, - - 732, 733, 738, 733, 733, 738, 734, 305, 734, 734, - 735, 302, 735, 735, 736, 300, 736, 736, 737, 720, - 737, 737, 739, 299, 740, 739, 719, 740, 741, 298, - 297, 741, 724, 729, 296, 295, 742, 731, 734, 742, - 743, 745, 748, 743, 745, 748, 750, 294, 750, 750, - 751, 754, 751, 751, 754, 735, 740, 293, 752, 736, - 752, 752, 753, 737, 753, 753, 755, 756, 757, 755, - 756, 757, 761, 741, 761, 761, 292, 291, 290, 750, - 762, 742, 762, 762, 754, 743, 745, 748, 763, 764, - 289, 763, 764, 767, 768, 767, 767, 768, 771, 772, - - 771, 771, 772, 752, 288, 287, 775, 753, 775, 775, - 286, 761, 756, 757, 775, 776, 285, 779, 776, 779, - 779, 780, 284, 776, 780, 281, 210, 763, 208, 205, - 204, 202, 201, 771, 772, 767, 768, 782, 782, 782, - 782, 782, 782, 783, 783, 783, 783, 783, 783, 784, - 784, 784, 784, 784, 784, 785, 785, 785, 785, 785, - 785, 786, 786, 786, 786, 786, 786, 787, 787, 787, - 787, 787, 787, 788, 788, 788, 788, 788, 788, 789, - 789, 789, 789, 789, 789, 790, 790, 790, 790, 790, - 790, 791, 791, 199, 791, 791, 791, 792, 792, 792, - - 792, 792, 792, 793, 194, 190, 189, 793, 793, 794, - 794, 794, 794, 794, 794, 795, 795, 187, 186, 795, - 795, 796, 796, 796, 185, 796, 796, 797, 797, 182, - 797, 797, 797, 798, 798, 180, 798, 798, 798, 799, - 799, 179, 175, 173, 799, 800, 800, 172, 800, 800, - 800, 802, 802, 171, 170, 169, 802, 803, 803, 803, - 803, 803, 803, 804, 804, 168, 167, 166, 804, 805, - 805, 165, 805, 805, 805, 164, 163, 162, 161, 160, - 159, 158, 157, 149, 143, 142, 139, 138, 137, 135, - 134, 130, 129, 128, 127, 126, 124, 121, 118, 117, - - 112, 111, 110, 108, 107, 103, 102, 101, 100, 99, - 70, 67, 65, 64, 62, 60, 58, 55, 50, 47, - 44, 43, 38, 37, 36, 34, 33, 29, 28, 27, - 26, 25, 23, 19, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, - 781, 781, 781 + 13, 13, 13, 13, 13, 13, 13, 13, 14, 161, + 154, 14, 14, 154, 140, 78, 14, 78, 78, 79, + 834, 79, 79, 80, 138, 80, 80, 138, 140, 14, + 83, 138, 83, 83, 126, 78, 126, 80, 161, 83, + 80, 149, 320, 320, 80, 14, 79, 14, 84, 14, + 84, 84, 14, 14, 41, 149, 83, 41, 41, 828, + + 827, 82, 41, 82, 82, 85, 818, 85, 85, 153, + 82, 153, 86, 84, 86, 86, 152, 87, 163, 87, + 87, 163, 198, 173, 82, 85, 87, 89, 86, 89, + 89, 41, 88, 41, 88, 88, 152, 173, 41, 41, + 86, 91, 198, 91, 91, 88, 92, 815, 92, 92, + 93, 813, 93, 93, 94, 92, 94, 94, 799, 95, + 89, 95, 95, 191, 96, 191, 96, 96, 97, 92, + 97, 97, 99, 99, 99, 99, 101, 101, 101, 101, + 95, 119, 119, 119, 119, 128, 128, 128, 128, 148, + 148, 148, 148, 93, 94, 96, 184, 96, 213, 184, + + 95, 155, 155, 155, 155, 162, 162, 217, 162, 205, + 205, 205, 217, 97, 210, 210, 210, 219, 219, 223, + 219, 223, 223, 797, 306, 224, 213, 224, 224, 226, + 257, 226, 226, 257, 324, 162, 226, 227, 306, 227, + 227, 228, 794, 228, 228, 229, 792, 229, 229, 230, + 228, 230, 230, 231, 324, 231, 231, 227, 230, 232, + 791, 232, 232, 219, 332, 233, 231, 233, 233, 229, + 790, 234, 232, 234, 234, 235, 765, 235, 235, 236, + 234, 236, 236, 237, 764, 237, 237, 238, 264, 238, + 238, 264, 233, 332, 234, 235, 239, 264, 239, 239, + + 240, 762, 240, 240, 236, 237, 761, 241, 238, 241, + 241, 242, 262, 242, 242, 262, 241, 240, 243, 262, + 243, 243, 759, 244, 239, 244, 244, 245, 243, 245, + 245, 246, 266, 246, 246, 266, 752, 751, 244, 242, + 247, 266, 247, 247, 245, 750, 248, 245, 248, 248, + 249, 749, 249, 249, 250, 748, 250, 250, 251, 267, + 251, 251, 267, 747, 252, 246, 252, 252, 253, 746, + 253, 253, 267, 252, 249, 249, 254, 745, 254, 254, + 255, 744, 255, 255, 256, 250, 256, 256, 743, 253, + 742, 251, 258, 258, 258, 258, 260, 260, 260, 260, + + 263, 265, 268, 263, 265, 268, 741, 269, 270, 253, + 269, 270, 698, 254, 696, 268, 271, 270, 272, 271, + 263, 272, 255, 273, 695, 265, 273, 274, 694, 275, + 274, 270, 275, 693, 269, 276, 271, 277, 276, 278, + 277, 279, 278, 272, 279, 273, 277, 280, 274, 692, + 280, 279, 276, 281, 690, 282, 281, 275, 282, 688, + 687, 284, 280, 284, 284, 686, 284, 278, 285, 286, + 281, 285, 286, 281, 287, 288, 289, 287, 288, 289, + 291, 685, 290, 291, 288, 290, 678, 292, 317, 282, + 292, 317, 285, 285, 677, 327, 328, 289, 327, 328, + + 286, 293, 293, 293, 293, 676, 675, 287, 329, 329, + 329, 329, 334, 334, 674, 334, 673, 289, 672, 290, + 336, 336, 291, 336, 360, 360, 361, 360, 671, 361, + 367, 367, 670, 367, 368, 368, 669, 368, 369, 369, + 668, 369, 334, 371, 399, 371, 371, 399, 667, 666, + 336, 372, 371, 372, 372, 373, 665, 373, 373, 374, + 401, 374, 374, 401, 375, 400, 375, 375, 400, 401, + 664, 361, 400, 372, 374, 378, 367, 378, 378, 663, + 368, 662, 373, 661, 369, 375, 376, 660, 376, 376, + 377, 659, 377, 377, 379, 376, 379, 379, 658, 657, + + 602, 378, 380, 377, 380, 380, 381, 601, 381, 381, + 382, 380, 382, 382, 599, 383, 379, 383, 383, 384, + 411, 384, 384, 411, 385, 381, 385, 385, 383, 384, + 386, 405, 386, 386, 405, 402, 382, 385, 402, 411, + 387, 386, 387, 387, 388, 598, 388, 388, 389, 596, + 389, 389, 405, 390, 387, 390, 390, 402, 391, 595, + 391, 391, 392, 406, 392, 392, 406, 594, 390, 391, + 388, 592, 406, 591, 389, 393, 393, 393, 393, 394, + 590, 394, 394, 395, 589, 395, 395, 396, 403, 396, + 396, 403, 397, 392, 397, 397, 398, 404, 398, 398, + + 404, 407, 588, 408, 407, 409, 408, 410, 409, 585, + 410, 396, 404, 584, 407, 403, 410, 583, 412, 413, + 395, 412, 413, 414, 394, 582, 414, 409, 397, 408, + 581, 580, 413, 414, 398, 415, 416, 417, 415, 416, + 417, 578, 418, 419, 412, 418, 419, 416, 415, 420, + 421, 417, 420, 421, 422, 424, 424, 422, 424, 577, + 423, 421, 423, 423, 420, 423, 576, 425, 418, 419, + 425, 426, 427, 428, 426, 427, 428, 429, 430, 575, + 429, 430, 428, 431, 573, 422, 431, 454, 454, 455, + 454, 572, 455, 571, 482, 482, 427, 482, 429, 484, + + 488, 570, 484, 488, 490, 490, 634, 490, 426, 634, + 492, 492, 425, 492, 430, 569, 568, 494, 429, 494, + 494, 431, 495, 567, 495, 495, 496, 524, 496, 496, + 524, 566, 494, 495, 455, 497, 522, 497, 497, 522, + 565, 564, 496, 524, 484, 488, 498, 563, 498, 498, + 490, 522, 562, 561, 498, 499, 492, 499, 499, 560, + 500, 497, 500, 500, 501, 559, 501, 501, 502, 558, + 502, 502, 503, 557, 503, 503, 504, 526, 504, 504, + 526, 500, 499, 501, 556, 526, 555, 503, 505, 504, + 505, 505, 554, 553, 502, 506, 505, 506, 506, 507, + + 552, 507, 507, 506, 508, 551, 508, 508, 509, 531, + 509, 509, 531, 510, 550, 510, 510, 511, 489, 511, + 511, 509, 487, 486, 531, 507, 508, 510, 512, 485, + 512, 512, 513, 481, 513, 513, 512, 514, 525, 514, + 514, 525, 480, 515, 511, 515, 515, 479, 513, 516, + 516, 516, 516, 517, 527, 517, 517, 527, 478, 518, + 514, 518, 518, 519, 525, 519, 519, 520, 477, 520, + 520, 521, 523, 521, 521, 523, 528, 529, 476, 528, + 529, 527, 530, 523, 475, 530, 515, 532, 535, 536, + 532, 535, 536, 474, 473, 472, 529, 528, 517, 520, + + 532, 471, 533, 470, 518, 533, 519, 469, 530, 534, + 533, 536, 534, 468, 535, 537, 521, 534, 537, 538, + 539, 540, 538, 539, 540, 467, 466, 541, 537, 540, + 541, 542, 543, 538, 542, 543, 544, 544, 545, 544, + 465, 545, 546, 541, 464, 546, 547, 539, 548, 547, + 549, 548, 574, 549, 542, 574, 600, 463, 603, 600, + 603, 603, 462, 604, 461, 604, 604, 630, 460, 605, + 630, 605, 605, 459, 458, 543, 604, 605, 457, 607, + 548, 607, 607, 545, 603, 456, 453, 546, 606, 547, + 606, 606, 452, 630, 451, 549, 606, 574, 450, 449, + + 608, 600, 608, 608, 609, 448, 609, 609, 608, 447, + 446, 610, 609, 610, 610, 611, 445, 611, 611, 610, + 444, 443, 612, 611, 612, 612, 613, 442, 613, 613, + 614, 441, 614, 614, 615, 440, 615, 615, 616, 439, + 616, 616, 617, 641, 617, 617, 641, 618, 612, 618, + 618, 613, 438, 437, 619, 618, 619, 619, 620, 631, + 620, 620, 631, 436, 639, 616, 620, 639, 621, 617, + 621, 621, 631, 622, 619, 622, 622, 623, 435, 623, + 623, 624, 434, 624, 624, 625, 433, 625, 625, 626, + 639, 626, 626, 627, 640, 627, 627, 640, 623, 628, + + 622, 628, 628, 629, 632, 629, 629, 632, 633, 432, + 642, 633, 632, 642, 635, 366, 633, 635, 624, 640, + 636, 626, 635, 636, 627, 365, 637, 638, 636, 637, + 638, 364, 363, 643, 637, 638, 643, 644, 645, 646, + 644, 645, 646, 362, 628, 359, 645, 647, 629, 648, + 647, 649, 648, 650, 649, 647, 650, 358, 651, 646, + 643, 651, 652, 357, 644, 652, 653, 655, 654, 653, + 655, 654, 656, 722, 650, 656, 722, 699, 649, 699, + 699, 700, 356, 700, 700, 699, 355, 354, 701, 700, + 701, 701, 353, 352, 702, 651, 702, 702, 653, 654, + + 703, 351, 703, 703, 704, 350, 704, 704, 705, 349, + 705, 705, 655, 706, 348, 706, 706, 656, 707, 347, + 707, 707, 708, 346, 708, 708, 707, 345, 344, 709, + 708, 709, 709, 710, 343, 710, 710, 709, 342, 341, + 711, 710, 711, 711, 712, 340, 712, 712, 713, 339, + 713, 713, 714, 338, 714, 714, 715, 712, 715, 715, + 714, 716, 331, 716, 716, 717, 326, 717, 717, 715, + 718, 325, 718, 718, 719, 720, 719, 719, 720, 721, + 323, 723, 721, 720, 723, 724, 725, 721, 724, 725, + 726, 727, 728, 726, 727, 728, 729, 322, 717, 729, + + 728, 321, 730, 716, 729, 730, 731, 318, 732, 731, + 730, 732, 718, 733, 731, 734, 733, 735, 734, 736, + 735, 737, 736, 316, 737, 735, 733, 738, 739, 315, + 738, 739, 736, 740, 763, 314, 740, 763, 766, 313, + 766, 766, 767, 312, 767, 767, 768, 311, 768, 768, + 769, 310, 769, 769, 770, 778, 770, 770, 778, 771, + 738, 771, 771, 737, 772, 779, 772, 772, 779, 309, + 739, 773, 772, 773, 773, 774, 308, 774, 774, 763, + 307, 305, 775, 774, 775, 775, 304, 776, 775, 776, + 776, 777, 780, 777, 777, 780, 781, 782, 783, 781, + + 782, 783, 784, 785, 786, 784, 785, 786, 787, 303, + 784, 787, 786, 788, 787, 789, 788, 793, 789, 798, + 793, 302, 798, 800, 777, 801, 800, 801, 801, 301, + 300, 802, 776, 802, 802, 803, 299, 803, 803, 804, + 298, 804, 804, 805, 295, 805, 805, 806, 789, 806, + 806, 807, 808, 809, 807, 808, 809, 810, 788, 220, + 810, 218, 793, 811, 798, 215, 811, 803, 800, 812, + 814, 817, 812, 814, 817, 214, 819, 212, 819, 819, + 820, 211, 820, 820, 804, 809, 209, 821, 805, 821, + 821, 822, 806, 822, 822, 823, 824, 825, 823, 824, + + 825, 826, 810, 831, 826, 831, 831, 204, 811, 819, + 830, 200, 830, 830, 812, 814, 817, 832, 833, 199, + 832, 833, 836, 837, 836, 836, 837, 840, 823, 840, + 840, 841, 821, 197, 841, 844, 822, 844, 844, 196, + 195, 192, 825, 844, 845, 190, 826, 845, 848, 830, + 848, 848, 845, 189, 849, 185, 832, 849, 183, 182, + 181, 180, 840, 179, 836, 837, 841, 851, 851, 851, + 851, 851, 851, 852, 852, 852, 852, 852, 852, 853, + 853, 853, 853, 853, 853, 854, 854, 854, 854, 854, + 854, 855, 855, 855, 855, 855, 855, 856, 856, 856, + + 856, 856, 856, 857, 857, 178, 857, 857, 857, 858, + 858, 858, 858, 858, 858, 859, 177, 176, 175, 859, + 859, 860, 860, 860, 860, 860, 860, 861, 861, 174, + 172, 861, 861, 862, 862, 862, 171, 862, 862, 863, + 863, 170, 863, 863, 863, 864, 864, 169, 864, 864, + 864, 865, 865, 168, 167, 166, 865, 866, 866, 165, + 866, 866, 866, 868, 868, 157, 151, 150, 868, 869, + 869, 869, 869, 869, 869, 870, 870, 147, 146, 145, + 870, 871, 871, 143, 871, 871, 871, 142, 139, 137, + 136, 135, 134, 133, 132, 130, 127, 124, 123, 118, + + 117, 116, 114, 113, 110, 108, 107, 106, 105, 104, + 103, 72, 69, 67, 66, 64, 62, 60, 57, 52, + 49, 46, 45, 40, 39, 38, 36, 35, 32, 30, + 29, 28, 27, 26, 25, 23, 19, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, + 850, 850, 850, 850, 850, 850 } ; -/* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[63] = - { 0, -0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, - 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, }; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +++yy_lp; \ +goto find_rule; \ +} #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "levcomp.lpp" +#define INITIAL 0 #line 2 "levcomp.lpp" // levcomp.lpp: @@ -1264,39 +1308,24 @@ static void settext(bool trim_right = false, int strip_trailing = 0) yylval.text = newstring; } - - - - - - - - -#line 1276 "levcomp.lex.cc" - -#define INITIAL 0 #define MAPDEF 1 + #define LUA 2 + #define LUA_ONELINER 3 + #define ARGUMENT 4 + #define MNAME 5 + #define KEYWORDS 6 -#define ITEM_LIST 7 -#define TOEOL 8 -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include <unistd.h> -#endif +#define ITEM_LIST 7 -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif +#define TOEOL 8 -static int yy_init_globals (void ); +#define YY_NEVER_INTERACTIVE 1 +#line 1329 "levcomp.lex.cc" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1304,30 +1333,65 @@ static int yy_init_globals (void ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap YY_PROTO(( void )); #else -extern int yywrap (void ); +extern int yywrap YY_PROTO(( void )); #endif #endif - static void yyunput (int c,char *buf_ptr ); - +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput YY_PROTO(( void )); #else -static int input (void ); +static int input YY_PROTO(( void )); +#endif #endif +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include <stdlib.h> +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif #endif /* Amount of stuff to slurp up with each read. */ @@ -1336,6 +1400,7 @@ static int input (void ); #endif /* Copy whatever the last rule matched to the standard output. */ + #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). @@ -1348,10 +1413,9 @@ static int input (void ); */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + if ( yy_current_buffer->yy_is_interactive ) \ { \ - int c = '*'; \ - size_t n; \ + int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1361,22 +1425,9 @@ static int input (void ); YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -1397,18 +1448,12 @@ static int input (void ); #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif -/* end tables serialization structures and prototypes */ - /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ +#define YY_DECL int yylex YY_PROTO(( void )) +#endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. @@ -1424,33 +1469,31 @@ extern int yylex (void); #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + yy_current_buffer->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION -/** The main scanner function which does all the work. - */ YY_DECL -{ + { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - + #line 89 "levcomp.lpp" -#line 1443 "levcomp.lex.cc" +#line 1486 "levcomp.lex.cc" - if ( !(yy_init) ) + if ( yy_init ) { - (yy_init) = 1; + yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ + if ( ! yy_start ) + yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; @@ -1458,77 +1501,79 @@ YY_DECL if ( ! yyout ) yyout = stdout; - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); - yy_load_buffer_state( ); + yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { - yy_cp = (yy_c_buf_p); + yy_cp = yy_c_buf_p; /* Support of yytext. */ - *yy_cp = (yy_hold_char); + *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; - yy_current_state = (yy_start); + yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 782 ) + if ( yy_current_state >= 851 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; ++yy_cp; } - while ( yy_current_state != 781 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); + while ( yy_base[yy_current_state] != 2138 ); yy_find_action: - yy_act = yy_accept[yy_current_state]; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + { + yy_full_match = yy_cp; + break; + } + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } YY_DO_BEFORE_ACTION; - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + if ( yy_act != YY_END_OF_BUFFER ) { int yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) - - yylineno++; -; + ++yylineno; } do_action: /* This label is used only to access EOF actions. */ + switch ( yy_act ) { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - case 1: YY_RULE_SETUP #line 91 "levcomp.lpp" @@ -1543,7 +1588,6 @@ YY_RULE_SETUP } YY_BREAK case 3: -/* rule 3 can match eol */ YY_RULE_SETUP #line 98 "levcomp.lpp" return CHARACTER; @@ -1559,22 +1603,21 @@ YY_RULE_SETUP return CHARACTER; YY_BREAK case 6: -/* rule 6 can match eol */ YY_RULE_SETUP #line 102 "levcomp.lpp" ; YY_BREAK case 7: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 104 "levcomp.lpp" { BEGIN(INITIAL); } YY_BREAK case 8: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 105 "levcomp.lpp" @@ -1593,14 +1636,13 @@ YY_RULE_SETUP } YY_BREAK case 10: -/* rule 10 can match eol */ YY_RULE_SETUP #line 114 "levcomp.lpp" ; YY_BREAK case 11: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 116 "levcomp.lpp" @@ -1610,7 +1652,6 @@ YY_RULE_SETUP } YY_BREAK case 12: -/* rule 12 can match eol */ YY_RULE_SETUP #line 120 "levcomp.lpp" { BEGIN(INITIAL); } @@ -1629,7 +1670,6 @@ YY_RULE_SETUP ; YY_BREAK case 15: -/* rule 15 can match eol */ YY_RULE_SETUP #line 128 "levcomp.lpp" { BEGIN(INITIAL); } @@ -1661,13 +1701,11 @@ YY_RULE_SETUP ; YY_BREAK case 20: -/* rule 20 can match eol */ YY_RULE_SETUP #line 142 "levcomp.lpp" { BEGIN(INITIAL); } YY_BREAK case 21: -/* rule 21 can match eol */ YY_RULE_SETUP #line 144 "levcomp.lpp" { BEGIN(INITIAL); } @@ -1700,14 +1738,13 @@ YY_RULE_SETUP } YY_BREAK case 26: -/* rule 26 can match eol */ YY_RULE_SETUP #line 160 "levcomp.lpp" { BEGIN(INITIAL); } YY_BREAK case 27: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 162 "levcomp.lpp" @@ -1717,8 +1754,8 @@ YY_RULE_SETUP } YY_BREAK case 28: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 167 "levcomp.lpp" @@ -1729,7 +1766,6 @@ YY_RULE_SETUP } YY_BREAK case 29: -/* rule 29 can match eol */ YY_RULE_SETUP #line 172 "levcomp.lpp" ; @@ -1740,8 +1776,8 @@ YY_RULE_SETUP ; YY_BREAK case 31: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 176 "levcomp.lpp" @@ -1830,118 +1866,132 @@ YY_RULE_SETUP case 48: YY_RULE_SETUP #line 197 "levcomp.lpp" -{ BEGIN(ITEM_LIST); return SUBST; } +{ BEGIN(ARGUMENT); return LFLAGS; } YY_BREAK case 49: YY_RULE_SETUP #line 198 "levcomp.lpp" -{ BEGIN(ITEM_LIST); return NSUBST; } +{ BEGIN(ARGUMENT); return BFLAGS; } YY_BREAK case 50: YY_RULE_SETUP #line 199 "levcomp.lpp" -{ BEGIN(MNAME); return MONS; } +{ BEGIN(ITEM_LIST); return SUBST; } YY_BREAK case 51: YY_RULE_SETUP #line 200 "levcomp.lpp" -{ BEGIN(ITEM_LIST); return ITEM; } +{ BEGIN(ITEM_LIST); return NSUBST; } YY_BREAK case 52: YY_RULE_SETUP #line 201 "levcomp.lpp" -{ BEGIN(TOEOL); return MARKER; } +{ BEGIN(MNAME); return MONS; } YY_BREAK case 53: YY_RULE_SETUP #line 202 "levcomp.lpp" -{ BEGIN(ITEM_LIST); return SHUFFLE; } +{ BEGIN(ITEM_LIST); return ITEM; } YY_BREAK case 54: YY_RULE_SETUP -#line 204 "levcomp.lpp" -{ BEGIN(ARGUMENT); return KFEAT; } +#line 203 "levcomp.lpp" +{ BEGIN(TOEOL); return MARKER; } YY_BREAK case 55: YY_RULE_SETUP -#line 205 "levcomp.lpp" -{ BEGIN(ARGUMENT); return KITEM; } +#line 204 "levcomp.lpp" +{ BEGIN(ITEM_LIST); return SHUFFLE; } YY_BREAK case 56: YY_RULE_SETUP #line 206 "levcomp.lpp" -{ BEGIN(ARGUMENT); return KMONS; } +{ BEGIN(ARGUMENT); return KFEAT; } YY_BREAK case 57: YY_RULE_SETUP +#line 207 "levcomp.lpp" +{ BEGIN(ARGUMENT); return KITEM; } + YY_BREAK +case 58: +YY_RULE_SETUP #line 208 "levcomp.lpp" +{ BEGIN(ARGUMENT); return KMONS; } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 209 "levcomp.lpp" +{ BEGIN(ARGUMENT); return KMASK; } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 211 "levcomp.lpp" return COMMA; YY_BREAK -case 58: +case 61: YY_RULE_SETUP -#line 210 "levcomp.lpp" +#line 213 "levcomp.lpp" { clean(); yylval.i = atoi(yytext); return INTEGER; } YY_BREAK -case 59: +case 62: YY_RULE_SETUP -#line 216 "levcomp.lpp" +#line 219 "levcomp.lpp" ; YY_BREAK -case 60: -/* rule 60 can match eol */ +case 63: YY_RULE_SETUP -#line 217 "levcomp.lpp" +#line 220 "levcomp.lpp" ; YY_BREAK -case 61: +case 64: YY_RULE_SETUP -#line 218 "levcomp.lpp" +#line 221 "levcomp.lpp" return CHARACTER; YY_BREAK -case 62: +case 65: YY_RULE_SETUP -#line 220 "levcomp.lpp" +#line 223 "levcomp.lpp" ECHO; YY_BREAK -#line 1911 "levcomp.lex.cc" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(MAPDEF): -case YY_STATE_EOF(LUA): -case YY_STATE_EOF(LUA_ONELINER): -case YY_STATE_EOF(ARGUMENT): -case YY_STATE_EOF(MNAME): -case YY_STATE_EOF(KEYWORDS): -case YY_STATE_EOF(ITEM_LIST): -case YY_STATE_EOF(TOEOL): - yyterminate(); +#line 1961 "levcomp.lex.cc" + case YY_STATE_EOF(INITIAL): + case YY_STATE_EOF(MAPDEF): + case YY_STATE_EOF(LUA): + case YY_STATE_EOF(LUA_ONELINER): + case YY_STATE_EOF(ARGUMENT): + case YY_STATE_EOF(MNAME): + case YY_STATE_EOF(KEYWORDS): + case YY_STATE_EOF(ITEM_LIST): + case YY_STATE_EOF(TOEOL): + yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); + *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our + * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position @@ -1951,13 +2001,13 @@ case YY_STATE_EOF(TOEOL): * end-of-buffer state). Contrast this with the test * in input(). */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -1970,31 +2020,30 @@ case YY_STATE_EOF(TOEOL): yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); + yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); + yy_cp = yy_c_buf_p; goto yy_find_action; } } - else switch ( yy_get_next_buffer( ) ) + else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { - (yy_did_buffer_switch_on_eof) = 0; + yy_did_buffer_switch_on_eof = 0; - if ( yywrap( ) ) + if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -2005,7 +2054,7 @@ case YY_STATE_EOF(TOEOL): * YY_NULL, it'll still work - another * YY_NULL will get returned. */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; @@ -2013,30 +2062,30 @@ case YY_STATE_EOF(TOEOL): else { - if ( ! (yy_did_buffer_switch_on_eof) ) + if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; - yy_current_state = yy_get_previous_state( ); + yy_current_state = yy_get_previous_state(); - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; @@ -2047,7 +2096,8 @@ case YY_STATE_EOF(TOEOL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -} /* end of yylex */ + } /* end of yylex */ + /* yy_get_next_buffer - try to read in a new buffer * @@ -2056,20 +2106,21 @@ case YY_STATE_EOF(TOEOL): * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ -static int yy_get_next_buffer (void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; register int number_to_move, i; int ret_val; - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. @@ -2089,30 +2140,34 @@ static int yy_get_next_buffer (void) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); + (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { @@ -2125,7 +2180,8 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -2135,35 +2191,35 @@ static int yy_get_next_buffer (void) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; - +#endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + yy_current_buffer->yy_n_chars = yy_n_chars; } - if ( (yy_n_chars) == 0 ) + if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } @@ -2171,142 +2227,149 @@ static int yy_get_next_buffer (void) else ret_val = EOB_ACT_CONTINUE_SCAN; - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; -} + } + /* yy_get_previous_state - get the state just before the EOB char was reached */ - static yy_state_type yy_get_previous_state (void) -{ +static yy_state_type yy_get_previous_state() + { register yy_state_type yy_current_state; register char *yy_cp; - - yy_current_state = (yy_start); + + yy_current_state = yy_start; yy_current_state += YY_AT_BOL(); + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 782 ) + if ( yy_current_state >= 851 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; } return yy_current_state; -} + } + /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 782 ) + if ( yy_current_state >= 851 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 781); + yy_is_jam = (yy_current_state == 850); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; -} + } - static void yyunput (int c, register char * yy_bp ) -{ - register char *yy_cp; - - yy_cp = (yy_c_buf_p); + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ - *yy_cp = (yy_hold_char); + *yy_cp = yy_hold_char; - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + &yy_current_buffer->yy_ch_buf[number_to_move]; - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; - if ( c == '\n' ){ - --yylineno; - } + if ( c == '\n' ) + --yylineno; + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} -#ifndef YY_NO_INPUT #ifdef __cplusplus - static int yyinput (void) +static int yyinput() #else - static int input (void) +static int input() #endif - -{ + { int c; - - *(yy_c_buf_p) = (yy_hold_char); - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; + *yy_c_buf_p = '\0'; else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; - switch ( yy_get_next_buffer( ) ) + switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() @@ -2320,16 +2383,16 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - yyrestart(yyin ); + yyrestart( yyin ); - /*FALLTHROUGH*/ + /* fall through */ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) + if ( yywrap() ) return EOF; - if ( ! (yy_did_buffer_switch_on_eof) ) + if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); @@ -2339,98 +2402,93 @@ static int yy_get_next_buffer (void) } case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; + yy_c_buf_p = yytext_ptr + offset; break; } } } - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol ) - - yylineno++; -; + yy_current_buffer->yy_at_bol = (c == '\n'); + if ( yy_current_buffer->yy_at_bol ) + ++yylineno; return c; -} -#endif /* ifndef YY_NO_INPUT */ + } -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); -} -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) return; - if ( YY_CURRENT_BUFFER ) + if ( yy_current_buffer ) { /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; } - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_current_buffer = new_buffer; + yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ - (yy_did_buffer_switch_on_eof) = 1; -} + yy_did_buffer_switch_on_eof = 1; + } -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -2439,71 +2497,80 @@ static void yy_load_buffer_state (void) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; -} + } -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { if ( ! b ) return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yy_flex_free( (void *) b->yy_ch_buf ); - yyfree((void *) b ); -} + yy_flex_free( (void *) b ); + } -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) -{ - int oerrno = errno; - - yy_flush_buffer(b ); +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } - b->yy_is_interactive = 0; - - errno = oerrno; -} -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) return; b->yy_n_chars = 0; @@ -2520,121 +2587,29 @@ static void yy_load_buffer_state (void) b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - int num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; + if ( b == yy_current_buffer ) + yy_load_buffer_state(); } - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); @@ -2648,51 +2623,56 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer(b ); + yy_switch_to_buffer( b ); return b; -} + } +#endif -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) -{ - - return yy_scan_bytes(yystr,strlen(yystr) ); -} -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) -{ +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); + n = len + 2; + buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer(buf,n ); + b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); @@ -2702,199 +2682,148 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) b->yy_is_our_buffer = 1; return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 + } #endif -static void yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; -/* Accessor methods (get/set functions) to struct members. */ + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} + yy_start_stack[yy_start_stack_ptr++] = YY_START; -/** Get the current token. - * - */ + BEGIN(new_state); + } +#endif -char *yyget_text (void) -{ - return yytext; -} -/** Set the current line number. - * @param line_number - * - */ -void yyset_lineno (int line_number ) -{ - - yylineno = line_number; -} +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * in_str ) -{ - yyin = in_str ; -} + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif -void yyset_out (FILE * out_str ) -{ - yyout = out_str ; -} -int yyget_debug (void) -{ - return yy_flex_debug; -} +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif -void yyset_debug (int bdebug ) -{ - yy_flex_debug = bdebug ; -} +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - /* We do not touch yylineno unless the option is enabled. */ - yylineno = 1; - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) #else - yyin = (FILE *) 0; - yyout = (FILE *) 0; +static void yy_fatal_error( msg ) +char msg[]; #endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; +/* Redefine yyless() so it works in section 3 code. */ - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) - return 0; -} -/* - * Internal utility routines. - */ +/* Internal utility routines. */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; -} + } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { register int n; for ( n = 0; s[n]; ++n ) ; return n; -} + } #endif -void *yyalloc (yy_size_t size ) -{ + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { return (void *) malloc( size ); -} + } -void *yyrealloc (void * ptr, yy_size_t size ) -{ +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2903,17 +2832,26 @@ void *yyrealloc (void * ptr, yy_size_t size ) * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" + } -#line 220 "levcomp.lpp" +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 223 "levcomp.lpp" int yywrap() @@ -2922,4 +2860,3 @@ int yywrap() flush_free_queue(0); return 1; } - diff --git a/crawl-ref/source/prebuilt/levcomp.tab.cc b/crawl-ref/source/prebuilt/levcomp.tab.cc index 27a769fedc..51821c1205 100644 --- a/crawl-ref/source/prebuilt/levcomp.tab.cc +++ b/crawl-ref/source/prebuilt/levcomp.tab.cc @@ -1,9 +1,7 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 2.0. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,24 +15,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -46,9 +36,6 @@ /* Identify Bison output. */ #define YYBISON 1 -/* Bison version. */ -#define YYBISON_VERSION "2.3" - /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -73,31 +60,33 @@ KFEAT = 262, KITEM = 263, KMONS = 264, - NAME = 265, - DEPTH = 266, - ORIENT = 267, - PLACE = 268, - CHANCE = 269, - MONS = 270, - ITEM = 271, - MARKER = 272, - PRELUDE = 273, - MAIN = 274, - VALIDATE = 275, - VETO = 276, - NSUBST = 277, - WELCOME = 278, - COMMA = 279, - INTEGER = 280, - CHARACTER = 281, - STRING = 282, - MAP_LINE = 283, - MONSTER_NAME = 284, - ITEM_INFO = 285, - LUA_LINE = 286 + KMASK = 265, + NAME = 266, + DEPTH = 267, + ORIENT = 268, + PLACE = 269, + CHANCE = 270, + MONS = 271, + ITEM = 272, + MARKER = 273, + PRELUDE = 274, + MAIN = 275, + VALIDATE = 276, + VETO = 277, + NSUBST = 278, + WELCOME = 279, + LFLAGS = 280, + BFLAGS = 281, + COMMA = 282, + INTEGER = 283, + CHARACTER = 284, + STRING = 285, + MAP_LINE = 286, + MONSTER_NAME = 287, + ITEM_INFO = 288, + LUA_LINE = 289 }; #endif -/* Tokens. */ #define DEFAULT_DEPTH 258 #define SHUFFLE 259 #define SUBST 260 @@ -105,28 +94,31 @@ #define KFEAT 262 #define KITEM 263 #define KMONS 264 -#define NAME 265 -#define DEPTH 266 -#define ORIENT 267 -#define PLACE 268 -#define CHANCE 269 -#define MONS 270 -#define ITEM 271 -#define MARKER 272 -#define PRELUDE 273 -#define MAIN 274 -#define VALIDATE 275 -#define VETO 276 -#define NSUBST 277 -#define WELCOME 278 -#define COMMA 279 -#define INTEGER 280 -#define CHARACTER 281 -#define STRING 282 -#define MAP_LINE 283 -#define MONSTER_NAME 284 -#define ITEM_INFO 285 -#define LUA_LINE 286 +#define KMASK 265 +#define NAME 266 +#define DEPTH 267 +#define ORIENT 268 +#define PLACE 269 +#define CHANCE 270 +#define MONS 271 +#define ITEM 272 +#define MARKER 273 +#define PRELUDE 274 +#define MAIN 275 +#define VALIDATE 276 +#define VETO 277 +#define NSUBST 278 +#define WELCOME 279 +#define LFLAGS 280 +#define BFLAGS 281 +#define COMMA 282 +#define INTEGER 283 +#define CHARACTER 284 +#define STRING 285 +#define MAP_LINE 286 +#define MONSTER_NAME 287 +#define ITEM_INFO 288 +#define LUA_LINE 289 @@ -190,22 +182,15 @@ level_range set_range(const char *s, int start, int end) # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 46 "levcomp.ypp" -{ +typedef union YYSTYPE { int i; const char *text; raw_range range; -} -/* Line 193 of yacc.c. */ -#line 208 "levcomp.tab.c" - YYSTYPE; +} YYSTYPE; +/* Line 185 of yacc.c. */ +#line 194 "levcomp.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -216,94 +201,17 @@ typedef union YYSTYPE /* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 221 "levcomp.tab.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif +/* Line 213 of yacc.c. */ +#line 206 "levcomp.tab.c" -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif +#if ! defined (yyoverflow) || YYERROR_VERBOSE -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int +# ifndef YYFREE +# define YYFREE free # endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid +# ifndef YYMALLOC +# define YYMALLOC malloc # endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -311,76 +219,34 @@ YYID (i) # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) +# if defined (__STDC__) || defined (__cplusplus) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif +# define YYSIZE_T size_t # endif +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE # endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; + short int yyss; YYSTYPE yyvs; }; @@ -390,24 +256,24 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ +# if defined (__GNUC__) && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ - YYSIZE_T yyi; \ + register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif @@ -425,33 +291,39 @@ union yyalloc yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (YYID (0)) + while (0) #endif -/* YYFINAL -- State number of the termination state. */ +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short int yysigned_char; +#endif + +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 58 +#define YYLAST 64 -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 32 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 61 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 105 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 119 +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 35 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 64 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 112 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 128 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 286 +#define YYMAXUTOK 289 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = +static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -481,204 +353,212 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31 + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const yytype_uint8 yyprhs[] = +static const unsigned short int yyprhs[] = { 0, 0, 3, 5, 6, 9, 11, 13, 15, 17, 19, 22, 25, 26, 29, 31, 33, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, - 62, 64, 66, 68, 70, 72, 74, 76, 79, 80, - 83, 85, 88, 89, 92, 94, 97, 98, 101, 103, - 106, 107, 110, 112, 115, 116, 119, 121, 123, 126, - 128, 131, 133, 136, 139, 141, 145, 147, 150, 151, - 154, 156, 157, 161, 163, 164, 167, 169, 172, 174, - 178, 180, 183, 185, 189, 191, 193, 196, 200, 202, - 204, 206, 209, 213, 215, 217, 220, 222, 225, 228, - 230, 233, 236, 238, 241, 243 + 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, + 82, 85, 86, 89, 91, 94, 95, 98, 100, 103, + 104, 107, 109, 112, 113, 116, 118, 121, 122, 125, + 127, 129, 132, 134, 137, 139, 142, 144, 147, 150, + 152, 156, 158, 161, 162, 165, 167, 170, 173, 174, + 178, 180, 181, 184, 186, 189, 191, 195, 197, 200, + 202, 206, 208, 210, 213, 217, 219, 221, 223, 226, + 230, 232, 234, 237, 239, 242, 245, 247, 250, 253, + 255, 258, 260 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yysigned_char yyrhs[] = { - 33, 0, -1, 34, -1, -1, 34, 35, -1, 37, - -1, 39, -1, 26, -1, 38, -1, 44, -1, 3, - 27, -1, 42, 40, -1, -1, 40, 41, -1, 43, - -1, 90, -1, 10, 27, -1, 85, -1, 86, -1, - 87, -1, 88, -1, 89, -1, 82, -1, 79, -1, - 68, -1, 76, -1, 73, -1, 62, -1, 65, -1, - 59, -1, 61, -1, 60, -1, 47, -1, 56, -1, - 50, -1, 53, -1, 36, -1, 19, 45, -1, -1, - 45, 46, -1, 31, -1, 19, 48, -1, -1, 48, - 49, -1, 31, -1, 20, 51, -1, -1, 51, 52, - -1, 31, -1, 21, 54, -1, -1, 54, 55, -1, - 31, -1, 18, 57, -1, -1, 57, 58, -1, 31, - -1, 7, -1, 7, 27, -1, 9, -1, 9, 27, - -1, 8, -1, 8, 27, -1, 4, 63, -1, 64, - -1, 63, 24, 64, -1, 30, -1, 6, 66, -1, - -1, 66, 67, -1, 27, -1, -1, 17, 69, 70, - -1, 71, -1, -1, 71, 72, -1, 27, -1, 22, - 74, -1, 75, -1, 74, 24, 75, -1, 30, -1, - 5, 77, -1, 78, -1, 78, 24, 77, -1, 30, - -1, 16, -1, 16, 80, -1, 80, 24, 81, -1, - 81, -1, 30, -1, 15, -1, 15, 83, -1, 84, - 24, 83, -1, 84, -1, 29, -1, 13, 27, -1, - 11, -1, 11, 27, -1, 14, 25, -1, 12, -1, - 12, 27, -1, 23, 27, -1, 91, -1, 91, 92, - -1, 92, -1, 28, -1 + 36, 0, -1, 37, -1, -1, 37, 38, -1, 40, + -1, 42, -1, 29, -1, 41, -1, 47, -1, 3, + 30, -1, 45, 43, -1, -1, 43, 44, -1, 46, + -1, 96, -1, 11, 30, -1, 91, -1, 92, -1, + 93, -1, 94, -1, 95, -1, 88, -1, 85, -1, + 74, -1, 82, -1, 79, -1, 66, -1, 69, -1, + 72, -1, 73, -1, 62, -1, 64, -1, 63, -1, + 65, -1, 50, -1, 59, -1, 53, -1, 56, -1, + 39, -1, 20, 48, -1, -1, 48, 49, -1, 34, + -1, 20, 51, -1, -1, 51, 52, -1, 34, -1, + 21, 54, -1, -1, 54, 55, -1, 34, -1, 22, + 57, -1, -1, 57, 58, -1, 34, -1, 19, 60, + -1, -1, 60, 61, -1, 34, -1, 7, -1, 7, + 30, -1, 9, -1, 9, 30, -1, 8, -1, 8, + 30, -1, 10, -1, 10, 30, -1, 4, 67, -1, + 68, -1, 67, 27, 68, -1, 33, -1, 6, 70, + -1, -1, 70, 71, -1, 30, -1, 25, 30, -1, + 26, 30, -1, -1, 18, 75, 76, -1, 77, -1, + -1, 77, 78, -1, 30, -1, 23, 80, -1, 81, + -1, 80, 27, 81, -1, 33, -1, 5, 83, -1, + 84, -1, 84, 27, 83, -1, 33, -1, 17, -1, + 17, 86, -1, 86, 27, 87, -1, 87, -1, 33, + -1, 16, -1, 16, 89, -1, 90, 27, 89, -1, + 90, -1, 32, -1, 14, 30, -1, 12, -1, 12, + 30, -1, 15, 28, -1, 13, -1, 13, 30, -1, + 24, 30, -1, 97, -1, 97, 98, -1, 98, -1, + 31, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = +static const unsigned short int yyrline[] = { 0, 66, 66, 69, 70, 73, 74, 77, 83, 84, 87, 97, 119, 120, 123, 124, 127, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 173, 175, 176, - 179, 184, 186, 187, 190, 195, 197, 198, 201, 206, - 208, 209, 212, 217, 219, 220, 223, 228, 229, 237, - 238, 246, 247, 255, 258, 259, 262, 270, 273, 274, - 277, 287, 286, 297, 299, 300, 303, 315, 318, 319, - 322, 331, 334, 335, 338, 347, 348, 351, 352, 355, - 363, 364, 367, 368, 371, 380, 389, 390, 399, 407, - 408, 417, 426, 429, 430, 433 + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 176, 178, 179, 182, 187, 189, 190, 193, 198, 200, + 201, 204, 209, 211, 212, 215, 220, 222, 223, 226, + 231, 232, 240, 241, 249, 250, 258, 259, 267, 270, + 271, 274, 282, 285, 286, 289, 298, 307, 317, 316, + 327, 329, 330, 333, 345, 348, 349, 352, 361, 364, + 365, 368, 377, 378, 381, 382, 385, 393, 394, 397, + 398, 401, 410, 419, 420, 429, 437, 438, 447, 456, + 459, 460, 463 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +#if YYDEBUG || YYERROR_VERBOSE +/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "DEFAULT_DEPTH", "SHUFFLE", "SUBST", - "TAGS", "KFEAT", "KITEM", "KMONS", "NAME", "DEPTH", "ORIENT", "PLACE", - "CHANCE", "MONS", "ITEM", "MARKER", "PRELUDE", "MAIN", "VALIDATE", - "VETO", "NSUBST", "WELCOME", "COMMA", "INTEGER", "CHARACTER", "STRING", - "MAP_LINE", "MONSTER_NAME", "ITEM_INFO", "LUA_LINE", "$accept", "file", - "definitions", "definition", "error_seq", "def", "defdepth", "level", - "map_specs", "map_spec", "name", "metaline", "global_lua", - "global_lua_lines", "global_lua_line", "main_lua", "main_lua_lines", - "main_lua_line", "validate_lua", "validate_lua_lines", - "validate_lua_line", "veto_lua", "veto_lua_lines", "veto_lua_line", - "prelude_lua", "prelude_lua_lines", "prelude_lua_line", "kfeat", "kmons", - "kitem", "shuffle", "shuffle_specifiers", "shuffle_spec", "tags", - "tagstrings", "tagstring", "marker", "@1", "marker_spec", - "mspec_segments", "mspec_segment", "nsubst", "nsubst_specifiers", - "nsubst_spec", "subst", "subst_specifiers", "subst_spec", "items", - "item_specifiers", "item_specifier", "mons", "mnames", "mname", "place", - "depth", "chance", "orientation", "welcome", "map_def", "map_lines", - "map_line", 0 + "TAGS", "KFEAT", "KITEM", "KMONS", "KMASK", "NAME", "DEPTH", "ORIENT", + "PLACE", "CHANCE", "MONS", "ITEM", "MARKER", "PRELUDE", "MAIN", + "VALIDATE", "VETO", "NSUBST", "WELCOME", "LFLAGS", "BFLAGS", "COMMA", + "INTEGER", "CHARACTER", "STRING", "MAP_LINE", "MONSTER_NAME", + "ITEM_INFO", "LUA_LINE", "$accept", "file", "definitions", "definition", + "error_seq", "def", "defdepth", "level", "map_specs", "map_spec", "name", + "metaline", "global_lua", "global_lua_lines", "global_lua_line", + "main_lua", "main_lua_lines", "main_lua_line", "validate_lua", + "validate_lua_lines", "validate_lua_line", "veto_lua", "veto_lua_lines", + "veto_lua_line", "prelude_lua", "prelude_lua_lines", "prelude_lua_line", + "kfeat", "kmons", "kitem", "kmask", "shuffle", "shuffle_specifiers", + "shuffle_spec", "tags", "tagstrings", "tagstring", "lflags", "bflags", + "marker", "@1", "marker_spec", "mspec_segments", "mspec_segment", + "nsubst", "nsubst_specifiers", "nsubst_spec", "subst", + "subst_specifiers", "subst_spec", "items", "item_specifiers", + "item_specifier", "mons", "mnames", "mname", "place", "depth", "chance", + "orientation", "welcome", "map_def", "map_lines", "map_line", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = +static const unsigned short int yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286 + 285, 286, 287, 288, 289 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +static const unsigned char yyr1[] = { - 0, 32, 33, 34, 34, 35, 35, 36, 37, 37, - 38, 39, 40, 40, 41, 41, 42, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 44, 45, 45, - 46, 47, 48, 48, 49, 50, 51, 51, 52, 53, - 54, 54, 55, 56, 57, 57, 58, 59, 59, 60, - 60, 61, 61, 62, 63, 63, 64, 65, 66, 66, - 67, 69, 68, 70, 71, 71, 72, 73, 74, 74, - 75, 76, 77, 77, 78, 79, 79, 80, 80, 81, - 82, 82, 83, 83, 84, 85, 86, 86, 87, 88, - 88, 89, 90, 91, 91, 92 + 0, 35, 36, 37, 37, 38, 38, 39, 40, 40, + 41, 42, 43, 43, 44, 44, 45, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 47, 48, 48, 49, 50, 51, 51, 52, 53, 54, + 54, 55, 56, 57, 57, 58, 59, 60, 60, 61, + 62, 62, 63, 63, 64, 64, 65, 65, 66, 67, + 67, 68, 69, 70, 70, 71, 72, 73, 75, 74, + 76, 77, 77, 78, 79, 80, 80, 81, 82, 83, + 83, 84, 85, 85, 86, 86, 87, 88, 88, 89, + 89, 90, 91, 92, 92, 93, 94, 94, 95, 96, + 97, 97, 98 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +static const unsigned char yyr2[] = { 0, 2, 1, 0, 2, 1, 1, 1, 1, 1, 2, 2, 0, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 0, 2, - 1, 2, 0, 2, 1, 2, 0, 2, 1, 2, - 0, 2, 1, 2, 0, 2, 1, 1, 2, 1, - 2, 1, 2, 2, 1, 3, 1, 2, 0, 2, - 1, 0, 3, 1, 0, 2, 1, 2, 1, 3, - 1, 2, 1, 3, 1, 1, 2, 3, 1, 1, - 1, 2, 3, 1, 1, 2, 1, 2, 2, 1, - 2, 2, 1, 2, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 0, 2, 1, 2, 0, 2, 1, 2, 0, + 2, 1, 2, 0, 2, 1, 2, 0, 2, 1, + 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, + 3, 1, 2, 0, 2, 1, 2, 2, 0, 3, + 1, 0, 2, 1, 2, 1, 3, 1, 2, 1, + 3, 1, 1, 2, 3, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, + 2, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const yytype_uint8 yydefact[] = +static const unsigned char yydefact[] = { - 3, 0, 2, 1, 0, 0, 38, 4, 5, 8, - 6, 12, 9, 10, 16, 37, 11, 40, 39, 0, - 0, 68, 57, 61, 59, 96, 99, 0, 0, 90, - 85, 71, 54, 42, 46, 50, 0, 0, 7, 105, - 36, 13, 14, 32, 34, 35, 33, 29, 31, 30, - 27, 28, 24, 26, 25, 23, 22, 17, 18, 19, - 20, 21, 15, 102, 104, 66, 63, 64, 84, 81, - 82, 67, 58, 62, 60, 97, 100, 95, 98, 94, - 91, 93, 89, 86, 88, 74, 53, 41, 45, 49, - 80, 77, 78, 101, 103, 0, 0, 70, 69, 0, - 0, 72, 73, 56, 55, 44, 43, 48, 47, 52, - 51, 0, 65, 83, 92, 87, 76, 75, 79 + 3, 0, 2, 1, 0, 0, 41, 4, 5, 8, + 6, 12, 9, 10, 16, 40, 11, 43, 42, 0, + 0, 73, 60, 64, 62, 66, 103, 106, 0, 0, + 97, 92, 78, 57, 45, 49, 53, 0, 0, 0, + 0, 7, 112, 39, 13, 14, 35, 37, 38, 36, + 31, 33, 32, 34, 27, 28, 29, 30, 24, 26, + 25, 23, 22, 17, 18, 19, 20, 21, 15, 109, + 111, 71, 68, 69, 91, 88, 89, 72, 61, 65, + 63, 67, 104, 107, 102, 105, 101, 98, 100, 96, + 93, 95, 81, 56, 44, 48, 52, 87, 84, 85, + 108, 76, 77, 110, 0, 0, 75, 74, 0, 0, + 79, 80, 59, 58, 47, 46, 51, 50, 55, 54, + 0, 70, 90, 99, 94, 83, 82, 86 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yysigned_char yydefgoto[] = { - -1, 1, 2, 7, 40, 8, 9, 10, 16, 41, - 11, 42, 12, 15, 18, 43, 87, 106, 44, 88, - 108, 45, 89, 110, 46, 86, 104, 47, 48, 49, - 50, 66, 67, 51, 71, 98, 52, 85, 101, 102, - 117, 53, 91, 92, 54, 69, 70, 55, 83, 84, - 56, 80, 81, 57, 58, 59, 60, 61, 62, 63, - 64 + -1, 1, 2, 7, 43, 8, 9, 10, 16, 44, + 11, 45, 12, 15, 18, 46, 94, 115, 47, 95, + 117, 48, 96, 119, 49, 93, 113, 50, 51, 52, + 53, 54, 72, 73, 55, 77, 107, 56, 57, 58, + 92, 110, 111, 126, 59, 98, 99, 60, 75, 76, + 61, 90, 91, 62, 87, 88, 63, 64, 65, 66, + 67, 68, 69, 70 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -64 -static const yytype_int8 yypact[] = +#define YYPACT_NINF -68 +static const yysigned_char yypact[] = { - -64, 6, 17, -64, -6, -2, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -8, -4, -64, -64, -1, - 0, -64, 1, 4, 5, 7, 8, 10, 13, -3, - 3, -64, -64, -64, -64, -64, 9, 14, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, 12, -64, -64, 18, -64, -64, -64, - 19, 20, -64, -64, -64, -64, -64, -64, -64, -64, - -64, 21, -64, 22, -64, -64, 23, 24, 25, 26, - -64, 27, -64, -64, -64, -1, 0, -64, -64, -3, - 3, -64, 31, -64, -64, -64, -64, -64, -64, -64, - -64, 9, -64, -64, -64, -64, -64, -64, -64 + -68, 7, 20, -68, -6, -2, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -8, -4, -68, -68, -3, + -1, -68, 3, 4, 5, 6, 8, 9, 11, 1, + 10, 12, -68, -68, -68, -68, -68, 13, 14, 17, + 18, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, 19, + -68, -68, 16, -68, -68, -68, 22, 21, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, 25, -68, + 26, -68, -68, 23, 24, 27, 28, -68, 29, -68, + -68, -68, -68, -68, -3, -1, -68, -68, 10, 12, + -68, 30, -68, -68, -68, -68, -68, -68, -68, -68, + 13, -68, -68, -68, -68, -68, -68, -68 }; /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = +static const yysigned_char yypgoto[] = { - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -51, -64, -64, -64, -64, -64, -64, -64, - -64, -64, -64, -63, -64, -47, -64, -64, -64, -50, - -64, -46, -64, -64, -64, -64, -64, -64, -64, -64, - -11 + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -67, -68, -68, -68, -68, -68, -68, + -68, -68, -68, -68, -68, -68, -66, -68, -50, -68, + -68, -68, -46, -68, -49, -68, -68, -68, -68, -68, + -68, -68, -68, -5 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -686,44 +566,63 @@ static const yytype_int8 yypgoto[] = number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 -static const yytype_uint8 yytable[] = +static const unsigned char yytable[] = { - 19, 20, 21, 22, 23, 24, 3, 25, 26, 27, + 19, 20, 21, 22, 23, 24, 25, 3, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 4, 13, 38, 17, 39, 14, 79, 5, 72, 65, - 68, 73, 74, 82, 75, 76, 6, 77, 78, 90, - 39, 93, 95, 96, 112, 99, 100, 97, 118, 113, - 115, 111, 94, 114, 103, 105, 107, 109, 116 + 38, 39, 40, 4, 13, 41, 17, 42, 14, 85, + 71, 5, 74, 78, 79, 80, 81, 121, 82, 83, + 6, 84, 86, 104, 100, 89, 97, 101, 102, 105, + 42, 106, 108, 109, 127, 122, 120, 112, 114, 123, + 125, 116, 118, 124, 103 }; -static const yytype_uint8 yycheck[] = +static const unsigned char yycheck[] = { - 4, 5, 6, 7, 8, 9, 0, 11, 12, 13, + 4, 5, 6, 7, 8, 9, 10, 0, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 3, 27, 26, 31, 28, 27, 29, 10, 27, 30, - 30, 27, 27, 30, 27, 27, 19, 27, 25, 30, - 28, 27, 24, 24, 95, 24, 24, 27, 111, 96, - 100, 24, 63, 99, 31, 31, 31, 31, 27 + 24, 25, 26, 3, 30, 29, 34, 31, 30, 28, + 33, 11, 33, 30, 30, 30, 30, 104, 30, 30, + 20, 30, 32, 27, 30, 33, 33, 30, 30, 27, + 31, 30, 27, 27, 120, 105, 27, 34, 34, 108, + 30, 34, 34, 109, 69 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +static const unsigned char yystos[] = { - 0, 33, 34, 0, 3, 10, 19, 35, 37, 38, - 39, 42, 44, 27, 27, 45, 40, 31, 46, 4, - 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 26, 28, - 36, 41, 43, 47, 50, 53, 56, 59, 60, 61, - 62, 65, 68, 73, 76, 79, 82, 85, 86, 87, - 88, 89, 90, 91, 92, 30, 63, 64, 30, 77, - 78, 66, 27, 27, 27, 27, 27, 27, 25, 29, - 83, 84, 30, 80, 81, 69, 57, 48, 51, 54, - 30, 74, 75, 27, 92, 24, 24, 27, 67, 24, - 24, 70, 71, 31, 58, 31, 49, 31, 52, 31, - 55, 24, 64, 77, 83, 81, 27, 72, 75 + 0, 36, 37, 0, 3, 11, 20, 38, 40, 41, + 42, 45, 47, 30, 30, 48, 43, 34, 49, 4, + 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 29, 31, 39, 44, 46, 50, 53, 56, 59, + 62, 63, 64, 65, 66, 69, 72, 73, 74, 79, + 82, 85, 88, 91, 92, 93, 94, 95, 96, 97, + 98, 33, 67, 68, 33, 83, 84, 70, 30, 30, + 30, 30, 30, 30, 30, 28, 32, 89, 90, 33, + 86, 87, 75, 60, 51, 54, 57, 33, 80, 81, + 30, 30, 30, 98, 27, 27, 30, 71, 27, 27, + 76, 77, 34, 61, 34, 52, 34, 55, 34, 58, + 27, 68, 83, 89, 87, 30, 78, 81 }; +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# if defined (__STDC__) || defined (__cplusplus) +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -749,15 +648,15 @@ do \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ + YYPOPSTACK; \ goto yybackup; \ } \ else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ + { \ + yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ -while (YYID (0)) +while (0) #define YYTERROR 1 @@ -772,7 +671,7 @@ while (YYID (0)) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ - if (YYID (N)) \ + if (N) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ @@ -786,7 +685,7 @@ while (YYID (0)) (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ - while (YYID (0)) + while (0) #endif @@ -798,8 +697,8 @@ while (YYID (0)) # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif @@ -826,96 +725,36 @@ while (YYID (0)) do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +} while (0) -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +yy_stack_print (short int *bottom, short int *top) #else static void yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; + short int *bottom; + short int *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) + for (/* Nothing. */; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -924,45 +763,37 @@ yy_stack_print (bottom, top) do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +yy_reduce_print (int yyrule) #else static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; +yy_reduce_print (yyrule) int yyrule; #endif { - int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } + unsigned int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", + yyrule - 1, yylno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) + yy_reduce_print (Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -984,7 +815,7 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH @@ -996,47 +827,45 @@ int yydebug; #if YYERROR_VERBOSE # ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H +# if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -#else -static YYSIZE_T +# else yystrlen (yystr) - const char *yystr; -#endif + const char *yystr; +# endif { - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) + register const char *yys = yystr; + + while (*yys++ != '\0') continue; - return yylen; + + return yys - yystr - 1; } # endif # endif # ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * +# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -#else -static char * +# else yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif + char *yydest; + const char *yysrc; +# endif { - char *yyd = yydest; - const char *yys = yysrc; + register char *yyd = yydest; + register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -1046,171 +875,53 @@ yystpcpy (yydest, yysrc) # endif # endif -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } +#endif /* !YYERROR_VERBOSE */ - if (! yyres) - return yystrlen (yystr); + - return yystpcpy (yyres, yystr) - yyres; -} -# endif +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +#if defined (__STDC__) || defined (__cplusplus) +static void +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) +#else +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; +#endif { - int yyn = yypact[yystate]; + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; + switch (yytype) + { + default: + break; } + YYFPRINTF (yyoutput, ")"); } -#endif /* YYERROR_VERBOSE */ - +#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else @@ -1221,7 +932,8 @@ yydestruct (yymsg, yytype, yyvaluep) YYSTYPE *yyvaluep; #endif { - YYUSE (yyvaluep); + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; if (!yymsg) yymsg = "Deleting"; @@ -1231,7 +943,7 @@ yydestruct (yymsg, yytype, yyvaluep) { default: - break; + break; } } @@ -1239,13 +951,13 @@ yydestruct (yymsg, yytype, yyvaluep) /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus +# if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); -#else +# else int yyparse (); -#endif +# endif #else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus +#if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); @@ -1270,18 +982,14 @@ int yynerrs; `----------*/ #ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif #else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +#if defined (__STDC__) || defined (__cplusplus) int yyparse (void) #else @@ -1292,19 +1000,13 @@ yyparse () #endif { - int yystate; - int yyn; + register int yystate; + register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif /* Three stacks and their tools: `yyss': related to states, @@ -1315,18 +1017,18 @@ yyparse () to reallocate them elsewhere. */ /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + register short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; + register YYSTYPE *yyvsp; -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) +#define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; @@ -1335,9 +1037,9 @@ yyparse () YYSTYPE yyval; - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ + int yylen; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1354,6 +1056,9 @@ yyparse () yyssp = yyss; yyvsp = yyvs; + + yyvsp[0] = yylval; + goto yysetstate; /*------------------------------------------------------------. @@ -1361,7 +1066,8 @@ yyparse () `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ + have just been pushed. so pushing a state here evens the stacks. + */ yyssp++; yysetstate: @@ -1374,18 +1080,18 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; + short int *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), + yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -1396,21 +1102,21 @@ yyparse () } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; + goto yyoverflowlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyoverflowlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; + short int *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyexhaustedlab; + goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -1441,10 +1147,12 @@ yyparse () `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ +/* Do appropriate processing given the current state. */ +/* Read a look-ahead token if we need one and don't already have one. */ +/* yyresume: */ /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; @@ -1486,21 +1194,22 @@ yybackup: if (yyn == YYFINAL) YYACCEPT; - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token unless it is eof. */ + /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; - yystate = yyn; *++yyvsp = yylval; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + yystate = yyn; goto yynewstate; @@ -1581,10 +1290,10 @@ yyreduce: #line 88 "levcomp.ypp" { dgn_reset_default_depth(); - std::string err = dgn_set_default_depth((yyvsp[(2) - (2)].text)); + std::string err = dgn_set_default_depth((yyvsp[0].text)); if (!err.empty()) yyerror(make_stringf("Bad default-depth: %s (%s)", - (yyvsp[(2) - (2)].text), err.c_str()).c_str()); + (yyvsp[0].text), err.c_str()).c_str()); } break; @@ -1635,393 +1344,429 @@ yyreduce: #line 128 "levcomp.ypp" { lc_map.init(); - lc_map.name = (yyvsp[(2) - (2)].text); + lc_map.name = (yyvsp[0].text); map_load_info_t::const_iterator i = - lc_loaded_maps.find((yyvsp[(2) - (2)].text)); + lc_loaded_maps.find((yyvsp[0].text)); if (i != lc_loaded_maps.end()) { yyerror( make_stringf( "Map named '%s' already loaded at %s:%d", - (yyvsp[(2) - (2)].text), + (yyvsp[0].text), i->second.filename.c_str(), i->second.lineno).c_str() ); } lc_map.place_loaded_from = map_file_place(lc_desfile, yylineno); - lc_loaded_maps[(yyvsp[(2) - (2)].text)] = lc_map.place_loaded_from; + lc_loaded_maps[(yyvsp[0].text)] = lc_map.place_loaded_from; } break; - case 36: -#line 170 "levcomp.ypp" + case 39: +#line 173 "levcomp.ypp" {} break; - case 37: -#line 173 "levcomp.ypp" + case 40: +#line 176 "levcomp.ypp" { } break; - case 38: -#line 175 "levcomp.ypp" + case 41: +#line 178 "levcomp.ypp" { } break; - case 39: -#line 176 "levcomp.ypp" + case 42: +#line 179 "levcomp.ypp" { } break; - case 40: -#line 180 "levcomp.ypp" + case 43: +#line 183 "levcomp.ypp" { - lc_global_prelude.add(yylineno, (yyvsp[(1) - (1)].text)); + lc_global_prelude.add(yylineno, (yyvsp[0].text)); } break; - case 41: -#line 184 "levcomp.ypp" + case 44: +#line 187 "levcomp.ypp" { } break; - case 42: -#line 186 "levcomp.ypp" + case 45: +#line 189 "levcomp.ypp" { } break; - case 43: -#line 187 "levcomp.ypp" + case 46: +#line 190 "levcomp.ypp" { } break; - case 44: -#line 191 "levcomp.ypp" + case 47: +#line 194 "levcomp.ypp" { - lc_map.main.add(yylineno, (yyvsp[(1) - (1)].text)); + lc_map.main.add(yylineno, (yyvsp[0].text)); } break; - case 45: -#line 195 "levcomp.ypp" + case 48: +#line 198 "levcomp.ypp" { } break; - case 46: -#line 197 "levcomp.ypp" + case 49: +#line 200 "levcomp.ypp" { } break; - case 47: -#line 198 "levcomp.ypp" + case 50: +#line 201 "levcomp.ypp" { } break; - case 48: -#line 202 "levcomp.ypp" + case 51: +#line 205 "levcomp.ypp" { - lc_map.validate.add(yylineno, (yyvsp[(1) - (1)].text)); + lc_map.validate.add(yylineno, (yyvsp[0].text)); } break; - case 49: -#line 206 "levcomp.ypp" + case 52: +#line 209 "levcomp.ypp" { } break; - case 50: -#line 208 "levcomp.ypp" + case 53: +#line 211 "levcomp.ypp" { } break; - case 51: -#line 209 "levcomp.ypp" + case 54: +#line 212 "levcomp.ypp" { } break; - case 52: -#line 213 "levcomp.ypp" + case 55: +#line 216 "levcomp.ypp" { - lc_map.veto.add(yylineno, (yyvsp[(1) - (1)].text)); + lc_map.veto.add(yylineno, (yyvsp[0].text)); } break; - case 53: -#line 217 "levcomp.ypp" + case 56: +#line 220 "levcomp.ypp" { } break; - case 54: -#line 219 "levcomp.ypp" + case 57: +#line 222 "levcomp.ypp" { } break; - case 55: -#line 220 "levcomp.ypp" + case 58: +#line 223 "levcomp.ypp" { } break; - case 56: -#line 224 "levcomp.ypp" + case 59: +#line 227 "levcomp.ypp" { - lc_map.prelude.add(yylineno, (yyvsp[(1) - (1)].text)); + lc_map.prelude.add(yylineno, (yyvsp[0].text)); } break; - case 57: -#line 228 "levcomp.ypp" + case 60: +#line 231 "levcomp.ypp" { } break; - case 58: -#line 230 "levcomp.ypp" + case 61: +#line 233 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("kfeat(\"%s\")", - quote_lua_string((yyvsp[(2) - (2)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 59: -#line 237 "levcomp.ypp" + case 62: +#line 240 "levcomp.ypp" { } break; - case 60: -#line 239 "levcomp.ypp" + case 63: +#line 242 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("kmons(\"%s\")", - quote_lua_string((yyvsp[(2) - (2)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 61: -#line 246 "levcomp.ypp" + case 64: +#line 249 "levcomp.ypp" { } break; - case 62: -#line 248 "levcomp.ypp" + case 65: +#line 251 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("kitem(\"%s\")", - quote_lua_string((yyvsp[(2) - (2)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 63: -#line 255 "levcomp.ypp" + case 66: +#line 258 "levcomp.ypp" + { } + break; + + case 67: +#line 260 "levcomp.ypp" + { + lc_map.main.add( + yylineno, + make_stringf("kmask(\"%s\")", + quote_lua_string((yyvsp[0].text)).c_str())); + } + break; + + case 68: +#line 267 "levcomp.ypp" {} break; - case 66: -#line 263 "levcomp.ypp" + case 71: +#line 275 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("shuffle(\"%s\")", - quote_lua_string((yyvsp[(1) - (1)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 67: -#line 270 "levcomp.ypp" + case 72: +#line 282 "levcomp.ypp" {} break; - case 70: -#line 278 "levcomp.ypp" + case 75: +#line 290 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("tags(\"%s\")", - quote_lua_string((yyvsp[(1) - (1)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 71: -#line 287 "levcomp.ypp" + case 76: +#line 299 "levcomp.ypp" + { + lc_map.main.add( + yylineno, + make_stringf("lflags(\"%s\")", + quote_lua_string((yyvsp[0].text)).c_str())); + } + break; + + case 77: +#line 308 "levcomp.ypp" + { + lc_map.main.add( + yylineno, + make_stringf("bflags(\"%s\")", + quote_lua_string((yyvsp[0].text)).c_str())); + } + break; + + case 78: +#line 317 "levcomp.ypp" { lc_map.main.add(yylineno, "marker("); start_marker_segment = true; } break; - case 72: -#line 292 "levcomp.ypp" + case 79: +#line 322 "levcomp.ypp" { lc_map.main.add(yylineno, ")"); } break; - case 76: -#line 304 "levcomp.ypp" + case 83: +#line 334 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf( "%s\"%s\"", start_marker_segment? "" : " .. ", - quote_lua_string((yyvsp[(1) - (1)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); start_marker_segment = false; } break; - case 77: -#line 315 "levcomp.ypp" + case 84: +#line 345 "levcomp.ypp" { } break; - case 80: -#line 323 "levcomp.ypp" + case 87: +#line 353 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("nsubst(\"%s\")", - quote_lua_string((yyvsp[(1) - (1)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 81: -#line 331 "levcomp.ypp" + case 88: +#line 361 "levcomp.ypp" { } break; - case 84: -#line 339 "levcomp.ypp" + case 91: +#line 369 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("subst(\"%s\")", - quote_lua_string((yyvsp[(1) - (1)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 85: -#line 347 "levcomp.ypp" + case 92: +#line 377 "levcomp.ypp" {} break; - case 86: -#line 348 "levcomp.ypp" + case 93: +#line 378 "levcomp.ypp" {} break; - case 89: -#line 356 "levcomp.ypp" + case 96: +#line 386 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("item(\"%s\")", - quote_lua_string((yyvsp[(1) - (1)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 90: -#line 363 "levcomp.ypp" + case 97: +#line 393 "levcomp.ypp" {} break; - case 91: -#line 364 "levcomp.ypp" + case 98: +#line 394 "levcomp.ypp" {} break; - case 94: -#line 372 "levcomp.ypp" + case 101: +#line 402 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("mons(\"%s\")", - quote_lua_string((yyvsp[(1) - (1)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 95: -#line 381 "levcomp.ypp" + case 102: +#line 411 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("place(\"%s\")", - quote_lua_string((yyvsp[(2) - (2)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 96: -#line 389 "levcomp.ypp" + case 103: +#line 419 "levcomp.ypp" {} break; - case 97: -#line 391 "levcomp.ypp" + case 104: +#line 421 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("depth(\"%s\")", - quote_lua_string((yyvsp[(2) - (2)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 98: -#line 400 "levcomp.ypp" + case 105: +#line 430 "levcomp.ypp" { lc_map.main.add( yylineno, - make_stringf("chance(\"%d\")", (yyvsp[(2) - (2)].i))); + make_stringf("chance(\"%d\")", (yyvsp[0].i))); } break; - case 99: -#line 407 "levcomp.ypp" + case 106: +#line 437 "levcomp.ypp" {} break; - case 100: -#line 409 "levcomp.ypp" + case 107: +#line 439 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("orient(\"%s\")", - quote_lua_string((yyvsp[(2) - (2)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 101: -#line 418 "levcomp.ypp" + case 108: +#line 448 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("welcome(\"%s\")", - quote_lua_string((yyvsp[(2) - (2)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; - case 105: -#line 434 "levcomp.ypp" + case 112: +#line 464 "levcomp.ypp" { lc_map.main.add( yylineno, make_stringf("map(\"%s\")", - quote_lua_string((yyvsp[(1) - (1)].text)).c_str())); + quote_lua_string((yyvsp[0].text)).c_str())); } break; -/* Line 1267 of yacc.c. */ -#line 2019 "levcomp.tab.c" - default: break; } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - YYPOPSTACK (yylen); - yylen = 0; +/* Line 1037 of yacc.c. */ +#line 1765 "levcomp.tab.c" + + yyvsp -= yylen; + yyssp -= yylen; + + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -2050,41 +1795,66 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else +#if YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (YYPACT_NINF < yyn && yyn < YYLAST) + { + YYSIZE_T yysize = 0; + int yytype = YYTRANSLATE (yychar); + const char* yyprefix; + char *yymsg; + int yyx; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 0; + + yyprefix = ", expecting "; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; + yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); + yycount += 1; + if (yycount == 5) + { + yysize = 0; + break; + } } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif + yysize += (sizeof ("syntax error, unexpected ") + + yystrlen (yytname[yytype])); + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg != 0) + { + char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); + yyp = yystpcpy (yyp, yytname[yytype]); + + if (yycount < 5) + { + yyprefix = ", expecting "; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + yyp = yystpcpy (yyp, yyprefix); + yyp = yystpcpy (yyp, yytname[yyx]); + yyprefix = " or "; + } + } + yyerror (yymsg); + YYSTACK_FREE (yymsg); + } + else + yyerror ("syntax error; also virtual memory exhausted"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror ("syntax error"); } @@ -2095,15 +1865,23 @@ yyerrlab: error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ + { + /* If at end of input, pop the error token, + then the rest of the stack, then return failure. */ if (yychar == YYEOF) - YYABORT; - } + for (;;) + { + + YYPOPSTACK; + if (yyssp == yyss) + YYABORT; + yydestruct ("Error: popping", + yystos[*yyssp], yyvsp); + } + } else { - yydestruct ("Error: discarding", - yytoken, &yylval); + yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } @@ -2118,17 +1896,15 @@ yyerrlab: `---------------------------------------------------*/ yyerrorlab: - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) +#ifdef __GNUC__ + /* Pacify GCC when the user code never invokes YYERROR and the label + yyerrorlab therefore never appears in user code. */ + if (0) goto yyerrorlab; +#endif - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); +yyvsp -= yylen; + yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; @@ -2158,9 +1934,8 @@ yyerrlab1: YYABORT; - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); + yydestruct ("Error: popping", yystos[yystate], yyvsp); + YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } @@ -2171,7 +1946,7 @@ yyerrlab1: *++yyvsp = yylval; - /* Shift the error token. */ + /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; @@ -2189,46 +1964,31 @@ yyacceptlab: | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: + yydestruct ("Error: discarding lookahead", + yytoken, &yylval); + yychar = YYEMPTY; yyresult = 1; goto yyreturn; #ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); +/*----------------------------------------------. +| yyoverflowlab -- parser overflow comes here. | +`----------------------------------------------*/ +yyoverflowlab: + yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } -#line 442 "levcomp.ypp" +#line 472 "levcomp.ypp" diff --git a/crawl-ref/source/prebuilt/levcomp.tab.h b/crawl-ref/source/prebuilt/levcomp.tab.h index edd969eb0a..ac7bd59de9 100644 --- a/crawl-ref/source/prebuilt/levcomp.tab.h +++ b/crawl-ref/source/prebuilt/levcomp.tab.h @@ -1,9 +1,7 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 2.0. */ -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,21 +15,13 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE @@ -46,31 +36,33 @@ KFEAT = 262, KITEM = 263, KMONS = 264, - NAME = 265, - DEPTH = 266, - ORIENT = 267, - PLACE = 268, - CHANCE = 269, - MONS = 270, - ITEM = 271, - MARKER = 272, - PRELUDE = 273, - MAIN = 274, - VALIDATE = 275, - VETO = 276, - NSUBST = 277, - WELCOME = 278, - COMMA = 279, - INTEGER = 280, - CHARACTER = 281, - STRING = 282, - MAP_LINE = 283, - MONSTER_NAME = 284, - ITEM_INFO = 285, - LUA_LINE = 286 + KMASK = 265, + NAME = 266, + DEPTH = 267, + ORIENT = 268, + PLACE = 269, + CHANCE = 270, + MONS = 271, + ITEM = 272, + MARKER = 273, + PRELUDE = 274, + MAIN = 275, + VALIDATE = 276, + VETO = 277, + NSUBST = 278, + WELCOME = 279, + LFLAGS = 280, + BFLAGS = 281, + COMMA = 282, + INTEGER = 283, + CHARACTER = 284, + STRING = 285, + MAP_LINE = 286, + MONSTER_NAME = 287, + ITEM_INFO = 288, + LUA_LINE = 289 }; #endif -/* Tokens. */ #define DEFAULT_DEPTH 258 #define SHUFFLE 259 #define SUBST 260 @@ -78,43 +70,44 @@ #define KFEAT 262 #define KITEM 263 #define KMONS 264 -#define NAME 265 -#define DEPTH 266 -#define ORIENT 267 -#define PLACE 268 -#define CHANCE 269 -#define MONS 270 -#define ITEM 271 -#define MARKER 272 -#define PRELUDE 273 -#define MAIN 274 -#define VALIDATE 275 -#define VETO 276 -#define NSUBST 277 -#define WELCOME 278 -#define COMMA 279 -#define INTEGER 280 -#define CHARACTER 281 -#define STRING 282 -#define MAP_LINE 283 -#define MONSTER_NAME 284 -#define ITEM_INFO 285 -#define LUA_LINE 286 +#define KMASK 265 +#define NAME 266 +#define DEPTH 267 +#define ORIENT 268 +#define PLACE 269 +#define CHANCE 270 +#define MONS 271 +#define ITEM 272 +#define MARKER 273 +#define PRELUDE 274 +#define MAIN 275 +#define VALIDATE 276 +#define VETO 277 +#define NSUBST 278 +#define WELCOME 279 +#define LFLAGS 280 +#define BFLAGS 281 +#define COMMA 282 +#define INTEGER 283 +#define CHARACTER 284 +#define STRING 285 +#define MAP_LINE 286 +#define MONSTER_NAME 287 +#define ITEM_INFO 288 +#define LUA_LINE 289 -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 46 "levcomp.ypp" -{ +typedef union YYSTYPE { int i; const char *text; raw_range range; -} -/* Line 1529 of yacc.c. */ -#line 117 "levcomp.tab.h" - YYSTYPE; +} YYSTYPE; +/* Line 1274 of yacc.c. */ +#line 111 "levcomp.tab.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -122,3 +115,5 @@ typedef union YYSTYPE extern YYSTYPE yylval; + + diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index e1f0406c1f..3560fbb80f 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -52,8 +52,6 @@ #include "traps.h" #include "view.h" -static bool monster_on_level(int monster); - bool cast_selective_amnesia(bool force) { char ep_gain = 0; @@ -488,31 +486,6 @@ void dancing_weapon(int pow, bool force_hostile) burden_change(); } // end dancing_weapon() -static bool monster_on_level(int monster) -{ - for (int i = 0; i < MAX_MONSTERS; i++) - { - if (menv[i].type == monster) - return true; - } - - return false; -} // end monster_on_level() - -// XXX: Relies on RUNE_xxx == BRANCH_xxx. See rune_type in enum.h. -static bool player_has_rune(branch_type branch) -{ - for (int i = 0; i < ENDOFPACK; i++) - if (is_valid_item( you.inv[i] ) - && you.inv[i].base_type == OBJ_MISCELLANY - && you.inv[i].sub_type == MISC_RUNE_OF_ZOT - && you.inv[i].plus == branch) - { - return (true); - } - return (false); -} - // // This function returns true if the player can use controlled // teleport here. @@ -521,58 +494,10 @@ bool allow_control_teleport( bool silent ) { bool ret = true; - if (you.level_type == LEVEL_ABYSS || you.level_type == LEVEL_LABYRINTH) - ret = false; - else + if (testbits(env.level_flags, LFLAG_NO_TELE_CONTROL) + || testbits(get_branch_flags(), BFLAG_NO_TELE_CONTROL)) { - switch (you.where_are_you) - { - case BRANCH_TOMB: - ret = player_has_rune(you.where_are_you); - break; - - case BRANCH_COCYTUS: - case BRANCH_DIS: - case BRANCH_TARTARUS: - case BRANCH_GEHENNA: - if (player_branch_depth() == branches[you.where_are_you].depth) - ret = player_has_rune(you.where_are_you); - break; - - case BRANCH_SLIME_PITS: - // Cannot teleport into the slime pit vaults until - // royal jelly is gone. - if (monster_on_level(MONS_ROYAL_JELLY)) - ret = false; - break; - - case BRANCH_ELVEN_HALLS: - // Cannot raid the elven halls vaults until fountain drained - if (player_branch_depth() == branches[BRANCH_ELVEN_HALLS].depth) - { - for (int x = 5; x < GXM - 5; x++) - { - for (int y = 5; y < GYM - 5; y++) - { - if (grd[x][y] == DNGN_SPARKLING_FOUNTAIN) - ret = false; - } - } - } - break; - - case BRANCH_HALL_OF_ZOT: - // Cannot control teleport until the Orb is picked up - if (player_branch_depth() == branches[BRANCH_HALL_OF_ZOT].depth - && you.char_direction != GDT_ASCENDING) - { - ret = false; - } - break; - - default: - break; - } + ret = false; } // Tell the player why if they have teleport control. diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index b2a5a78100..7921420285 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -1019,7 +1019,10 @@ static void tag_construct_you_dungeon(struct tagHeader &th) // how many branches? marshallByte(th, NUM_BRANCHES); for (j = 0; j < NUM_BRANCHES; ++j) + { marshallLong(th, branches[j].startdepth); + marshallLong(th, branches[j].branch_flags); + } marshallShort(th, MAX_LEVELS); for (i = 0; i < MAX_LEVELS; ++i) @@ -1407,7 +1410,10 @@ static void tag_read_you_dungeon(struct tagHeader &th) // how many branches? count_c = unmarshallByte(th); for (j = 0; j < count_c; ++j) - branches[j].startdepth = unmarshallLong(th); + { + branches[j].startdepth = unmarshallLong(th); + branches[j].branch_flags = (unsigned long) unmarshallLong(th); + } count_s = unmarshallShort(th); for (i = 0; i < count_s; ++i) @@ -1467,6 +1473,8 @@ static void tag_read_lost_monsters(tagHeader &th, int minorVersion) static void tag_construct_level(struct tagHeader &th) { + marshallLong(th, env.level_flags); + marshallFloat(th, (float)you.elapsed_time); // map grids @@ -1686,6 +1694,8 @@ void tag_construct_level_attitude(struct tagHeader &th) static void tag_read_level( struct tagHeader &th, char minorVersion ) { + env.level_flags = (unsigned long) unmarshallLong(th); + env.elapsed_time = unmarshallFloat(th); // map grids // how many X? diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index 43ae6dc5b1..8355657edc 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -405,6 +405,8 @@ static void dgn_check_terrain_monsters(const coord_def &pos) else mons_check_pool(mons, KILL_MISC, -1); } + + set_terrain_changed(pos.x, pos.y); } void dungeon_terrain_changed(const coord_def &pos, diff --git a/crawl-ref/source/util/levcomp.lpp b/crawl-ref/source/util/levcomp.lpp index c86d4d9396..a2044da067 100644 --- a/crawl-ref/source/util/levcomp.lpp +++ b/crawl-ref/source/util/levcomp.lpp @@ -194,6 +194,8 @@ CHANCE: return CHANCE; WEIGHT: return CHANCE; FLAGS: { BEGIN(KEYWORDS); return TAGS; } TAGS: { BEGIN(KEYWORDS); return TAGS; } +LFLAGS: { BEGIN(ARGUMENT); return LFLAGS; } +BFLAGS: { BEGIN(ARGUMENT); return BFLAGS; } SUBST: { BEGIN(ITEM_LIST); return SUBST; } NSUBST: { BEGIN(ITEM_LIST); return NSUBST; } MONS: { BEGIN(MNAME); return MONS; } @@ -204,6 +206,7 @@ SHUFFLE: { BEGIN(ITEM_LIST); return SHUFFLE; } KFEAT: { BEGIN(ARGUMENT); return KFEAT; } KITEM: { BEGIN(ARGUMENT); return KITEM; } KMONS: { BEGIN(ARGUMENT); return KMONS; } +KMASK: { BEGIN(ARGUMENT); return KMASK; } , return COMMA; diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp index 26f736cd23..74cc7ff68f 100644 --- a/crawl-ref/source/util/levcomp.ypp +++ b/crawl-ref/source/util/levcomp.ypp @@ -52,9 +52,9 @@ level_range set_range(const char *s, int start, int end) /* Two harmless shift/reduce conflicts */ %expect 2 -%token <i> DEFAULT_DEPTH SHUFFLE SUBST TAGS KFEAT KITEM KMONS +%token <i> DEFAULT_DEPTH SHUFFLE SUBST TAGS KFEAT KITEM KMONS KMASK %token <i> NAME DEPTH ORIENT PLACE CHANCE MONS ITEM MARKER -%token <i> PRELUDE MAIN VALIDATE VETO NSUBST WELCOME +%token <i> PRELUDE MAIN VALIDATE VETO NSUBST WELCOME LFLAGS BFLAGS %token <i> COMMA INTEGER CHARACTER @@ -160,9 +160,12 @@ metaline : place | nsubst | shuffle | tags + | lflags + | bflags | kfeat | kitem | kmons + | kmask | main_lua | prelude_lua | validate_lua @@ -252,6 +255,15 @@ kitem : KITEM { } quote_lua_string($2).c_str())); } +kmask : KMASK { } + | KMASK STRING + { + lc_map.main.add( + yylineno, + make_stringf("kmask(\"%s\")", + quote_lua_string($2).c_str())); + } + shuffle : SHUFFLE shuffle_specifiers {} ; @@ -283,6 +295,24 @@ tagstring : STRING } ; +lflags : LFLAGS STRING + { + lc_map.main.add( + yylineno, + make_stringf("lflags(\"%s\")", + quote_lua_string($2).c_str())); + } + ; + +bflags : BFLAGS STRING + { + lc_map.main.add( + yylineno, + make_stringf("bflags(\"%s\")", + quote_lua_string($2).c_str())); + } + ; + marker : MARKER { lc_map.main.add(yylineno, "marker("); diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 9d53d930d0..6b957a326f 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -36,6 +36,7 @@ #include "externs.h" +#include "branch.h" #include "command.h" #include "cio.h" #include "cloud.h" @@ -43,6 +44,7 @@ #include "database.h" #include "debug.h" #include "delay.h" +#include "dgnevent.h" #include "direct.h" #include "dungeon.h" #include "format.h" @@ -223,6 +225,8 @@ bool is_terrain_changed( int x, int y ) void set_terrain_changed( int x, int y ) { env.map[x][y].flags |= MAP_CHANGED_FLAG; + + dungeon_events.fire_position_event(DET_FEAT_CHANGE, coord_def(x, y)); } void set_terrain_mapped( int x, int y ) @@ -3164,6 +3168,18 @@ void show_map( FixedVector<int, 2> &spec_place, bool travel_mode ) break; } } + +#ifdef WIZARD + case 'T': + { + if (!you.wizard) + break; + you.moveto(start_x + curs_x - 1, start_y + curs_y - 1); + map_alive = false; + break; + } +#endif + default: move_x = 0; move_y = 0; @@ -3238,8 +3254,8 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, bool force) { if (!force && - ((you.level_type == LEVEL_ABYSS) || - (you.level_type == LEVEL_LABYRINTH && you.species != SP_MINOTAUR))) + (testbits(env.level_flags, LFLAG_NO_MAGIC_MAP) + || testbits(get_branch_flags(), BFLAG_NO_MAGIC_MAP))) { if (!suppress_msg) mpr("You feel momentarily disoriented."); |