Angband
Data Structures | Macros | Enumerations | Functions | Variables
parser.h File Reference

Info file parser. More...

#include "h-basic.h"
#include "z-bitflag.h"
#include "z-dice.h"
#include "z-rand.h"
#include "list-parser-errors.h"

Go to the source code of this file.

Data Structures

struct  parser_state
struct  file_parser

Macros

#define PARSE_ERROR(a, b)   PARSE_ERROR_##a,

Enumerations

enum  parser_error { PARSE_ERROR_MAX }

Functions

struct parserparser_new (void)
 Allocates a new parser.
enum parser_error parser_parse (struct parser *p, const char *line)
 Parses the provided line.
void parser_destroy (struct parser *p)
 Destroys a parser.
voidparser_priv (struct parser *p)
 Gets parser's private data.
void parser_setpriv (struct parser *p, void *v)
 Sets parser's private data.
errr parser_reg (struct parser *p, const char *fmt, enum parser_error(*func)(struct parser *p))
 Registers a parser hook.
enum parser_error ignored (struct parser *p)
 A placeholder parse hook indicating a value is ignored.
bool parser_hasval (struct parser *p, const char *name)
 Returns whether the parser has a value named name.
const char * parser_getsym (struct parser *p, const char *name)
 Returns the symbol named name.
const char * parser_getstr (struct parser *p, const char *name)
 Returns the string named name.
int parser_getint (struct parser *p, const char *name)
 Returns the integer named name.
unsigned int parser_getuint (struct parser *p, const char *name)
 Returns the unsigned integer named name.
struct random parser_getrand (struct parser *p, const char *name)
 Returns the random value named name.
wchar_t parser_getchar (struct parser *p, const char *name)
 Returns the character named name.
int parser_getstate (struct parser *p, struct parser_state *s)
 Fills the provided struct with the parser's state, if any.
void parser_setstate (struct parser *p, unsigned int col, const char *msg)
 Sets the parser's detailed error description and field number.
errr run_parser (struct file_parser *fp)
errr parse_file (struct parser *p, const char *filename)
 The basic file parsing function.
void cleanup_parser (struct file_parser *fp)
int lookup_flag (const char **flag_table, const char *flag_name)
errr grab_rand_value (random_value *value, const char **value_type, const char *name_and_value)
 Get the random value argument from a value expression and put it into the appropriate place in an array.
errr grab_int_value (int *value, const char **value_type, const char *name_and_value)
 Get the integer argument from a value expression and put it into the appropriate place in an array.
errr grab_index_and_int (int *value, int *index, const char **value_type, const char *prefix, const char *name_and_value)
 Get the integer argument from a value expression and the index in the value_type array of the suffix used to build the value string.
errr grab_base_and_int (int *value, char **base, const char *name_and_value)
 Get the integer argument from a slay value expression and the monster base name it is slaying.
errr grab_name (const char *from, const char *what, const char *list[], int max, int *num)
errr grab_flag (bitflag *flags, const size_t size, const char **flag_table, const char *flag_name)
errr remove_flag (bitflag *flags, const size_t size, const char **flag_table, const char *flag_name)

Variables

const char * parser_error_str [PARSE_ERROR_MAX]
 A parser has a list of hooks (which are run across new lines given to parser_parse()) and a list of the set of named values for the current line.

Detailed Description

Info file parser.

Copyright (c) 2011 Elly elly+.nosp@m.angb.nosp@m.and@l.nosp@m.epto.nosp@m.quark.nosp@m..net

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Macro Definition Documentation

#define PARSE_ERROR (   a,
 
)    PARSE_ERROR_##a,

Enumeration Type Documentation

Enumerator:
PARSE_ERROR_MAX 

Function Documentation

void cleanup_parser ( struct file_parser fp)
errr grab_base_and_int ( int value,
char **  base,
const char *  name_and_value 
)

Get the integer argument from a slay value expression and the monster base name it is slaying.

