Annotation of Amaya/amaya/trans.h, revision 1.3

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

Webmaster