source: git/MP/examples/node.h @ 678cfd

spielwiese
Last change on this file since 678cfd was 678cfd, checked in by Olaf Bachmann <obachman@…>, 27 years ago
This commit was generated by cvs2svn to compensate for changes in r337, which included commits to RCS files with non-trunk default branches. git-svn-id: file:///usr/local/Singular/svn/trunk@338 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2   node.h - all the declarations we need to create, put, get, and print
3            the nodes of an annotated parse tree.  The tree is stored
4            as a collection of nodes, with each node containing
5            pointers to a list of annotations associated with the
6            node and a list of children (for operator nodes).
7*/
8
9#ifndef node_h
10#define node_h
11
12typedef struct annot  annot_t;
13typedef struct node   node_t;
14
15/* this is the implementation of an annotation to a data node */
16struct annot {
17  MP_AnnotType_t  type;     /* type of the annotation            */
18  MP_DictTag_t    dtag;     /* dictionary in which it is defined */
19  MP_AnnotFlags_t flags;    /* flags modifying its meaning       */
20  node_t          *node;    /* ptr to MP tree if valuated        */
21  annot_t         *next;    /* the next annotation in the list   */
22};
23
24
25/* this is the implementation of a data node */
26struct node {
27  MP_NodeType_t  type;          /* type of the data field: MP basic type */
28  MP_NumAnnot_t  num_annots;   
29  MP_NumChild_t  num_children;  /* type == operator : number of children */
30                                /* type == raw      : # bytes of data    */
31  MP_DictTag_t dtag;
32  char           *data;          /* generic pointer to the node's "value" */
33  char           *aux;           /* generic pointer for "data objects"    */
34                                /* assumed to be an MP-defined object    */
35  annot_t        *annot_list;   /* the head of the annotation list       */
36  node_t         **child_list;   /* dynamic array of ptrs to child nodes  */
37};
38
39/* The routines that are available externally. */
40void    print_annot();
41int     print_node();
42annot_t *m_get_annot();
43node_t  *m_get_node();
44void    free_tree();
45void    free_label_table();
46
47#endif
Note: See TracBrowser for help on using the repository browser.