Parameters
valuethe integer value
basethe monster base name
name_and_valuethe value expression being matched
Returns
0 if successful, otherwise an error value

References find_value_arg(), my_strcpy(), and string_make().

Referenced by parse_artifact_values(), parse_ego_values(), and parse_object_values().

errr grab_flag ( bitflag flags,
const size_t  size,
const char **  flag_table,
const char *  flag_name 
)
errr grab_index_and_int ( int value,
int index,
const char **  value_type,
const char *  prefix,
const char *  name_and_value 
)

Get the integer argument from a value expression and the index in the value_type array of the suffix used to build the value string.

Parameters
valuethe integer value
indexthe information on where to put it (eg array index)
value_typethe variable suffix of the possible value strings
prefixthe constant prefix of the possible value strings
name_and_valuethe value expression being matched
Returns
0 if successful, otherwise an error value

References find_value_arg(), i, my_strcat(), my_strcpy(), and streq.

Referenced by parse_artifact_values(), parse_ego_values(), parse_object_values(), and parse_p_race_values().

errr grab_int_value ( int value,
const char **  value_type,
const char *  name_and_value 
)

Get the integer argument from a value expression and put it into the appropriate place in an array.

Parameters
valuethe target array of integers
value_typethe possible value strings
name_and_valuethe value expression being matched
Returns
0 if successful, otherwise an error value

References find_value_arg(), i, my_strcpy(), and streq.

Referenced by parse_artifact_values(), and parse_ego_min_val().

errr grab_name ( const char *  from,
const char *  what,
const char *  list[],
int  max,
int num 
)
errr grab_rand_value ( random_value value,
const char **  value_type,
const char *  name_and_value 
)

Get the random value argument from a value expression and put it into the appropriate place in an array.

Parameters
valuethe target array of values
value_typethe possible value strings
name_and_valuethe value expression being matched
Returns
0 if successful, otherwise an error value

References dice_free(), dice_new(), dice_parse_string(), dice_random_value(), find_value_arg(), i, my_strcpy(), and streq.

Referenced by parse_ego_values(), and parse_object_values().

enum parser_error ignored ( struct parser p)
int lookup_flag ( const char **  flag_table,
const char *  flag_name 
)
errr parse_file ( struct parser p,
const char *  filename 
)
void parser_destroy ( struct parser p)
wchar_t parser_getchar ( struct parser p,
const char *  name 
)
int parser_getint ( struct parser p,
const char *  name 
)

Returns the integer named name.

This symbol must exist.

References parser_value::ival, PARSE_T_INT, PARSE_T_OPT, parser_getval(), parser_value::spec, parser_spec::type, and parser_value::u.

Referenced by grab_effect_data(), helper_char1(), helper_int0(), helper_int1(), parse_artifact_alloc(), parse_artifact_info(), parse_artifact_name(), parse_artifact_power(), parse_class_attack(), parse_class_info(), parse_class_param(), parse_class_skill_device(), parse_class_skill_dig(), parse_class_skill_disarm(), parse_class_skill_melee(), parse_class_skill_save(), parse_class_skill_search(), parse_class_skill_search_freq(), parse_class_skill_shoot(), parse_class_skill_stealth(), parse_class_skill_throw(), parse_class_spell(), parse_class_stats(), parse_constants_carry_cap(), parse_constants_dun_gen(), parse_constants_level_max(), parse_constants_mon_gen(), parse_constants_mon_play(), parse_constants_obj_make(), parse_constants_player(), parse_constants_store(), parse_constants_world(), parse_ego_alloc(), parse_ego_info(), parse_ego_min(), parse_ego_name(), parse_feat_info(), parse_history_chart(), parse_lore_b(), parse_lore_counts(), parse_mon_spell_effect(), parse_mon_spell_param(), parse_monster_info(), parse_monster_power(), parse_monster_spell_freq(), parse_names_section(), parse_object_alloc(), parse_object_base_break(), parse_object_base_defaults(), parse_object_combat(), parse_object_name(), parse_object_param(), parse_object_pile(), parse_object_power(), parse_object_properties(), parse_p_race_height(), parse_p_race_history(), parse_p_race_info(), parse_p_race_skill_device(), parse_p_race_skill_dig(), parse_p_race_skill_disarm(), parse_p_race_skill_melee(), parse_p_race_skill_save(), parse_p_race_skill_search(), parse_p_race_skill_search_freq(), parse_p_race_skill_shoot(), parse_p_race_skill_stealth(), parse_p_race_skill_throw(), parse_p_race_stats(), parse_p_race_weight(), parse_prefs_color(), parse_prefs_feat(), parse_prefs_flavor(), parse_prefs_keymap_input(), parse_prefs_monster(), parse_prefs_object(), parse_prefs_trap(), parse_prefs_window(), parse_profile_cutoff(), parse_profile_params(), parse_profile_room(), parse_profile_streamer(), parse_profile_tunnel(), parse_room_x(), and parse_v_x().

