]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/cpp/DataBoardTest/libantlr3c-3.2/include/antlr3parsetree.h
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.databoard / cpp / DataBoardTest / libantlr3c-3.2 / include / antlr3parsetree.h
1 /** \file\r
2  *  Abstraction of Common tree to provide payload and string representation of node.\r
3  *\r
4  * \todo May not need this in the end\r
5  */\r
6 \r
7 #ifndef ANTLR3_PARSETREE_H\r
8 #define ANTLR3_PARSETREE_H\r
9 \r
10 // [The "BSD licence"]\r
11 // Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC\r
12 // http://www.temporal-wave.com\r
13 // http://www.linkedin.com/in/jimidle\r
14 //\r
15 // All rights reserved.\r
16 //\r
17 // Redistribution and use in source and binary forms, with or without\r
18 // modification, are permitted provided that the following conditions\r
19 // are met:\r
20 // 1. Redistributions of source code must retain the above copyright\r
21 //    notice, this list of conditions and the following disclaimer.\r
22 // 2. Redistributions in binary form must reproduce the above copyright\r
23 //    notice, this list of conditions and the following disclaimer in the\r
24 //    documentation and/or other materials provided with the distribution.\r
25 // 3. The name of the author may not be used to endorse or promote products\r
26 //    derived from this software without specific prior written permission.\r
27 //\r
28 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
29 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
30 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
31 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
32 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
33 // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
34 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
35 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
36 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
37 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
38 \r
39 #include    <antlr3basetree.h>\r
40 \r
41 #ifdef __cplusplus\r
42 extern "C" {\r
43 #endif\r
44 \r
45 typedef struct ANTLR3_PARSE_TREE_struct\r
46 {\r
47     /** Any interface that implements methods in this interface\r
48      *  may need to point back to itself using this pointer to its\r
49      *  super structure.\r
50      */\r
51     void    * super;\r
52 \r
53     /** The payload that the parse tree node passes around\r
54      */\r
55     void    * payload;\r
56 \r
57     /** An encapsulated BASE TREE strcuture (NOT a pointer)\r
58       * that perfoms a lot of the dirty work of node management\r
59       */\r
60     ANTLR3_BASE_TREE        baseTree;\r
61 \r
62     /** How to dup this node\r
63      */\r
64     pANTLR3_BASE_TREE       (*dupNode)  (struct ANTLR3_PARSE_TREE_struct * tree);\r
65 \r
66     /** Return the type of this node\r
67      */\r
68     ANTLR3_UINT32           (*getType)  (struct ANTLR3_PARSE_TREE_struct * tree);\r
69 \r
70     /** Return the string representation of the payload (must be installed\r
71      *  when the payload is added and point to a function that knwos how to \r
72      *  manifest a pANTLR3_STRING from a node.\r
73      */\r
74     pANTLR3_STRING          (*toString) (struct ANTLR3_PARSE_TREE_struct * payload);\r
75 \r
76     void                    (*free)     (struct ANTLR3_PARSE_TREE_struct * tree);\r
77 \r
78 }\r
79     ANTLR3_PARSE_TREE;\r
80 \r
81 #ifdef __cplusplus\r
82 }\r
83 #endif\r
84 \r
85 #endif\r