28 #ifndef __FREEWRL_CPARSE_PARSER_H__
29 #define __FREEWRL_CPARSE_PARSER_H__
31 void resetParseSuccessfullyFlag(
void);
32 int parsedSuccessfully(
void);
54 struct Vector* scriptDests;
60 int newProtoDefinitionPointer (
struct ProtoDefinition *vrmlpd,
int xmlpd);
66 #define protoFieldDecl_getType(me) \
68 #define protoFieldDecl_getAccessType(me) \
70 #define protoFieldDecl_getIndexName(me) \
72 #define protoFieldDecl_getStringName(lex, me) \
73 lexer_stringUser_fieldName(lex, protoFieldDecl_getIndexName(me), \
74 protoFieldDecl_getAccessType(me))
77 #define protoFieldDecl_getDefaultValue(me) \
82 #define protoFieldDecl_finish(lex, me) \
83 if(((me)->mode==PKW_initializeOnly || (me)->mode==PKW_inputOutput) && \
85 protoFieldDecl_setValue(lex, me, &(me)->defaultVal)
94 indexT protoDefNumber;
96 struct Vector* deconstructedProtoBody;
104 #define protoDefinition_addIfaceField(me, field) \
105 vector_pushBack(struct ProtoFieldDecl*, (me)->iface, field)
108 #define protoDefinition_getFieldCount(me) \
109 vectorSize((me)->iface)
110 #define protoDefinition_getFieldByNum(me, i) \
111 vector_get(struct ProtoFieldDecl*, (me)->iface, i)
118 #define BLOCK_STATEMENT(LOCATION) \
119 if(parser_routeStatement(me)) { \
123 if (parser_componentStatement(me)) { \
127 if (parser_exportStatement(me)) { \
131 if (parser_importStatement(me)) { \
135 if (parser_metaStatement(me)) { \
139 if (parser_unitStatement(me)) { \
143 if (parser_profileStatement(me)) { \
165 int parsingX3DfromXML;
166 Stack* brotoDEFedNodes;
170 extern BOOL (*PARSE_TYPE[])(
struct VRMLParser*,
void*);
173 struct VRMLParser* newParser(
void *ectx,
void* ptr,
unsigned,
int isX3DFormat);
174 struct VRMLParser* reuseParser(
void *ectx,
void* ptr,
unsigned);
185 #define parser_fromString(me, str) \
186 lexer_fromString(me->lexer, str)
189 #define parser_sffloatValue(me, ret) \
190 lexer_float(me->lexer, ret)
191 #define parser_sfint32Value(me, ret) \
192 lexer_int32(me->lexer, ret)
193 #define parser_sfstringValue(me, ret) \
194 lexer_string(me->lexer, ret)
195 #define lexer_sfstringValue(me, ret) \
196 lexer_string(me, ret)
208 void replaceProtoField(
struct VRMLLexer *me,
struct ProtoDefinition *thisProto,
char *thisID,
char **outTextPtr,
size_t *outSize);
210 void cParseErrorCurID(
struct VRMLParser *me,
char *str);
211 void cParseErrorFieldString(
struct VRMLParser *me,
char *str1,
const char *str2);
213 #define CPARSE_ERROR_CURID(str) cParseErrorCurID(me, str);
214 #define CPARSE_ERROR_FIELDSTRING(str1,str2) cParseErrorFieldString(me, str1, str2);
219 BOOL nodeTypeSupportsUserFields(
struct X3D_Node *node);
220 int PKW_from_KW(
int KW_index);
221 BOOL find_anyfield_by_nameAndRouteDir(
struct X3D_Node* node,
union anyVrml **anyptr,
222 int *imode,
int *itype,
char* nodeFieldName,
int *isource,
void** fdecl,
int *ifield,
int PKW_eventType);
224 BOOL isAvailableBroto(
char *pname,
struct X3D_Proto* currentContext,
struct X3D_Proto **proto);
225 void registerParentIfManagedField(
int type,
int mode,
int isPublic,
union anyVrml* any,
struct X3D_Node* parent);
226 void shallow_copy_field(
int typeIndex,
union anyVrml* source,
union anyVrml* dest);
228 int X3DMODE(
int val);
229 void load_externProtoInstance (
struct X3D_Proto *node);
230 int getFieldFromNodeAndName(
struct X3D_Node* node,
const char *fieldname,
int *type,
int *kind,
int *iifield,
union anyVrml **value);
231 int getFieldFromNodeAndIndex(
struct X3D_Node* node,
int ifield,
const char **fieldname,
int *type,
int *kind,
union anyVrml **value);