struct random parser_getrand ( struct parser p,
const char *  name 
)
read
int parser_getstate ( struct parser p,
struct parser_state s 
)

Fills the provided struct with the parser's state, if any.

Returns true if the parser is in an error state, and false otherwise.

References parser_state::col, parser::colno, parser::errmsg, parser_state::error, parser::error, parser_state::line, parser::lineno, and parser_state::msg.

Referenced by print_error(), test_syntax0(), test_syntax1(), and test_syntax2().

const char* parser_getstr ( struct parser p,
const char *  name 
)

Returns the string named name.

This symbol must exist.

References PARSE_T_OPT, PARSE_T_STR, parser_getval(), parser_value::spec, parser_value::sval, parser_spec::type, and parser_value::u.

Referenced by helper_char1(), helper_str0(), parse_act_desc(), parse_act_dice(), parse_act_expr(), parse_act_msg(), parse_act_name(), parse_artifact_act(), parse_artifact_alloc(), parse_artifact_desc(), parse_artifact_flags(), parse_artifact_msg(), parse_artifact_name(), parse_artifact_values(), parse_body_body(), parse_buy(), parse_buy_flag(), parse_class_desc(), parse_class_dice(), parse_class_expr(), parse_class_flags(), parse_class_name(), parse_class_title(), parse_ego_alloc(), parse_ego_desc(), parse_ego_dice(), parse_ego_flags(), parse_ego_min_val(), parse_ego_name(), parse_ego_values(), parse_feat_flags(), parse_feat_name(), parse_flavor_flavor(), parse_graf_i(), parse_graf_n(), parse_graf_p(), parse_hint(), parse_history_phrase(), parse_lore_drop_artifact(), parse_lore_f(), parse_lore_friends(), parse_lore_friends_base(), parse_lore_s(), parse_mon_base_desc(), parse_mon_base_flags(), parse_mon_base_name(), parse_mon_base_spells(), parse_mon_spell_dice(), parse_mon_spell_expr(), parse_mon_spell_name(), parse_monster_desc(), parse_monster_drop_artifact(), parse_monster_flags(), parse_monster_flags_off(), parse_monster_friends(), parse_monster_friends_base(), parse_monster_name(), parse_monster_plural(), parse_monster_spells(), parse_names_word(), parse_object_alloc(), parse_object_base_flags(), parse_object_base_name(), parse_object_desc(), parse_object_dice(), parse_object_expr(), parse_object_flags(), parse_object_msg(), parse_object_name(), parse_object_values(), parse_owner(), parse_p_race_name(), parse_p_race_obj_flags(), parse_p_race_play_flags(), parse_p_race_values(), parse_pain_message(), parse_pit_flags_ban(), parse_pit_flags_req(), parse_pit_name(), parse_pit_spell_ban(), parse_pit_spell_req(), parse_prefs_expr(), parse_prefs_inscribe(), parse_prefs_keymap_action(), parse_prefs_keymap_input(), parse_prefs_load(), parse_profile_name(), parse_quest_name(), parse_quest_race(), parse_room_d(), parse_room_n(), parse_store(), parse_trap_desc(), parse_trap_dice(), parse_trap_expr(), parse_trap_flags(), parse_trap_name(), parse_v_d(), and parse_v_n().

