version 1.1, 1996/11/20 00:41:57
|
version 1.2, 1996/12/11 14:49:27
|
Line 1
|
Line 1
|
|
#ifndef _TRANS_H__ |
|
#define _TRANS_H__ |
|
|
/* definition des types utilises par la transformation de structure */ |
/* definition des types utilises par la transformation de structure */ |
/* Stephane Bonhomme Apr 96 */ |
/* Stephane Bonhomme Apr 96 */ |
#define MaxSizePat 500 |
#define MaxSizePat 500 |
Line 12
|
Line 15
|
/* definition de la structure de l'arbre sujet */ |
/* definition de la structure de l'arbre sujet */ |
/* liste chainee des symboles correspondant a chaque fils */ |
/* liste chainee des symboles correspondant a chaque fils */ |
typedef struct _strmatchchild |
typedef struct _strmatchchild |
{ |
{ |
struct _SymbDesc *patsymb; /* symbole de la pattern matche */ |
struct _SymbDesc *patsymb; /* symbole de la pattern matche */ |
struct _Tagnode *node; /* noeud de l'arbre sujet */ |
struct _Tagnode *node; /* noeud de l'arbre sujet */ |
struct _strmatchchild *next; |
struct _strmatchchild *next; |
} strmatchchildren; |
} |
|
strmatchchildren; |
|
|
typedef struct _strmatch |
typedef struct _strmatch |
{ |
{ |
struct _SymbDesc *patsymb; /* symbole de la pattern matche */ |
struct _SymbDesc *patsymb; /* symbole de la pattern matche */ |
struct _Tagnode *node; /* noeud de l'arbre sujet */ |
struct _Tagnode *node; /* noeud de l'arbre sujet */ |
strmatchchildren *childmatches; |
strmatchchildren *childmatches; |
struct _strmatch *next; |
struct _strmatch *next; |
} strmatch; |
} |
|
strmatch; |
|
|
|
|
/* definition d'un noeud de l'arbre sujet */ |
/* definition d'un noeud de l'arbre sujet */ |
typedef struct _Tagnode |
typedef struct _Tagnode |
{ |
{ |
char *tag; |
char *tag; |
Element element; |
Element element; |
struct _Tagnode *parent; |
struct _Tagnode *parent; |
struct _Tagnode *child; |
struct _Tagnode *child; |
struct _Tagnode *next; |
struct _Tagnode *next; |
struct _Tagnode *prev; |
struct _Tagnode *prev; |
boolean isTrans; |
boolean isTrans; |
struct _SymbDesc *transsymb; |
struct _SymbDesc *transsymb; |
strmatch *matches; |
strmatch *matches; |
/* tableau des symboles candidats au resultat, associes aux symboles */ |
/* tableau des symboles candidats au resultat, associes aux symboles */ |
/*correspondant a un ss ensemble des fils du noeud */ |
/*correspondant a un ss ensemble des fils du noeud */ |
struct _ListSymb *inter; |
struct _ListSymb *inter; |
int depth; |
int depth; |
} Tagnode; |
} |
|
Tagnode; |
|
|
typedef Tagnode *TagTree; |
typedef Tagnode *TagTree; |
|
|
|
|
#endif |
#endif |
/* environnement de transformation*/ |
/* environnement de transformation */ |
|
|
typedef struct _AttrDesc |
typedef struct _AttrDesc |
{ |
{ |
char *NameAttr; |
char *NameAttr; |
int ThotAttr; |
int ThotAttr; |
boolean IsInt; |
boolean IsInt; |
boolean IsTransf; |
boolean IsTransf; |
union |
union |
{ |
{ |
char *_TextVal; |
char *_TextVal; |
int _IntVal; |
int _IntVal; |
struct _s0 |
struct _s0 |
{ |
{ |
char *_Tag; |
char *_Tag; |
char *_Attr; |
char *_Attr; |
}s0; |
} |
}u; |
s0; |
struct _AttrDesc *next; |
} |
}AttrDesc; |
u; |
|
struct _AttrDesc *next; |
|
} |
|
AttrDesc; |
|
|
#define TextVal u._TextVal |
#define TextVal u._TextVal |
#define IntVal u._IntVal |
#define IntVal u._IntVal |
Line 78 typedef struct _AttrDesc
|
Line 87 typedef struct _AttrDesc
|
|
|
/* definition des structures internes des regles de transformation */ |
/* definition des structures internes des regles de transformation */ |
typedef struct _NodeDesc |
typedef struct _NodeDesc |
{ |
{ |
char *Tag; |
char *Tag; |
AttrDesc *Attributes; |
AttrDesc *Attributes; |
struct _NodeDesc *next; |
struct _NodeDesc *next; |
} NodeDesc; |
} |
|
NodeDesc; |
|
|
typedef struct _RuleDesc |
typedef struct _RuleDesc |
{ |
{ |
char *RName; |
char *RName; |
NodeDesc *OptNodes; |
NodeDesc *OptNodes; |
NodeDesc *NewNodes; |
NodeDesc *NewNodes; |
struct _RuleDesc *next; |
struct _RuleDesc *next; |
} RuleDesc; |
} |
|
RuleDesc; |
|
|
#ifndef PPSTANDALONE |
#ifndef PPSTANDALONE |
typedef struct _ListElem |
typedef struct _ListElem |
{ |
{ |
Element element; |
Element element; |
int id; |
int id; |
int rank; |
int rank; |
struct _ListElem *next; |
struct _ListElem *next; |
} ListElem; |
} |
|
ListElem; |
|
|
#endif |
#endif |
|
|
typedef struct _ListSymb |
typedef struct _ListSymb |
{ |
{ |
struct _SymbDesc *symb; |
struct _SymbDesc *symb; |
struct _ListSymb *next; |
struct _ListSymb *next; |
} ListSymb; |
} |
|
ListSymb; |
|
|
typedef struct _SymbDesc |
typedef struct _SymbDesc |
{ |
{ |
char *SName; |
char *SName; |
char *Tag; |
char *Tag; |
RuleDesc *Rule; |
RuleDesc *Rule; |
boolean Optional; |
boolean Optional; |
boolean ActiveSymb; |
boolean ActiveSymb; |
boolean OptChild; |
boolean OptChild; |
int depth; |
int depth; |
AttrDesc *Attributes; |
AttrDesc *Attributes; |
ListSymb *Children; |
ListSymb *Children; |
ListSymb *Nexts; |
ListSymb *Nexts; |
struct _SymbDesc *next; |
struct _SymbDesc *next; |
} SymbDesc; |
} |
|
SymbDesc; |
|
|
/* descripteurs de transformation */ |
/* descripteurs de transformation */ |
typedef struct _TransDesc |
typedef struct _TransDesc |
{ |
{ |
char *NameTrans; |
char *NameTrans; |
int nbPatSymb; |
int nbPatSymb; |
int nbRules; |
int nbRules; |
int patdepth; |
int patdepth; |
ListSymb *First; |
ListSymb *First; |
SymbDesc *rootdesc; |
SymbDesc *rootdesc; |
SymbDesc *PatSymbs; |
SymbDesc *PatSymbs; |
RuleDesc *Rules; |
RuleDesc *Rules; |
boolean ActiveTrans; |
boolean ActiveTrans; |
char *TagDest; |
char *TagDest; |
struct _TransDesc *next; |
struct _TransDesc *next; |
} TransDesc; |
} |
|
TransDesc; |
|
|
struct _match_env |
struct _match_env |
{ |
{ |
#ifndef PPSTANDALONE |
#ifndef PPSTANDALONE |
TagTree subjecttree; |
TagTree subjecttree; |
ListElem *listSubTrees; |
ListElem *listSubTrees; |
#endif |
#endif |
/* nombre de transformations*/ |
/* nombre de transformations */ |
int nbTrans; |
int nbTrans; |
/* porfondeur max des patterns */ |
/* porfondeur max des patterns */ |
int maxdepth; |
int maxdepth; |
/* descripteurs de transformations */ |
/* descripteurs de transformations */ |
TransDesc *Transformations; |
TransDesc *Transformations; |
} match_env; |
} |
|
match_env; |
|
|
|
|
|
|
#ifndef PPSTANDALONE |
#ifndef PPSTANDALONE |
/* document auquel est applique la transformation */ |
/* document auquel est applique la transformation */ |
Document TransDoc; |
Document TransDoc; |
|
|
/* elements de dialogue et messages */ |
/* elements de dialogue et messages */ |
int TransBaseDialog; |
int TransBaseDialog; |
int TRANSDIAL; |
int TRANSDIAL; |
|
|
#define TR_TRANSFORM 0 |
#define TR_TRANSFORM 0 |
#define TRANS_MSG_MAX 1 |
#define TRANS_MSG_MAX 1 |
#define TransMenu 1 |
#define TransMenu 1 |
#define MAX_TRANS_DLG 2 |
#define MAX_TRANS_DLG 2 |
|
|
/*date de derniere modif du fichier de transformations */ |
/*date de derniere modif du fichier de transformations */ |
time_t timeLastWrite; |
time_t timeLastWrite; |
|
|
#endif |
#endif |
|
#endif /* _TRANS_H__ */ |