Make your own free website on

Contents Turbed: A Turbulent Behavior Development System News
In file gparse.hpp:

class GPRule

Specific parsing rule for a token set


Public Methods

o GPRule()
default constructor
o GPRule(GPRule& rule)
create a copy of an existent rule
[more]int Init()
initialize all the basic rule settings
oint add(GPRule *rule)
add a sub rule to this parsing rule
oint del(GPRule *rule)
removes a sub sule
oint copyR(GPRule& rule)
copy another rule into this one
oint parse(char *buff, int buffsize, int pmode )
parse buffer from the actual position to applying this rule and subrules
oint putBack(char *buff, int buffsize, int steps)
puts back the specified bytes in the buffer, or rewinds the ptr.
oint advance(char *buff, int buffsize, int steps)
advance size bytes of the buffer
ochar* analex(char *buff=NULL, int buffsize=GP_DMBUFF_SIZE)
realizes the lexical analisis of the buffer
oint processBuffer(char *buff, int buffsize)
hook function to process the buffer
oint startFirstP()
start the specific conditions for the first pass
oint startSecondP()
start the specific conditions for the second pass
oint firstPass(char *buff, int buffsize)
made the first pass of the parsing
oint secondPass(char *buff, int buffsize)
made the second pass
ovoid setTokName(char *tok)
set the tokens name (value)
ochar* getTokName(void)
get the token name (value)
ovoid setPassR(char pass)
set this rule as a FIRST/SECOND/BOTH pass rule
ochar getPassR(void)
get the pass state of this rule
oint operator==(GPRule& rule)
compare rules (rule==rule)
oint compTok(char *buff, int buffsize=GP_DMBUFF_SIZE)
compare token with buffer
oGPRule& operator=(GPRule& rule)
assign rules
ovoid cleanLists(void)
clean all sub rules list
ovoid print(void)
print this rule contents
o ~GPRule()
free all memory used by this rule

Protected Fields

ochar* tokName
token string representation
ochar rstate
FIRST, SECOND or both pass rule
oint rcur
current rule if has to process subrules
o lRules
list of parsing rules
o lRules1Pass
first pass rules (to solve complex dependencies)
o lRules2Pass
second pass rules (complex file formats, not always needed)


Specific parsing rule for a token set
oint Init()
initialize all the basic rule settings. This func must be called after the class creation to initalize the parsing rules/hierarchy its called in the constructor for correct inheritance initalization.

Direct child classes:

Alphabetic index HTML hierarchy of classes or Java

This software was originally written by Daniel Barrero at the IRIT's Equipe Synthèse d'Images

Generated by doc++