const char* parser_getsym ( struct parser p,
const char *  name 
)

Returns the symbol named name.

This symbol must exist.

References PARSE_T_OPT, PARSE_T_SYM, parser_getval(), parser_value::spec, parser_value::sval, parser_spec::type, and parser_value::u.

Referenced by grab_effect_data(), helper_opt0(), helper_sym0(), helper_sym1(), parse_act_expr(), parse_always(), parse_artifact_base_object(), parse_artifact_graphics(), parse_body_slot(), parse_buy_flag(), parse_class_book(), parse_class_equip(), parse_class_expr(), parse_class_spell(), parse_constants_carry_cap(), parse_constants_dun_gen(), parse_constants_level_max(), parse_constants_mon_gen(), parse_constants_mon_play(), parse_constants_obj_make(), parse_constants_player(), parse_constants_store(), parse_constants_world(), parse_ego_item(), parse_ego_type(), parse_feat_graphics(), parse_flavor_flavor(), parse_flavor_kind(), parse_lore_b(), parse_lore_drop(), parse_lore_mimic(), parse_lore_t(), parse_mon_spell_effect(), parse_mon_spell_expr(), parse_monster_base(), parse_monster_blow(), parse_monster_color(), parse_monster_drop(), parse_monster_mimic(), parse_normal(), parse_object_base_defaults(), parse_object_base_graphics(), parse_object_base_name(), parse_object_expr(), parse_object_graphics(), parse_object_type(), parse_pit_color(), parse_pit_mon_ban(), parse_pit_mon_base(), parse_prefs_feat(), parse_prefs_gf(), parse_prefs_inscribe(), parse_prefs_message(), parse_prefs_monster(), parse_prefs_object(), parse_profile_room(), parse_trap_expr(), parse_trap_graphics(), and parse_trap_name().

unsigned int parser_getuint ( struct parser p,
const char *  name 
)
bool parser_hasval ( struct parser p,
const char *  name 
)
struct parser* parser_new ( void  )
read
enum parser_error parser_parse ( struct parser p,
const char *  line 
)

Parses the provided line.

This runs the first parser hook registered with p that matches line.

References parser::colno, parser_value::cval, parser::errmsg, parser::error, parser_hook::fhead, parser::fhead, findhook(), parser::ftail, parser_hook::func, h, parser_value::ival, parser::lineno, mem_alloc(), mem_free(), my_strcpy(), parser_spec::name, parser_spec::next, parse_random(), PARSE_T_CHAR, PARSE_T_INT, PARSE_T_OPT, PARSE_T_RAND, PARSE_T_STR, PARSE_T_SYM, PARSE_T_UINT, parser_freeold(), parser_value::rval, parser_value::spec, string_make(), parser_value::sval, text_mbstowcs(), parser_spec::type, parser_value::u, and parser_value::uval.

