GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> XLX / dev > parser / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

state.c File Reference

Change of state on entering and leaving an element. More...

#include <XLX_p.h>
#include <EXPAT/expat.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

Functions

int XLX_initState (XLX_state *state, unsigned int stackLimit, void *stackSeed, XLX_pDoctype doctype, XLX_pEnter enter, XLX_pExit exit, XLX_pChar character, int verbose)
 Initialise the state of the parser.
void XLX_doctype (void *data, const char *name, const char *sysId, const char *pubId, int intSubset)
 Handle a doctype declaration.
void XLX_start (void *data, const char *element, const char **attribute)
 Handle a start tag.
void XLX_end (void *data, const char *element)
 Handle an end tag.
void XLX_character (void *data, const char *element, int len)
 Handle a character element.
void XLX_printout_down (XLX_state *state, const char *element)
 Print a starting tag.
void XLX_printout_up (XLX_state *state, const char *element)
 Print an ending tag.
void XLX_character_noop (XLX_state *state, const char *element, int len)
 No-op character element handler.
void XLX_enter_noop (XLX_state *state, const char **attribute)
 No-op enter element handler.
void XLX_exit_noop (XLX_state *state)
 No-op exit element handler.
void XLX_character_tag (XLX_state *state, const char *element, int len)
 Handle a character element inside a parent tag by delegating the work to the first child.


Detailed Description

Change of state on entering and leaving an element.

Author:
James Swain & Owen Saxton
Id
state.c,v 1.18 2011/03/25 21:01:49 saxton Exp

Function Documentation

void XLX_character ( void *  data,
const char *  element,
int  len 
)

Handle a character element.

Parameters:
data Pointer to the current state of the parser
element Character element
len Length of the character element

References _XLX_state::character, _XLX_basic_tag::character, _XLX_state::error, _XLX_state::st, and XLX_peek().

Referenced by XLX_character_tag(), and XLX_parse().

void XLX_character_noop ( XLX_state state,
const char *  element,
int  len 
)

No-op character element handler.

Parameters:
state Pointer to the current state of the parser
element The text string from the current element
len Length of element

void XLX_character_tag ( XLX_state state,
const char *  element,
int  len 
)

Handle a character element inside a parent tag by delegating the work to the first child.

If there are valid characters in the character element then the first child of the current tag is pushed onto the stack and then XLX_character is called to handle the character parsing. After the parsing is complete the child is popped off the stack.

Parameters:
state Pointer to the current state of the parser
element Character element
len Length of the character element

References _XLX_parent_tag::child, _XLX_state::st, XLX_character(), XLX_ischar(), XLX_peek(), XLX_pop(), and XLX_push().

void XLX_doctype ( void *  data,
const char *  name,
const char *  sysId,
const char *  pubId,
int  intSubset 
)

Handle a doctype declaration.

Parameters:
data Pointer to the current state of the parser
name The doctype name
sysId The system ID name
pubId The public ID name
intSubset True if internal subset

References _XLX_state::doctype.

Referenced by XLX_parse().

void XLX_end ( void *  data,
const char *  element 
)

Handle an end tag.

Parameters:
data Pointer to the current state of the parser
element Element name from end tag

References _XLX_state::error, _XLX_state::exit, _XLX_parent_tag::exit, _XLX_basic_tag::name, _XLX_state::parser, _XLX_state::st, _XLX_state::verbose, XLX_dispFileName(), XLX_pop(), XLX_printout_up(), and _XLX_basic_tag::xType.

Referenced by XLX_parse().

void XLX_enter_noop ( XLX_state state,
const char **  attribute 
)

No-op enter element handler.

Parameters:
state Pointer to the current state of the parser
attribute Attribute list for the current element

void XLX_exit_noop ( XLX_state state  ) 

No-op exit element handler.

Parameters:
state Pointer to the current state of the parser

int XLX_initState ( XLX_state state,
unsigned int  stackLimit,
void *  stackSeed,
XLX_pDoctype  doctype,
XLX_pEnter  enter,
XLX_pExit  exit,
XLX_pChar  character,
int  verbose 
)

Initialise the state of the parser.

Parameters:
state Pointer to the state information
stackLimit Initial depth of the stack
stackSeed Initial item on the stack
doctype Action on encountering a doctype declaration
enter Parser default action on encountering an enter tag
exit Parser default action on encountering an exit tag
character Parser default action on encountering a character tag
verbose Verbosity level of the parser: 0 is quiet, 1 displays file name after error messages, > 1 displays information messages
Return values:
0 Success
-1 Insufficient memory

References _XLX_state::character, _XLX_state::doctype, _XLX_state::enter, _XLX_state::error, _XLX_state::exit, _XLX_state::fName, _XLX_state::parser, _XLX_state::st, _XLX_state::verbose, XLX_initStack(), and XLX_push().

void XLX_printout_down ( XLX_state state,
const char *  element 
)

Print a starting tag.

Parameters:
state Pointer to the current state of the parser
element Text string from the current tag

References _XLX_state::st, _XLX_stack::used, and _XLX_state::verbose.

Referenced by XLX_start().

void XLX_printout_up ( XLX_state state,
const char *  element 
)

Print an ending tag.

Parameters:
state Pointer to the current state of the parser
element Text string from the current tag

References _XLX_state::st, _XLX_stack::used, and _XLX_state::verbose.

Referenced by XLX_end().

void XLX_start ( void *  data,
const char *  element,
const char **  attribute 
)

Handle a start tag.

Parameters:
data Pointer to the current state of the parser
element Element name from start tag
attribute Attribute list from the start tag

References _XLX_parent_tag::base, _XLX_parent_tag::child, _XLX_state::enter, _XLX_parent_tag::enter, _XLX_state::error, _XLX_basic_tag::name, _XLX_state::parser, _XLX_parent_tag::self, _XLX_state::st, _XLX_state::verbose, XLX_dispFileName(), XLX_peek(), XLX_printout_down(), XLX_push(), and _XLX_basic_tag::xType.

Referenced by XLX_parse().


Generated on Mon Mar 28 10:23:33 2011 by  doxygen 1.5.8