exip
Alpha 0.5.4
|
Defines grammar related functions. More...
#include "grammars.h"
#include "stringManipulate.h"
#include "memManagement.h"
#include "sTables.h"
#include "ioUtil.h"
Go to the source code of this file.
Macros | |
#define | DEF_DOC_GRAMMAR_RULE_NUMBER 2 |
#define | DEF_FRAG_GRAMMAR_RULE_NUMBER 1 |
#define | DEF_ELEMENT_GRAMMAR_RULE_NUMBER 2 |
Functions | |
errorCode | createDocGrammar (EXIPSchema *schema, QNameID *elQnameArr, Index qnameCount) |
Creates an instance of the EXI Built-in Document Grammar or Schema-Informed Document Grammar. More... | |
errorCode | pushGrammar (EXIGrammarStack **gStack, QNameID currQNameID, EXIGrammar *grammar) |
Push a grammar on top of the Grammar Stack. More... | |
void | popGrammar (EXIGrammarStack **gStack) |
Pop a grammar off the top of the Grammar Stack. More... | |
errorCode | createFragmentGrammar (EXIPSchema *schema, QNameID *elQnameArr, Index qnameCount) |
Creates an instance of the EXI Built-in Fragment Grammar or Schema-Informed Fragment Grammar. More... | |
unsigned int | getBitsFirstPartCode (EXIStream *strm, Index prodCount, SmallIndex currentRuleIndx) |
For a given grammar and a rule from it, returns the number of bits needed to encode a production from that rule. More... | |
errorCode | printGrammarRule (SmallIndex nonTermID, GrammarRule *rule, EXIPSchema *schema) |
Prints a grammar rule Note! This is only for debugging purposes! More... | |
Definition in file grammars.c.
#define DEF_DOC_GRAMMAR_RULE_NUMBER 2 |
Definition at line 23 of file grammars.c.
#define DEF_ELEMENT_GRAMMAR_RULE_NUMBER 2 |
Definition at line 25 of file grammars.c.
#define DEF_FRAG_GRAMMAR_RULE_NUMBER 1 |
Definition at line 24 of file grammars.c.
errorCode createDocGrammar | ( | EXIPSchema * | schema, |
QNameID * | elQnameArr, | ||
Index | qnameCount | ||
) |
If elQnameArr is NULL then it creates EXI Built-in Document Grammar, otherwise it creates Schema-Informed Document Grammar with global elements stored (sorted) in elQnameArr
[in,out] | schema | the schema describing the document |
[in] | elQnameArr | array of QNameIds of global element definitions if any; NULL otherwise (schema-less mode) |
[in] | qnameCount | the number of global element definitions if any; 0 otherwise |
Definition at line 27 of file grammars.c.
errorCode createFragmentGrammar | ( | EXIPSchema * | schema, |
QNameID * | elQnameArr, | ||
Index | qnameCount | ||
) |
If elQnameArr is NULL then it creates EXI Built-in Fragment Grammar, otherwise it creates Schema-Informed Fragment Grammar
[in,out] | schema | the schema describing the document |
[in] | elQnameArr | array of QNameIds of element definitions if any; NULL otherwise (schema-less mode) |
[in] | qnameCount | the number of global element definitions if any; 0 otherwise |
Definition at line 240 of file grammars.c.
unsigned int getBitsFirstPartCode | ( | EXIStream * | strm, |
Index | prodCount, | ||
SmallIndex | currentRuleIndx | ||
) |
[in] | strm | EXI stream |
[in] | prodCount | number of productions in the current grammar rule |
[in] | currentRuleIndx | the index of the concrete grammar rule |
Definition at line 320 of file grammars.c.
void popGrammar | ( | EXIGrammarStack ** | gStack) |
[in,out] | gStack | the Grammar stack |
Definition at line 228 of file grammars.c.
errorCode printGrammarRule | ( | SmallIndex | nonTermID, |
GrammarRule * | rule, | ||
EXIPSchema * | schema | ||
) |
[in] | nonTermID | The left hand side nonTerminal of the Rule |
[in] | rule | a Grammar Rule to be printed |
[in] | schema | for string tables |
Definition at line 426 of file grammars.c.
errorCode pushGrammar | ( | EXIGrammarStack ** | gStack, |
QNameID | currQNameID, | ||
EXIGrammar * | grammar | ||
) |
[in,out] | gStack | the Grammar Stack |
[in] | currQNameID | the currently proccessed element QNameID that is having this grammar |
[in] | grammar | a EXI grammar |
Definition at line 214 of file grammars.c.