Referenced by init_graphics_modes(), parse_file(), process_pref_file_command(), process_pref_file_layered(), test_alloc0(), test_alloc1(), test_alloc2(), test_attack0(), test_baddir(), test_badmax(), test_badtval0(), test_badtval1(), test_base0(), test_base_object0(), test_blank(), test_blow0(), test_blow1(), test_char0(), test_char1(), test_charges0(), test_chart0(), test_color0(), test_combat0(), test_comment0(), test_comment1(), test_d0(), test_desc0(), test_equip0(), test_flags0(), test_flavor0(), test_graphics0(), test_graphics1(), test_height0(), test_history0(), test_i0(), test_info0(), test_int0(), test_int1(), test_kind0(), test_magic0(), test_mimic0(), test_min0(), test_msg0(), test_n0(), test_name0(), test_negative(), test_obj_flags0(), test_opt0(), test_order(), test_owner0(), test_phrase0(), test_pile0(), test_play_flags0(), test_power0(), test_priority0(), test_properties0(), test_pval0(), test_rand0(), test_rand1(), test_section0(), test_section1(), test_skill_device0(), test_skill_dig0(), test_skill_disarm0(), test_skill_melee0(), test_skill_save0(), test_skill_search0(), test_skill_search_freq0(), test_skill_shoot0(), test_skill_stealth0(), test_skill_throw0(), test_slots0(), test_spaces(), test_spell_freq0(), test_spells0(), test_stats0(), test_store0(), test_str0(), test_sym0(), test_sym1(), test_syntax0(), test_syntax1(), test_syntax2(), test_time0(), test_title0(), test_type0(), test_uint0(), test_uint1(), test_values0(), test_weight0(), test_word0(), test_word1(), and test_x0().

void* parser_priv ( struct parser p)

Gets parser's private data.

References parser::priv.

