From 3a16df4fb3b014b318615e31f008ef14a66abd96 Mon Sep 17 00:00:00 2001 From: "Mirar (Pontus Hagland)" <pike@sort.mirar.org> Date: Sat, 12 Jun 1999 21:44:30 +0200 Subject: [PATCH] more doc Rev: src/modules/Parser/html.c:1.20 Rev: src/modules/Parser/module.pmod.in:1.3 --- src/modules/Parser/html.c | 29 ++++++++++++++++++++++++++--- src/modules/Parser/module.pmod.in | 12 ++++++------ 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/modules/Parser/html.c b/src/modules/Parser/html.c index 73534dee4a..f2c1694249 100644 --- a/src/modules/Parser/html.c +++ b/src/modules/Parser/html.c @@ -42,6 +42,18 @@ extern struct program *parser_html_program; /* **! module Parser **! class HTML +**! This is a simple parser for SGML structured markups. +**! It's not really HTML, but it's useful for that +**! purpose. +**! +**! The simple way to use it is to give it some information +**! about available tags and containers, and what +**! callbacks those is to call. +**! +**! The object is easily reused, by calling the <ref>clone</ref>() +**! function. +**! +**! see also: add_tag, add_container, clone */ struct location @@ -397,9 +409,9 @@ static void exit_html_struct(struct object *o) /****** setup callbacks *****************************/ /* -**! method _set_tag_callback(function to_call) -**! method _set_entity_callback(function to_call) -**! method _set_data_callback(function to_call) +**! method void _set_tag_callback(function to_call) +**! method void _set_entity_callback(function to_call) +**! method void _set_data_callback(function to_call) **! This functions set up the parser object to **! call the given callbacks upon tags, entities **! and/or data. @@ -411,6 +423,9 @@ static void exit_html_struct(struct object *o) **! Note that no parsing of the contents has been done. **! Both endtags and normal tags are called, there is **! no container parsing. +**! note: +**! The callbacks will _only_ be called if there isn't +**! another tag/container/entity handler for these. **! */ @@ -568,6 +583,14 @@ static void html_add_entities(INT32 args) pop_n_elems(args); } +/* +**! method mapping tags() +**! method mapping containers() +**! method mapping entities() +**! Returns the current callback settings. +**! see also: add_tag, add_tags, add_container, add_containers, add_entity, add_entities +*/ + static void html_tags(INT32 args) { pop_n_elems(args); diff --git a/src/modules/Parser/module.pmod.in b/src/modules/Parser/module.pmod.in index 3089d84fe4..7f2f222d5a 100644 --- a/src/modules/Parser/module.pmod.in +++ b/src/modules/Parser/module.pmod.in @@ -1,5 +1,5 @@ /* - * $Id: module.pmod.in,v 1.2 1999/06/12 19:13:08 mirar Exp $ + * $Id: module.pmod.in,v 1.3 1999/06/12 19:44:30 mirar Exp $ * */ @@ -126,8 +126,8 @@ class SGML private static object p=HTML(); -//! static void create() -//! static void create(string filename) +//! method void create() +//! method void create(string filename) //! This object is created with this filename. //! It's passed to all created tags, for debug and trace purposes. //! note: @@ -142,9 +142,9 @@ class SGML { if (data!="") res[0]+=({data}); return ({}); }); } -//! static object feed(string s) -//! static array finish() -//! static array result(string s) +//! method object feed(string s) +//! method array finish() +//! method array result(string s) //! Feed new data to the object, or finish the stream. //! No result can be used until finish() is called. //! -- GitLab