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