20 #include "EXIParser.h"
22 #include "stringManipulate.h"
26 #include "grammarGenerator.h"
28 #define INITIAL_STATE 0
29 #define SCHEMA_ELEMENT_STATE 1
30 #define SCHEMA_CONTENT_STATE 2
34 #ifdef GRAMMAR_GEN_SCHEMA
76 static errorCode xsd_fatalError(
const errorCode code,
const char* msg,
void* app_data);
77 static errorCode xsd_startDocument(
void* app_data);
78 static errorCode xsd_endDocument(
void* app_data);
80 static errorCode xsd_endElement(
void* app_data);
83 static errorCode xsd_namespaceDeclaration(
const String ns,
const String prefix,
boolean isLocalElementNS,
void* app_data);
84 static errorCode xsd_boolData(
boolean bool_val,
void* app_data);
93 static const char* elemStrings[] =
136 static const char* attrStrings[] =
158 static const char TRUE_CHAR_STR[] =
"true";
159 static const char FALSE_CHAR_STR[] =
"false";
222 #ifdef GRAMMAR_GEN_SCHEMA
250 static errorCode xsd_fatalError(
const errorCode code,
const char* msg,
void* app_data)
256 static errorCode xsd_startDocument(
void* app_data)
262 static errorCode xsd_endDocument(
void* app_data)
359 if(prevEntry ==
NULL)
368 if(treeTableEntry ==
NULL)
385 if(lastEntry ==
NULL)
393 lastEntry = lastEntry->
next;
395 lastEntry->
next = treeTableEntry;
400 initEntryContext(treeTableEntry);
418 #if EXIP_DEBUG == ON && DEBUG_GRAMMAR_GEN == ON && EXIP_DEBUG_LEVEL <= WARNING
432 static errorCode xsd_endElement(
void* app_data)
501 for(i = 0; i < nsTable.
count; i++)
630 #if EXIP_DEBUG == ON && DEBUG_GRAMMAR_GEN == ON && EXIP_DEBUG_LEVEL <= WARNING
657 #if EXIP_DEBUG == ON && DEBUG_GRAMMAR_GEN == ON && EXIP_DEBUG_LEVEL <= WARNING
677 #if DEBUG_GRAMMAR_GEN == ON && EXIP_DEBUG_LEVEL == INFO
703 static errorCode xsd_boolData(
boolean bool_val,
void* app_data)
744 sprintf(tmp_str,
"%ld", (
long) int_val);
769 static errorCode xsd_namespaceDeclaration(
const String ns,
const String pfx,
boolean isLocalElementNS,
void* app_data)
780 #if DEBUG_GRAMMAR_GEN == ON && EXIP_DEBUG_LEVEL == INFO
813 #if DEBUG_GRAMMAR_GEN == ON && EXIP_DEBUG_LEVEL == INFO
815 static void printNameTypeBase(
String *attrPtrs,
char* indent)
837 #define FULL_EXPANSION
841 char indent[101] =
" ";
844 printNameTypeBase(treeTableEntryIn->
attributePointers, indent + (100 - indentIdx));
846 #ifdef FULL_EXPANSION