Types and functions describing EXI grammars.  
More...
#include "errorHandle.h"
#include "procTypes.h"
#include "contentHandler.h"
Go to the source code of this file.
 | 
| 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  | createDocGrammar (EXIPSchema *schema, QNameID *elQnameArr, Index qnameCount) | 
|   | Creates an instance of the EXI Built-in Document Grammar or Schema-Informed Document Grammar.  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...
  | 
|   | 
- Date
 - Sep 7, 2010 
 
- Author
 - Rumen Kyusakov 
 
- Version
 - 0.5 
 
- [Revision] $Id: grammars.h 335 2014-05-05 18:23:26Z kjussakov $
 
Definition in file grammars.h.
 
      
        
          | #define DEFAULT_PROD_ARRAY_DIM   10 | 
        
      
 
 
      
        
          | #define GET_ELEM_GRAMMAR_QNAMEID | 
          ( | 
            | 
          schema,  | 
        
        
           | 
           | 
            | 
          qnameID  | 
        
        
           | 
          ) | 
           |    GET_LN_URI_QNAME((schema)->uriTable, qnameID).elemGrammar == INDEX_MAX?NULL:&((schema)->grammarTable.grammar[GET_LN_URI_QNAME((schema)->uriTable, qnameID).elemGrammar]) | 
        
      
 
Returns NULL if the grammar does not exists in the SchemaGrammarTable (i.e. the index of the grammar in the string table is INDEX_MAX) 
Definition at line 32 of file grammars.h.
 
 
      
        
          | #define GET_TYPE_GRAMMAR_QNAMEID | 
          ( | 
            | 
          schema,  | 
        
        
           | 
           | 
            | 
          qnameID  | 
        
        
           | 
          ) | 
           |    GET_LN_URI_QNAME((schema)->uriTable, qnameID).typeGrammar == INDEX_MAX?NULL:&((schema)->grammarTable.grammar[GET_LN_URI_QNAME((schema)->uriTable, qnameID).typeGrammar]) | 
        
      
 
Returns NULL if the grammar does not exists in the SchemaGrammarTable (i.e. the index of the grammar in the string table is INDEX_MAX) 
Definition at line 39 of file grammars.h.
 
 
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
- Parameters
 - 
  
    | [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  | 
  
   
- Returns
 - Error handling code 
 
Definition at line 27 of file grammars.c.
 
 
If elQnameArr is NULL then it creates EXI Built-in Fragment Grammar, otherwise it creates Schema-Informed Fragment Grammar
- Parameters
 - 
  
    | [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  | 
  
   
- Returns
 - Error handling code 
 
Definition at line 240 of file grammars.c.
 
 
- Parameters
 - 
  
    | [in] | strm | EXI stream  | 
    | [in] | prodCount | number of productions in the current grammar rule  | 
    | [in] | currentRuleIndx | the index of the concrete grammar rule  | 
  
   
- Returns
 - number of bits needed to encode a production 
 
Definition at line 320 of file grammars.c.
 
 
- Parameters
 - 
  
    | [in,out] | gStack | the Grammar stack  | 
  
   
Definition at line 228 of file grammars.c.
 
 
- Parameters
 - 
  
    | [in] | nonTermID | The left hand side nonTerminal of the Rule  | 
    | [in] | rule | a Grammar Rule to be printed  | 
    | [in] | schema | for string tables  | 
  
   
- Returns
 - Error handling code 
 
Definition at line 426 of file grammars.c.
 
 
- Parameters
 - 
  
    | [in,out] | gStack | the Grammar Stack  | 
    | [in] | currQNameID | the currently proccessed element QNameID that is having this grammar  | 
    | [in] | grammar | a EXI grammar  | 
  
   
- Returns
 - Error handling code 
 
Definition at line 214 of file grammars.c.