exip  Alpha 0.5.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
protoGrammars.c File Reference

EXI Proto-Grammars implementation. More...

#include "protoGrammars.h"
#include "memManagement.h"
#include "ioUtil.h"
#include "dynamicArray.h"

Go to the source code of this file.

Macros

#define RULE_EXTENSION_FACTOR   20
 
#define PRODUTION_EXTENSION_FACTOR   20
 

Functions

errorCode createProtoGrammar (Index rulesDim, ProtoGrammar *pg)
 Creates and allocates memory for new proto grammar. More...
 
errorCode addProtoRule (ProtoGrammar *pg, Index prodDim, ProtoRuleEntry **ruleEntry)
 Add an empty rule to a proto grammar. More...
 
errorCode addProduction (ProtoRuleEntry *ruleEntry, EventType eventType, Index typeId, QNameID qnameID, SmallIndex nonTermID)
 Add a production to a particular proto rule. More...
 
errorCode convertProtoGrammar (AllocList *memlist, ProtoGrammar *pg, EXIGrammar *exiGrammar)
 Create a new EXI grammar from existing proto grammar. More...
 
errorCode cloneProtoGrammar (ProtoGrammar *src, ProtoGrammar *dest)
 Clones a proto grammar instance. More...
 
void destroyProtoGrammar (ProtoGrammar *pg)
 Frees the allocated memory for a proto grammar. More...
 
errorCode printProtoGrammarRule (SmallIndex nonTermID, ProtoRuleEntry *rule)
 
errorCode printProtoGrammar (ProtoGrammar *pgr)
 

Detailed Description

Date
May 11, 2011
Author
Rumen Kyusakov
Version
0.5
[Revision] $Id$

Definition in file protoGrammars.c.

Macro Definition Documentation

#define PRODUTION_EXTENSION_FACTOR   20

Definition at line 18 of file protoGrammars.c.

#define RULE_EXTENSION_FACTOR   20

Definition at line 17 of file protoGrammars.c.

Function Documentation

errorCode addProduction ( ProtoRuleEntry ruleEntry,
EventType  eventType,
Index  typeId,
QNameID  qnameID,
SmallIndex  nonTermID 
)
Parameters
[in,out]ruleEntrythe rule to which the production is added
[in]eventTypeevent type of the production
[in]typeIdindex of the type of the production in the simple type table
[in]qnameIDqnameId of the production
[in]nonTermIDof the production
Returns
Error handling code

Definition at line 42 of file protoGrammars.c.

errorCode addProtoRule ( ProtoGrammar pg,
Index  prodDim,
ProtoRuleEntry **  ruleEntry 
)
Parameters
[in,out]pgthe proto grammar
[in]prodDiminitial number of productions in the rule
[in]ruleEntrypointer to the rule entry
Returns
Error handling code

Definition at line 32 of file protoGrammars.c.

errorCode cloneProtoGrammar ( ProtoGrammar src,
ProtoGrammar dest 
)
Parameters
[in]srcthe source proto-grammar
[out]desta pointer to the newly created proto grammar
Returns
Error handling code

Definition at line 103 of file protoGrammars.c.

errorCode convertProtoGrammar ( AllocList memlist,
ProtoGrammar pg,
EXIGrammar exiGrammar 
)
Parameters
[in,out]memlistA list storing the memory allocations for the new EXI grammar
[in]pgthe source proto-grammar
[out]exiGrammara pointer to the newly created EXI grammar
Returns
Error handling code

Definition at line 58 of file protoGrammars.c.

errorCode createProtoGrammar ( Index  rulesDim,
ProtoGrammar pg 
)
Parameters
[in]rulesDiminitial number of the rules in the protogrammar
[out]pgan empty proto-grammar
Returns
Error handling code

Definition at line 25 of file protoGrammars.c.

void destroyProtoGrammar ( ProtoGrammar pg)
Parameters
[out]pgthe proto-grammar to be removed

Definition at line 127 of file protoGrammars.c.

errorCode printProtoGrammar ( ProtoGrammar pgr)

Definition at line 220 of file protoGrammars.c.

errorCode printProtoGrammarRule ( SmallIndex  nonTermID,
ProtoRuleEntry rule 
)

Definition at line 139 of file protoGrammars.c.