rtEXIAutomaton.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00031 #ifndef _RTEXIAUTOMATON_H_
00032 #define _RTEXIAUTOMATON_H_
00033 
00034 #include "rtexisrc/rtEXIEvent.h"
00035 #include "rtexisrc/rtEXIEventCodeGroup.h"
00036 #include "rtxmlsrc/osrtxml.h"
00037 #include "rtxsrc/rtxArrayList.h"
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042 
00043 typedef OSINT16 OSEXIState;
00044 
00045 typedef enum { OSEXIEncAtm, OSEXIDecAtm } OSEXIAtmType;
00046 
00050 typedef struct {
00051    OSEXIState fromState;
00052    OSEXIState toState;
00053    const OSEXIEvent* pEvent;
00054    OSEXIEventCode* pEventCode;
00055    OSUINT32 valueChannel;
00056 } OSEXIStateEvent;
00057 
00061 typedef struct {
00065    OSEXIState numberOfStates;
00066     
00070    OSEXIState currentState;
00071     
00075    OSEXIState acceptingState;
00076     
00081    const OSXMLFullQName* elementName;
00082     
00088    OSRTArrayList eventCodeGroups;
00089     
00095    OSBOOL isClosed;
00096         
00102    OSBOOL matchedBaseEvent;
00103 
00110    OSRTArrayList eventStates;  /* Array of OSEXIStateEvent structures */
00111 
00120    OSEXIEvent* pDynEvent;
00121 
00125    OSUINT32 valueChannel; 
00126 
00130    OSEXIStateEvent* pAttrEventState; 
00131 
00135    OSEXIState prevState;
00136 
00137 } OSEXIAutomaton;
00138 
00143 typedef struct {
00147    OSEXIState currentState;
00148 
00149 } OSEXIAtmState;
00150 
00154 typedef int(*OSEXIAtmAddTransFunc)(OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, 
00155                                    OSEXIState fromState, OSEXIState toState, 
00156                                    const OSEXIEvent* pEvent, 
00157                                    const OSEXIEventCode* pEventCode);
00158 
00167 EXTERNEXI void rtEXIAutomatonInit 
00168 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, const OSXMLFullQName* pElemName, 
00169  OSEXIState numStates);
00170 
00181 EXTERNEXI OSEXIAutomaton* rtEXINewAutomaton 
00182 (OSCTXT* pctxt, const OSXMLFullQName* pElemName, OSEXIState numStates);
00183 
00192 EXTERNEXI OSEXIAutomaton* rtEXIAutomatonCopy 
00193 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton);
00194 
00203 EXTERNEXI void rtEXIAutomatonFreeMem 
00204 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, OSBOOL dynamic);
00205 
00216 EXTERNEXI OSEXIAutomaton* rtEXIAutomatonAddTransition 
00217 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, OSEXIState fromState, 
00218  OSEXIState toState, const OSEXIEventCode* pEventCode);
00219 
00238 EXTERNEXI int rtEXIAtmAddUndeclaredItems
00239 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, OSEXIState fromState, 
00240  OSEXIState toState, OSEXIEventCode* pEventCode, 
00241  size_t numDeclAttrs, const OSXMLFullQName* declAttrs, 
00242  OSEXIAtmAddTransFunc addTransFunc);
00243 
00262 EXTERNEXI int rtEXIAtmAddUndeclaredStartTagItems
00263 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, OSEXIState fromState, 
00264  OSEXIState toState, OSEXIEventCode* pEventCode, 
00265  size_t numDeclAttrs, const OSXMLFullQName* declAttrs, 
00266  OSEXIAtmAddTransFunc addTransFunc);
00267 
00282 EXTERNEXI int rtEXIAtmAddUndeclaredContentItems
00283 (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, OSEXIState fromState, 
00284  OSEXIState toState, OSEXIEventCode* pEventCode, 
00285  OSEXIAtmAddTransFunc addTransFunc);
00286 
00296 EXTERNEXI OSEXIAutomaton* rtEXIAutomatonInitCopy 
00297 (OSCTXT* pctxt, OSEXIAutomaton* pDestAtm, OSEXIAutomaton* pSrcAtm);
00298 
00306 EXTERNEXI int rtEXIAutomatonPush (OSCTXT* pctxt, OSEXIAutomaton* pAutomaton);
00307 
00315 EXTERNEXI OSEXIAutomaton* rtEXIAutomatonPop (OSCTXT* pctxt);
00316 
00324 EXTERNEXI OSEXIEventCodeGroup* 
00325 rtEXIAtmGetCurrentEventCodeGroup (OSEXIAutomaton* pAutomaton);
00326 
00338 EXTERNEXI OSEXIAutomaton* rtEXIGetDocAutomaton 
00339 (OSCTXT* pctxt, size_t numGblElems, const OSXMLFullQName* gblElems, 
00340  OSEXIAtmAddTransFunc addTransFunc);
00341 
00352 EXTERNEXI OSEXIAutomaton* rtEXIGetElemAutomaton 
00353 (OSCTXT* pctxt, OSXMLFullQName* pqname, 
00354  int (*addTransFunc)(OSCTXT* pctxt, OSEXIAutomaton* pAutomaton, 
00355                      OSEXIState fromState, OSEXIState toState, 
00356                      const OSEXIEvent* pEvent, 
00357                      const OSEXIEventCode* pEventCode));
00358 
00359 #ifdef _TRACE
00360 
00367 EXTERNEXI void rtEXIAutomatonPrint 
00368 (OSCTXT* pctxt, const OSEXIAutomaton* pAutomaton);
00369 #endif
00370 
00371 #ifdef __cplusplus
00372 }
00373 #endif
00374 
00377 #endif