Referenced by finish_parse_act(), finish_parse_artifact(), finish_parse_body(), finish_parse_class(), finish_parse_constants(), finish_parse_ego(), finish_parse_feat(), finish_parse_flavor(), finish_parse_grafmode(), finish_parse_hints(), finish_parse_history(), finish_parse_mon_base(), finish_parse_mon_spell(), finish_parse_monster(), finish_parse_names(), finish_parse_object(), finish_parse_object_base(), finish_parse_p_race(), finish_parse_pain(), finish_parse_pit(), finish_parse_prefs(), finish_parse_profile(), finish_parse_quest(), finish_parse_room(), finish_parse_stores(), finish_parse_trap(), finish_parse_v(), helper_char0(), helper_char1(), helper_int0(), helper_int1(), helper_opt0(), helper_rand0(), helper_rand1(), helper_str0(), helper_sym0(), helper_sym1(), helper_uint0(), parse_act_aim(), parse_act_desc(), parse_act_dice(), parse_act_effect(), parse_act_expr(), parse_act_msg(), parse_act_name(), parse_act_power(), parse_always(), parse_artifact_act(), parse_artifact_alloc(), parse_artifact_base_object(), parse_artifact_desc(), parse_artifact_flags(), parse_artifact_graphics(), parse_artifact_info(), parse_artifact_msg(), parse_artifact_name(), parse_artifact_power(), parse_artifact_time(), parse_artifact_values(), parse_body_body(), parse_body_slot(), parse_buy(), parse_buy_flag(), parse_class_attack(), parse_class_book(), parse_class_desc(), parse_class_dice(), parse_class_effect(), parse_class_equip(), parse_class_expr(), parse_class_flags(), parse_class_info(), parse_class_magic(), parse_class_name(), parse_class_param(), parse_class_skill_device(), parse_class_skill_dig(), parse_class_skill_disarm(), parse_class_skill_melee(), parse_class_skill_save(), parse_class_skill_search(), parse_class_skill_search_freq(), parse_class_skill_shoot(), parse_class_skill_stealth(), parse_class_skill_throw(), parse_class_spell(), parse_class_stats(), parse_class_title(), parse_constants_carry_cap(), parse_constants_dun_gen(), parse_constants_level_max(), parse_constants_mon_gen(), parse_constants_mon_play(), parse_constants_obj_make(), parse_constants_player(), parse_constants_store(), parse_constants_world(), parse_ego_alloc(), parse_ego_combat(), parse_ego_desc(), parse_ego_dice(), parse_ego_effect(), parse_ego_flags(), parse_ego_info(), parse_ego_item(), parse_ego_min(), parse_ego_min_val(), parse_ego_name(), parse_ego_time(), parse_ego_type(), parse_ego_values(), parse_feat_flags(), parse_feat_graphics(), parse_feat_info(), parse_feat_mimic(), parse_feat_name(), parse_feat_priority(), parse_flavor_flavor(), parse_graf_i(), parse_graf_n(), parse_graf_p(), parse_graf_x(), parse_hint(), parse_history_chart(), parse_history_phrase(), parse_lore_b(), parse_lore_counts(), parse_lore_drop(), parse_lore_drop_artifact(), parse_lore_f(), parse_lore_friends(), parse_lore_friends_base(), parse_lore_mimic(), parse_lore_s(), parse_lore_t(), parse_mon_base_desc(), parse_mon_base_flags(), parse_mon_base_glyph(), parse_mon_base_name(), parse_mon_base_pain(), parse_mon_base_spells(), parse_mon_spell_dice(), parse_mon_spell_effect(), parse_mon_spell_expr(), parse_mon_spell_hit(), parse_mon_spell_name(), parse_mon_spell_param(), parse_mon_spell_power(), parse_monster_base(), parse_monster_blow(), parse_monster_color(), parse_monster_desc(), parse_monster_drop(), parse_monster_drop_artifact(), parse_monster_flags(), parse_monster_flags_off(), parse_monster_friends(), parse_monster_friends_base(), parse_monster_glyph(), parse_monster_info(), parse_monster_mimic(), parse_monster_name(), parse_monster_plural(), parse_monster_power(), parse_monster_spell_freq(), parse_monster_spells(), parse_names_section(), parse_names_word(), parse_normal(), parse_object_alloc(), parse_object_base_break(), parse_object_base_defaults(), parse_object_base_flags(), parse_object_base_graphics(), parse_object_base_name(), parse_object_charges(), parse_object_combat(), parse_object_desc(), parse_object_dice(), parse_object_effect(), parse_object_expr(), parse_object_flags(), parse_object_graphics(), parse_object_msg(), parse_object_name(), parse_object_param(), parse_object_pile(), parse_object_power(), parse_object_properties(), parse_object_pval(), parse_object_time(), parse_object_type(), parse_object_values(), parse_owner(), parse_p_race_height(), parse_p_race_history(), parse_p_race_info(), parse_p_race_name(), parse_p_race_obj_flags(), parse_p_race_play_flags(), parse_p_race_skill_device(), parse_p_race_skill_dig(), parse_p_race_skill_disarm(), parse_p_race_skill_melee(), parse_p_race_skill_save(), parse_p_race_skill_search(), parse_p_race_skill_search_freq(), parse_p_race_skill_shoot(), parse_p_race_skill_stealth(), parse_p_race_skill_throw(), parse_p_race_stats(), parse_p_race_values(), parse_p_race_weight(), parse_pain_message(), parse_pain_type(), parse_pit_alloc(), parse_pit_color(), parse_pit_flags_ban(), parse_pit_flags_req(), parse_pit_mon_ban(), parse_pit_mon_base(), parse_pit_name(), parse_pit_obj_rarity(), parse_pit_room(), parse_pit_spell_ban(), parse_pit_spell_req(), parse_prefs_color(), parse_prefs_expr(), parse_prefs_feat(), parse_prefs_flavor(), parse_prefs_gf(), parse_prefs_inscribe(), parse_prefs_keymap_action(), parse_prefs_keymap_input(), parse_prefs_load(), parse_prefs_message(), parse_prefs_monster(), parse_prefs_object(), parse_prefs_trap(), parse_prefs_window(), parse_profile_cutoff(), parse_profile_name(), parse_profile_params(), parse_profile_room(), parse_profile_streamer(), parse_profile_tunnel(), parse_quest_level(), parse_quest_name(), parse_quest_number(), parse_quest_race(), parse_room_d(), parse_room_n(), parse_room_x(), parse_slots(), parse_store(), parse_trap_appear(), parse_trap_desc(), parse_trap_dice(), parse_trap_effect(), parse_trap_expr(), parse_trap_flags(), parse_trap_graphics(), parse_trap_name(), parse_turnover(), parse_v_d(), parse_v_n(), parse_v_x(), process_pref_file_command(), process_pref_file_layered(), test_alloc0(), test_alloc2(), test_attack0(), test_base0(), test_base_object0(), test_blow0(), test_blow1(), test_charges0(), test_chart0(), test_color0(), test_combat0(), test_d0(), test_desc0(), test_equip0(), test_flags0(), test_flavor0(), test_graphics0(), test_graphics1(), test_height0(), test_history0(), test_i0(), test_info0(), test_magic0(), test_mimic0(), test_min0(), test_msg0(), test_n0(), test_name0(), test_obj_flags0(), test_owner0(), test_phrase0(), test_pile0(), test_play_flags0(), test_power0(), test_priority0(), test_priv(), test_properties0(), test_pval0(), test_skill_device0(), test_skill_dig0(), test_skill_disarm0(), test_skill_melee0(), test_skill_save0(), test_skill_search0(), test_skill_search_freq0(), test_skill_shoot0(), test_skill_stealth0(), test_skill_throw0(), test_slots0(), test_spell_freq0(), test_spells0(), test_stats0(), test_store0(), test_time0(), test_title0(), test_type0(), test_values0(), test_weight0(), and test_x0().

