xmllex.h File Reference

Lexical analyzer functions to be used by Yacc. More...

#include <LibXmlKit/xmltoken.h>

Go to the source code of this file.

Classes

struct  XmlRWord
 Reserved word information for XML lexical analyzer. More...

Defines

#define YYPURE

Typedefs

typedef XmlRWordXmlRWordPtr
typedef const XmlRWordXmlConstRWordPtr

Functions

int xml_lex (XmlTokenPtr token)
 Main function for lexical analyzer.
void xml_lex_setup (XmlDoc *doc, XmlConstRWordPtr array)
 Setup the environment for lexical analyzer.
void xml_lex_finish (void)
 Release resources for lexical analyzer.
void xml_lex_error (const char *message)
 Print the error message to error stream.


Detailed Description

Lexical analyzer functions to be used by Yacc.

Date:
2004.02.14
Author:
Steel Wheels Project
Copyright
Copyright (C) 2004 Steel Wheels Project. All right reserved.
Introduction
This file contains Functions for lexical analysis of XML data. You can use yacc or bison for syntax check of XML documentation. The function xml_lex() is designed to replace yylex() generated by flex.
Bug?
This function uses YYPURE macro to get re-entrant interface of yylex(). I don't know the macro can be used for the other lex system except flex.

Define Documentation

#define YYPURE
 

Macro to generate re-entrant parser.


Typedef Documentation

typedef const XmlRWord* XmlConstRWordPtr
 

Const pointer of XmlRWord

typedef XmlRWord* XmlRWordPtr
 

Pointer of XmlRWord


Function Documentation

int xml_lex XmlTokenPtr  token  ) 
 

Main function for lexical analyzer.

Returns:
Type of token defined in yacc header.
Parameters:
token token Destination data to store current token.
Description
Main function for lexical analyzer. This function must be compatible with lex's output.

void xml_lex_error const char *  message  ) 
 

Print the error message to error stream.

Parameters:
message Source message.
Description
Print error message to the error stream.

void xml_lex_finish void   ) 
 

Release resources for lexical analyzer.

Description
Release resources for lexical analyzer. You can not call functions for XML processing after calling this method. If you use the analyzer again, call xml_lex_setup() function.

void xml_lex_setup XmlDoc doc,
XmlConstRWordPtr  array
 

Setup the environment for lexical analyzer.

Parameters:
doc Source XML documentation.
array Array of reserved words for element name.
Description
Setup the environment for lexical analyzer.


Generated on Fri Feb 3 02:47:29 2006 for LibXmlKit by  doxygen 1.4.5