Annotation of Amaya/amaya/trans.h, revision 1.2
1.2 ! cvs 1: #ifndef _TRANS_H__
! 2: #define _TRANS_H__
! 3:
1.1 cvs 4: /* definition des types utilises par la transformation de structure */
5: /* Stephane Bonhomme Apr 96 */
6: #define MaxSizePat 500
7: #define MaxWidthPat 50
8: #define MaxPatterns 50
9: #define MAXSTACK 500
10: #define LGBUFFER 5000
11:
12: #ifndef PPSTANDALONE
13:
14:
15: /* definition de la structure de l'arbre sujet */
16: /* liste chainee des symboles correspondant a chaque fils */
17: typedef struct _strmatchchild
1.2 ! cvs 18: {
! 19: struct _SymbDesc *patsymb; /* symbole de la pattern matche */
! 20: struct _Tagnode *node; /* noeud de l'arbre sujet */
! 21: struct _strmatchchild *next;
! 22: }
! 23: strmatchchildren;
! 24:
1.1 cvs 25: typedef struct _strmatch
1.2 ! cvs 26: {
! 27: struct _SymbDesc *patsymb; /* symbole de la pattern matche */
! 28: struct _Tagnode *node; /* noeud de l'arbre sujet */
! 29: strmatchchildren *childmatches;
! 30: struct _strmatch *next;
! 31: }
! 32: strmatch;
1.1 cvs 33:
34:
35: /* definition d'un noeud de l'arbre sujet */
36: typedef struct _Tagnode
1.2 ! cvs 37: {
! 38: char *tag;
! 39: Element element;
! 40: struct _Tagnode *parent;
! 41: struct _Tagnode *child;
! 42: struct _Tagnode *next;
! 43: struct _Tagnode *prev;
! 44: boolean isTrans;
! 45: struct _SymbDesc *transsymb;
! 46: strmatch *matches;
! 47: /* tableau des symboles candidats au resultat, associes aux symboles */
! 48: /*correspondant a un ss ensemble des fils du noeud */
! 49: struct _ListSymb *inter;
! 50: int depth;
! 51: }
! 52: Tagnode;
1.1 cvs 53:
1.2 ! cvs 54: typedef Tagnode *TagTree;
1.1 cvs 55:
56:
57: #endif
1.2 ! cvs 58: /* environnement de transformation */
1.1 cvs 59:
60: typedef struct _AttrDesc
1.2 ! cvs 61: {
! 62: char *NameAttr;
! 63: int ThotAttr;
! 64: boolean IsInt;
! 65: boolean IsTransf;
! 66: union
! 67: {
! 68: char *_TextVal;
! 69: int _IntVal;
! 70: struct _s0
! 71: {
! 72: char *_Tag;
! 73: char *_Attr;
! 74: }
! 75: s0;
! 76: }
! 77: u;
! 78: struct _AttrDesc *next;
! 79: }
! 80: AttrDesc;
1.1 cvs 81:
82: #define TextVal u._TextVal
83: #define IntVal u._IntVal
84: #define AttrTag u.s0._Tag
85: #define AttrAttr u.s0._Attr
86:
87:
88: /* definition des structures internes des regles de transformation */
89: typedef struct _NodeDesc
1.2 ! cvs 90: {
! 91: char *Tag;
! 92: AttrDesc *Attributes;
! 93: struct _NodeDesc *next;
! 94: }
! 95: NodeDesc;
1.1 cvs 96:
97: typedef struct _RuleDesc
1.2 ! cvs 98: {
! 99: char *RName;
! 100: NodeDesc *OptNodes;
! 101: NodeDesc *NewNodes;
! 102: struct _RuleDesc *next;
! 103: }
! 104: RuleDesc;
1.1 cvs 105:
106: #ifndef PPSTANDALONE
107: typedef struct _ListElem
1.2 ! cvs 108: {
! 109: Element element;
! 110: int id;
! 111: int rank;
! 112: struct _ListElem *next;
! 113: }
! 114: ListElem;
! 115:
1.1 cvs 116: #endif
117:
118: typedef struct _ListSymb
1.2 ! cvs 119: {
! 120: struct _SymbDesc *symb;
! 121: struct _ListSymb *next;
! 122: }
! 123: ListSymb;
1.1 cvs 124:
125: typedef struct _SymbDesc
1.2 ! cvs 126: {
! 127: char *SName;
! 128: char *Tag;
! 129: RuleDesc *Rule;
! 130: boolean Optional;
! 131: boolean ActiveSymb;
! 132: boolean OptChild;
! 133: int depth;
! 134: AttrDesc *Attributes;
! 135: ListSymb *Children;
! 136: ListSymb *Nexts;
! 137: struct _SymbDesc *next;
! 138: }
! 139: SymbDesc;
1.1 cvs 140:
141: /* descripteurs de transformation */
142: typedef struct _TransDesc
1.2 ! cvs 143: {
! 144: char *NameTrans;
! 145: int nbPatSymb;
! 146: int nbRules;
! 147: int patdepth;
! 148: ListSymb *First;
! 149: SymbDesc *rootdesc;
! 150: SymbDesc *PatSymbs;
! 151: RuleDesc *Rules;
! 152: boolean ActiveTrans;
! 153: char *TagDest;
! 154: struct _TransDesc *next;
! 155: }
! 156: TransDesc;
1.1 cvs 157:
158: struct _match_env
1.2 ! cvs 159: {
1.1 cvs 160: #ifndef PPSTANDALONE
1.2 ! cvs 161: TagTree subjecttree;
! 162: ListElem *listSubTrees;
1.1 cvs 163: #endif
1.2 ! cvs 164: /* nombre de transformations */
! 165: int nbTrans;
! 166: /* porfondeur max des patterns */
! 167: int maxdepth;
! 168: /* descripteurs de transformations */
! 169: TransDesc *Transformations;
! 170: }
! 171: match_env;
1.1 cvs 172:
173:
174:
175: #ifndef PPSTANDALONE
176: /* document auquel est applique la transformation */
1.2 ! cvs 177: Document TransDoc;
! 178:
1.1 cvs 179: /* elements de dialogue et messages */
1.2 ! cvs 180: int TransBaseDialog;
! 181: int TRANSDIAL;
! 182:
1.1 cvs 183: #define TR_TRANSFORM 0
184: #define TRANS_MSG_MAX 1
185: #define TransMenu 1
186: #define MAX_TRANS_DLG 2
187:
188: /*date de derniere modif du fichier de transformations */
1.2 ! cvs 189: time_t timeLastWrite;
! 190:
1.1 cvs 191: #endif
1.2 ! cvs 192: #endif /* _TRANS_H__ */
Webmaster