errr parser_reg ( struct parser p,
const char *  fmt,
enum parser_error(*)(struct parser *p func 
)

Registers a parser hook.

Hooks have the following format: <fmt> ::= <name> [<type> <name>]* [?<type> <name>]* <type> ::= int | str | sym | rand | char The first <name> is called the directive for this hook. Any other hooks with the same directive are superseded by this hook. It is an error for a mandatory field to follow an optional field. It is an error for any field to follow a field of type str, since str fields are not delimited and will consume the entire rest of the line.

References parser_hook::func, h, parser::hooks, mem_alloc(), mem_free(), parser_hook::next, parse_specs(), and string_make().

Referenced by init_parse_act(), init_parse_artifact(), init_parse_body(), init_parse_class(), init_parse_constants(), init_parse_ego(), init_parse_feat(), init_parse_flavor(), init_parse_grafmode(), init_parse_hints(), init_parse_history(), init_parse_lore(), init_parse_mon_base(), init_parse_mon_spell(), init_parse_monster(), init_parse_names(), init_parse_object(), init_parse_object_base(), init_parse_p_race(), init_parse_pain(), init_parse_pit(), init_parse_prefs(), init_parse_profile(), init_parse_quest(), init_parse_room(), init_parse_stores(), init_parse_trap(), init_parse_v(), test_char0(), test_char1(), test_int0(), test_int1(), test_opt0(), test_rand0(), test_rand1(), test_reg0(), test_reg1(), test_reg2(), test_reg3(), test_reg4(), test_reg5(), test_reg_int(), test_reg_str(), test_reg_sym(), test_str0(), test_sym0(), test_sym1(), test_syntax0(), test_syntax1(), test_syntax2(), test_uint0(), and test_uint1().

void parser_setpriv ( struct parser p,
void v 
)
void parser_setstate ( struct parser p,
unsigned int  col,
const char *  msg 
)

Sets the parser's detailed error description and field number.

References parser::colno, parser::errmsg, and my_strcpy().

errr remove_flag ( bitflag flags,
const size_t  size,
const char **  flag_table,
const char *  flag_name 
)

References flag, FLAG_END, flag_off(), and lookup_flag().

Referenced by parse_monster_flags_off().

errr run_parser ( struct file_parser fp)

Variable Documentation

const char* parser_error_str[PARSE_ERROR_MAX]

A parser has a list of hooks (which are run across new lines given to parser_parse()) and a list of the set of named values for the current line.

Each hook has a list of specs, which are essentially named formal parameters; when we run a particular hook across a line, each spec in the hook is assigned a value.

Referenced by print_error().