[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /global/new_parse.c</h2>
This file contains all the code to support and run the text parsing
system used by discworld.   This is called 'add_command', please see
help on add_command for a more detailed listing.<p>Written by Pinkfish
<h2>Inherits</h2>
This class inherits the following classes <a href="global.command.c.shtml">/global/command.c</a><h2>Includes</h2>
This class includes the following files <a href="include.obj_parser.h.shtml">/include/obj_parser.h</a>, <a href="include.function.h.shtml">/include/function.h</a>, <a href="include.command.h.shtml">/include/command.h</a>, <a href="include.soul.h.shtml">/include/soul.h</a>, <a href="include.user_parser.h.shtml">/include/user_parser.h</a> and <a href="include.creator.h.shtml">/include/creator.h</a><h2>Class Index</h2>
<ul><li><a href="#class_fail_mess_data">fail_mess_data</a>
</ul><h2>Method index</h2>
<dl><ul>
<li><a href="#add_command">add_command</a>(string, object, mixed, function)<br/>
The id is a useful thingy so that things can remember which pattern was 
parsed.
<li><a href="#add_failed_mess">add_failed_mess</a>(object, string, mixed *)<li><a href="#add_succeeded">add_succeeded</a>(mixed)<br/>
This is called by the object the command is being passed on to find
whether or not it succeeded on the objects it was passed.
<li><a href="#add_succeeded_mess">add_succeeded_mess</a>(object, mixed, object *)<li><a href="#check_if_allowed">check_if_allowed</a>(object)<li><a href="#check_if_creator">check_if_creator</a>(object)<li><a href="#check_living">check_living</a>(object)<li><a href="#create_message">create_message</a>(string *, int *, mixed *, object *, int)<li><a href="#get_fail_messages">get_fail_messages</a>(string, object *)<li><a href="#my_find_match">my_find_match</a>(string, object *, int)<li><a href="#new_parser">new_parser</a>(string)<br/>
This method does all the real work for add_command parsing.
<li><a href="#pattern_match">pattern_match</a>(string *, mixed *)<li><a href="#print_special_messages">print_special_messages</a>(string)<li><a href="#query_failed_message_exists">query_failed_message_exists</a>(object)<br/>
This method checks to see if the given object has already added a failed
message yet or not.
<li><a href="#query_p_commands">query_p_commands</a>()<br/>
This method returns the current internal set of commands.
<li><a href="#query_p_objects">query_p_objects</a>()<br/>
This method returns the current mapping between objects and commands.
<li><a href="#query_parse_command">query_parse_command</a>(string)<br/>
This method returns the information associated with the specific
command.
<li><a href="#query_parse_command_objects">query_parse_command_objects</a>(string)<br/>
This method returns the objects associated with the parse command.
<li><a href="#query_succ_mess_dir">query_succ_mess_dir</a>()<br/>
This method returns the objects which have success messages already
attached for.
<li><a href="#query_succ_mess_indir">query_succ_mess_indir</a>()<br/>
This method returns all the indirect objects used in the success
messages.
<li><a href="#query_word_list">query_word_list</a>(string)<li><a href="#remove_object">remove_object</a>(mixed, int)<li><a href="#setup_failed_mess">setup_failed_mess</a>(class obj_match)<li><a href="#syntax_messages">syntax_messages</a>(string)</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="add_command">
add_command</a><pre>
varargs int add_command(string cmd,
                        object ob,
                        mixed format,
                        function funct)
</pre></br>
The id is a useful thingy so that things can remember which pattern was 
parsed.


<ul><a name="add_failed_mess">
add_failed_mess</a><pre>
void add_failed_mess(object dir,
                     string mess,
                     mixed * in_dir)
</pre>
<ul><a name="add_succeeded">
add_succeeded</a><pre>
int add_succeeded(mixed ob)
</pre></br>
This is called by the object the command is being passed on to find
whether or not it succeeded on the objects it was passed... and which
ones. This can be passed an object.. or an array of objects.
Share and enjoy.


<ul><a name="add_succeeded_mess">
add_succeeded_mess</a><pre>
int add_succeeded_mess(object dir,
                       mixed incoming_mess,
                       object * in_dir)
</pre>
<ul><a name="check_if_allowed">
check_if_allowed</a><pre>
int check_if_allowed(object ob)
</pre>
<ul><a name="check_if_creator">
check_if_creator</a><pre>
int check_if_creator(object ob)
</pre>
<ul><a name="check_living">
check_living</a><pre>
int check_living(object ob)
</pre>
<ul><a name="create_message">
create_message</a><pre>
varargs string create_message(string * bits,
                              int * matches,
                              mixed * pattern,
                              object * dir,
                              int flag)
</pre>
<ul><a name="get_fail_messages">
get_fail_messages</a><pre>
string get_fail_messages(string verb,
                         object * fail_obs)
</pre>
<ul><a name="my_find_match">
my_find_match</a><pre>
class obj_match my_find_match(string pattern,
                              object * where,
                              int type)
</pre>
<ul><a name="new_parser">
new_parser</a><pre>
nomask int new_parser(string str)
</pre></br>
This method does all the real work for add_command parsing.


<ul><a name="pattern_match">
pattern_match</a><pre>
int * pattern_match(string * bits,
                    mixed * pattern)
</pre>
<ul><a name="print_special_messages">
print_special_messages</a><pre>
void print_special_messages(string verb)
</pre>
<ul><a name="query_failed_message_exists">
query_failed_message_exists</a><pre>
int query_failed_message_exists(object dir)
</pre></br>
This method checks to see if the given object has already added a failed
message yet or not.   This is checking for a direct object, not an 
indirect object.
<br/><ul>
<li><b>Parameters:</b>
<br/>dir - the object adding the failed message
<li><b>Returns:</b>
<br/>0 if not found, 1 if found
<li><b>See also:</b>
<br/><a href="#add_failed_mess">add_failed_mess()
</a></dl>

<ul><a name="query_p_commands">
query_p_commands</a><pre>
mapping query_p_commands()
</pre></br>
This method returns the current internal set of commands.
<p>
([ "command_name" :<br>
({ ({ pattern_weight, pattern_str, nn, object, function }) })<br>
])
<br/><ul>
<li><b>Returns:</b>
<br/>the current commands list
<li><b>See also:</b>
<br/><a href="#query_p_objects">query_p_objects()
</a></dl>

<ul><a name="query_p_objects">
query_p_objects</a><pre>
mapping query_p_objects()
</pre></br>
This method returns the current mapping between objects and commands.<br>
([ object : ({ "cmd1", "cmd2", ... }), ... ])
<p>
This mapping is used when the object leaves the environment to make
the command updating more efficent.
<br/><ul>
<li><b>Returns:</b>
<br/>the current object/command mapping
<li><b>See also:</b>
<br/><a href="#query_p_commands">query_p_commands()
</a></dl>

<ul><a name="query_parse_command">
query_parse_command</a><pre>
mixed * query_parse_command(string name)
</pre></br>
This method returns the information associated with the specific
command.  This should only be used for debug.
<br/><ul>
<li><b>Parameters:</b>
<br/>name - the command name to return info on
<li><b>Returns:</b>
<br/>the information associated with the command

</dl>

<ul><a name="query_parse_command_objects">
query_parse_command_objects</a><pre>
object * query_parse_command_objects(string name)
</pre></br>
This method returns the objects associated with the parse command.
<br/><ul>
<li><b>Parameters:</b>
<br/>name - the command name to return the objects for
<li><b>Returns:</b>
<br/>the objects associated with the command

</dl>

<ul><a name="query_succ_mess_dir">
query_succ_mess_dir</a><pre>
object * query_succ_mess_dir()
</pre></br>
This method returns the objects which have success messages already
attached for.   This allows you to determine which objects already hace
a success message available.   This array is added to by both the
add_succeeded_mess and add_failed_mess methods, it disable the
autogeneration of these messages.
<br/><ul>
<li><b>Returns:</b>
<br/>the succeeded message objects
<li><b>See also:</b>
<br/><a href="#add_succeeded_mess">add_succeeded_mess()</a> and <a href="#add_failed_mess">add_failed_mess()
</a></dl>

<ul><a name="query_succ_mess_indir">
query_succ_mess_indir</a><pre>
object * query_succ_mess_indir()
</pre></br>
This method returns all the indirect objects used in the success
messages.
<br/><ul>
<li><b>Returns:</b>
<br/>the success message

</dl>

<ul><a name="query_word_list">
query_word_list</a><pre>
string * query_word_list(string list)
</pre>
<ul><a name="remove_object">
remove_object</a><pre>
int remove_object(mixed ob,
                  int was_env)
</pre>
<ul><a name="setup_failed_mess">
setup_failed_mess</a><pre>
void setup_failed_mess(class obj_match failed_match)
</pre>
<ul><a name="syntax_messages">
syntax_messages</a><pre>
int syntax_messages(string str)
</pre>

<h2>Classes</h2>
These are nice data types for dealing with...  Data!<p>
<ul>
<li><a name="class_fail_mess_data">
fail_mess_data</a><pre>
class fail_mess_data {
                       object * direct;
                       object * indirect;
                       int weight;
}

</pre>
</ul>
[an error occurred while processing this directive]

