18 #include "procTypes.h"
31 fprintf(outfile,
"\n/** GLOBAL ELEMENT GRAMMARS **/\n\n");
37 if(tmpGrammar !=
NULL)
41 printf(
"\n ERROR: OUT_TEXT output format!");
48 fprintf(outfile,
"\n/** GLOBAL TYPE GRAMMARS **/\n\n");
54 if(tmpGrammar !=
NULL)
58 printf(
"\n ERROR: OUT_TEXT output format!");
78 fprintf(outfile,
"/** AUTO-GENERATED: %.24s\n * Copyright (c) 2010 - 2011, Rumen Kyusakov, EISLAB, LTU\n * $Id$ */\n\n", ctime(&now));
80 fprintf(outfile,
"/** Compilation parameters:\n");
83 fprintf(outfile,
" * Compiled for possible deviations from the schema:\n * URLs: %d\n * Local names: %d\n * Prefixes: %d\n * Built-in grammars: %d */\n\n", dvis.
url, dvis.
ln, dvis.
pfx, dvis.
grammar);
86 fprintf(outfile,
" * Compiled for no deviations from the schema! (lower memory usage) */\n\n");
89 fprintf(outfile,
"#include \"procTypes.h\"\n\n");
90 fprintf(outfile,
"#define CONST\n\n");
101 fprintf(outfile,
"static CONST EXIGrammar %sgrammarTable[%u] =\n{\n", prefix, (
unsigned int) schemaPtr->
grammarTable.
count + dvis.
grammar);
105 fprintf(outfile,
" {%srule_%u, %u, %u},\n",
107 (
unsigned int) grIter,
108 (
unsigned int) tmpGrammar->
props,
109 (
unsigned int) tmpGrammar->
count);
112 for(grIter = 0; grIter < dvis.
grammar; grIter++)
114 fprintf(outfile,
" {NULL, 0, 0},\n");
117 fprintf(outfile,
"};\n\n");
135 fprintf(outfile,
"static CONST SimpleType %ssimpleTypes[%u] =\n{\n", prefix, (
unsigned int) schemaPtr->
simpleTypeTable.
count);
140 for(stId = 0; stId < stIdMax; stId++)
143 " {%d, %d, 0x%016lX, 0x%016lX}%s",
148 stId==(stIdMax-1) ?
"\n};\n\n" :
",\n");
157 "CONST EXIPSchema %sschema =\n{\n",
161 fprintf(outfile,
" {NULL, NULL},\n");
165 " {{sizeof(UriEntry), %u, %u}, %suriEntry, %u},\n",
166 (
unsigned int) count,
167 (
unsigned int) count + dvis.
url,
169 (
unsigned int) count);
172 " {%sdocGrammarRule, %u, %u},\n",
179 " {{sizeof(SimpleType), %u, %u}, %ssimpleTypes, %u},\n",
180 (
unsigned int) count,
181 (
unsigned int) count,
183 (
unsigned int) count);
187 " {{sizeof(EXIGrammar), %u, %u}, %sgrammarTable, %u},\n %u,\n",
188 (
unsigned int) count,
189 (
unsigned int) count + dvis.
grammar,
191 (
unsigned int) count,
192 (
unsigned int) count);
196 " {{sizeof(EnumDefinition), %u, %u}, %s%s, %u}\n};\n\n",
198 (
unsigned int) count,
199 (
unsigned int) count,
200 count == 0?
"":prefix, count == 0?
"NULL":
"enumTable",
201 (
unsigned int) count);