exip
Alpha 0.5.4
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
src
grammarGen
include
treeTableSchema.h
Go to the documentation of this file.
1
/*==================================================================*\
2
| EXIP - Embeddable EXI Processor in C |
3
|--------------------------------------------------------------------|
4
| This work is licensed under BSD 3-Clause License |
5
| The full license terms and conditions are located in LICENSE.txt |
6
\===================================================================*/
7
19
#ifndef TREETABLESCHEMA_H_
20
#define TREETABLESCHEMA_H_
21
29
#include "procTypes.h"
30
#include "
dynamicArray.h
"
31
#include "
protoGrammars.h
"
32
#include "
hashtable.h
"
33
#include "grammarGenerator.h"
34
47
enum
ElemEnum
48
{
49
ELEMENT_ELEMENT
=0,
50
ELEMENT_ATTRIBUTE
=1,
51
ELEMENT_CHOICE
=2,
52
ELEMENT_COMPLEX_TYPE
=3,
53
ELEMENT_COMPLEX_CONTENT
=4,
54
ELEMENT_GROUP
=5,
55
ELEMENT_IMPORT
=6,
56
ELEMENT_SEQUENCE
=7,
57
ELEMENT_ALL
=8,
58
ELEMENT_EXTENSION
=9,
59
ELEMENT_RESTRICTION
=10,
60
ELEMENT_SIMPLE_CONTENT
=11,
61
ELEMENT_ANY
=12,
62
ELEMENT_SIMPLE_TYPE
=13,
63
ELEMENT_MIN_INCLUSIVE
=14,
64
ELEMENT_ANNOTATION
=15,
65
ELEMENT_DOCUMENTATION
=16,
66
ELEMENT_MAX_LENGTH
=17,
67
ELEMENT_MAX_INCLUSIVE
=18,
68
ELEMENT_LIST
=19,
69
ELEMENT_UNION
=20,
70
ELEMENT_ATTRIBUTE_GROUP
=21,
71
ELEMENT_ANY_ATTRIBUTE
=22,
72
ELEMENT_ENUMERATION
=23,
73
ELEMENT_KEY
=24,
74
ELEMENT_SELECTOR
=25,
75
ELEMENT_FIELD
=26,
76
ELEMENT_NOTATION
=27,
77
ELEMENT_INCLUDE
=28,
78
ELEMENT_REDEFINE
=29,
79
ELEMENT_MIN_EXCLUSIVE
=30,
80
ELEMENT_MAX_EXCLUSIVE
=31,
81
ELEMENT_TOTAL_DIGITS
=32,
82
ELEMENT_FRACTION_DIGITS
=33,
83
ELEMENT_LENGTH
=34,
84
ELEMENT_MIN_LENGTH
=35,
85
ELEMENT_WHITE_SPACE
=36,
86
ELEMENT_PATTERN
=37,
87
ELEMENT_APPINFO
=38,
88
ELEMENT_VOID
=39
89
};
90
91
typedef
enum
ElemEnum
ElemEnum
;
92
94
enum
AttrEnum
95
{
96
ATTRIBUTE_NAME
=0,
97
ATTRIBUTE_TYPE
=1,
98
ATTRIBUTE_REF
=2,
99
ATTRIBUTE_MIN_OCCURS
=3,
100
ATTRIBUTE_MAX_OCCURS
=4,
101
ATTRIBUTE_FORM
=5,
102
ATTRIBUTE_BASE
=6,
103
ATTRIBUTE_USE
=7,
104
ATTRIBUTE_NAMESPACE
=8,
105
ATTRIBUTE_PROC_CONTENTS
=9,
106
ATTRIBUTE_VALUE
=10,
107
ATTRIBUTE_NILLABLE
=11,
108
ATTRIBUTE_ITEM_TYPE
=12,
109
ATTRIBUTE_MEMBER_TYPES
=13,
110
ATTRIBUTE_MIXED
=14,
111
ATTRIBUTE_SCHEMA_LOCATION
=15,
112
ATTRIBUTE_SUBSTITUTION_GROUP
=16,
113
ATTRIBUTE_ABSTRACT
=17,
114
ATTRIBUTE_CONTEXT_ARRAY_SIZE
=18
115
};
116
117
typedef
enum
AttrEnum
AttrEnum
;
118
120
struct
PfxNsEntry
121
{
122
String
pfx
;
123
String
ns
;
124
};
125
126
typedef
struct
PfxNsEntry
PfxNsEntry
;
127
129
struct
PfxNsTable
130
{
131
DynArray
dynArray
;
132
PfxNsEntry
*
pfxNs
;
133
Index
count
;
134
};
135
136
typedef
struct
PfxNsTable
PfxNsTable
;
137
140
enum
FormType
141
{
142
QUALIFIED
=0,
143
UNQUALIFIED
=1
144
};
145
146
typedef
enum
FormType
FormType
;
147
149
struct
QNameIDGrIndx
150
{
151
QNameID
qnameId
;
152
Index
grIndex
;
153
};
154
155
typedef
struct
QNameIDGrIndx
QNameIDGrIndx
;
156
160
struct
QualifiedTreeTableEntry
161
{
162
struct
TreeTable
*
treeT
;
163
struct
TreeTableEntry
*
entry
;
164
};
165
166
typedef
struct
QualifiedTreeTableEntry
QualifiedTreeTableEntry
;
167
175
struct
TreeTableEntry
176
{
182
QualifiedTreeTableEntry
child
;
183
186
struct
TreeTableEntry
*
next
;
187
192
QualifiedTreeTableEntry
supertype
;
193
195
ElemEnum
element
;
196
199
String
attributePointers
[
ATTRIBUTE_CONTEXT_ARRAY_SIZE
];
200
214
Index
loopDetection
;
215
};
216
217
typedef
struct
TreeTableEntry
TreeTableEntry
;
218
223
struct
TreeTable
224
{
225
DynArray
dynArray
;
226
TreeTableEntry
*
tree
;
227
Index
count
;
228
229
struct
230
{
232
String
targetNs
;
234
SmallIndex
targetNsId
;
236
FormType
elemFormDefault
;
238
FormType
attrFormDefault
;
240
PfxNsTable
pfxNsTable
;
241
}
globalDefs
;
242
243
AllocList
memList
;
// Holding the memory allocations for the TreeTable
244
245
#if HASH_TABLE_USE
246
250
struct
hashtable
* typeTbl;
251
256
struct
hashtable
* elemTbl;
257
261
struct
hashtable
* attrTbl;
262
266
struct
hashtable
* groupTbl;
267
271
struct
hashtable
* attrGroupTbl;
272
#endif
273
};
274
275
typedef
struct
TreeTable
TreeTable
;
276
286
struct
NsTable
287
{
288
DynArray
dynArray
;
289
String
*
base
;
290
Index
count
;
291
};
292
293
typedef
struct
NsTable
NsTable
;
294
299
struct
SubtGroupHead
300
{
301
DynArray
dynArray
;
302
QualifiedTreeTableEntry
*
substitutes
;
303
Index
count
;
304
QNameID
headId
;
305
};
306
307
typedef
struct
SubtGroupHead
SubtGroupHead
;
308
311
struct
SubstituteTable
312
{
313
DynArray
dynArray
;
314
SubtGroupHead
*
head
;
315
Index
count
;
316
};
317
318
typedef
struct
SubstituteTable
SubstituteTable
;
319
326
errorCode
initTreeTable
(
TreeTable
* treeT);
327
334
void
destroyTreeTable
(
TreeTable
* treeT);
335
356
errorCode
generateTreeTable
(
BinaryBuffer
buffer,
SchemaFormat
schemaFormat,
EXIOptions
* opt,
TreeTable
* treeT,
EXIPSchema
* schema);
357
369
errorCode
resolveIncludeImportReferences
(
EXIPSchema
* schema,
TreeTable
** treeT,
unsigned
int
*
count
,
370
errorCode
(*
loadSchemaHandler
) (
String
*
namespace
,
String
* schemaLocation,
BinaryBuffer
** buffers,
unsigned
int
* bufCount,
SchemaFormat
* schemaFormat,
EXIOptions
** opt));
371
392
errorCode
resolveTypeHierarchy
(
EXIPSchema
* schema,
TreeTable
* treeT,
unsigned
int
count,
SubstituteTable
* subsTbl);
393
405
errorCode
convertTreeTablesToExipSchema
(
TreeTable
* treeT,
unsigned
int
count,
EXIPSchema
* schema,
SubstituteTable
* subsTbl);
406
419
errorCode
getTypeQName
(
EXIPSchema
* schema,
TreeTable
* treeT,
const
String
typeLiteral,
QNameID
* qname);
420
431
errorCode
getNsList
(
TreeTable
* treeT,
String
nsList,
NsTable
* nsTable);
432
433
#if DEBUG_GRAMMAR_GEN == ON
434
441
void
printTreeTableEntry
(
TreeTableEntry
* treeTableEntryIn,
int
indentIdx,
char
*prefix);
442
#endif
443
444
#endif
/* TREETABLESCHEMA_H_ */
Generated on Thu Nov 27 2014 10:56:09 for exip by
1.8.4