<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>ANTLR3C: ANTLR3_COMMON_TREE_struct Struct Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">ANTLR3C <span id="projectnumber">3.1.2</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="classes.html"><span>Data Structure Index</span></a></li> <li><a href="functions.html"><span>Data Fields</span></a></li> </ul> </div> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html',''); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-attribs">Data Fields</a> </div> <div class="headertitle"> <h1>ANTLR3_COMMON_TREE_struct Struct Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="ANTLR3_COMMON_TREE_struct" --> <p>Interface for an ANTLR3 common tree which is what gets passed around by the AST producing parser. <a href="#_details">More...</a></p> <p><code>#include <antlr3commontree.h></code></p> <div class="dynheader"> Collaboration diagram for ANTLR3_COMMON_TREE_struct:</div> <div class="dyncontent"> <div class="center"><img src="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct__coll__graph.png" border="0" usemap="#_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct_coll__map" alt="Collaboration graph"/></div> <map name="_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct_coll__map" id="_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct_coll__map"> <area shape="rect" id="node24" href="struct_a_n_t_l_r3___a_r_b_o_r_e_t_u_m__struct.html" title="ANTLR3 Tree factory interface to create lots of trees efficiently rather than creating and freeing lo..." alt="" coords="3727,447,3977,473"/><area shape="rect" id="node2" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_o_k_e_n__struct.html" title="The definition of an ANTLR3 common token structure, which all implementations of a token stream shoul..." alt="" coords="2536,196,2819,223"/><area shape="rect" id="node34" href="struct_a_n_t_l_r3___b_a_s_e___t_r_e_e__struct.html" title="A generic tree implementation with no payload." alt="" coords="2951,381,3201,408"/><area shape="rect" id="node4" href="struct_a_n_t_l_r3___s_t_r_i_n_g__struct.html" title="Base string class tracks the allocations and provides simple string tracking functions." alt="" coords="1268,307,1489,333"/><area shape="rect" id="node7" href="struct_a_n_t_l_r3___s_t_r_i_n_g___f_a_c_t_o_r_y__struct.html" title="Definition of the string factory interface, which creates and tracks strings for you of various shape..." alt="" coords="785,173,1087,200"/><area shape="rect" id="node14" href="struct_a_n_t_l_r3___i_n_p_u_t___s_t_r_e_a_m__struct.html" title="Master context structure for an ANTLR3 C runtime based input stream." alt="" coords="2123,196,2405,223"/><area shape="rect" id="node17" href="struct_a_n_t_l_r3___i_n_t___s_t_r_e_a_m__struct.html" title="ANTLR3_INT_STREAM_struct" alt="" coords="1711,284,1972,311"/><area shape="rect" id="node10" href="struct_a_n_t_l_r3___v_e_c_t_o_r__struct.html" title="ANTLR3_VECTOR_struct" alt="" coords="441,447,663,473"/><area shape="rect" id="node27" href="struct_a_n_t_l_r3___s_t_a_c_k__struct.html" title="Structure that represents a Stack collection." alt="" coords="831,505,1041,532"/><area shape="rect" id="node30" href="struct_a_n_t_l_r3___v_e_c_t_o_r___f_a_c_t_o_r_y__struct.html" title="Structure that tracks vectors in a vector and auto deletes the vectors in the vector factory when clo..." alt="" coords="1228,560,1529,587"/><area shape="rect" id="node12" href="struct_a_n_t_l_r3___v_e_c_t_o_r___e_l_e_m_e_n_t__struct.html" title="ANTLR3_VECTOR_ELEMENT_struct" alt="" coords="7,447,308,473"/></map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-attribs"></a> Data Fields</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_a_n_t_l_r3___b_a_s_e___t_r_e_e__struct.html">ANTLR3_BASE_TREE</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#aab30e9fd47c078a3343498ca41bb2b0d">baseTree</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">An encapsulated BASE TREE structure (NOT a pointer) that performs a lot of the dirty work of node management To this we add just a few functions that are specific to the payload. <a href="#aab30e9fd47c078a3343498ca41bb2b0d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="antlr3defs_8h.html#a6faef5c4687f8eb633d2aefea93973ca">ANTLR3_INT32</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#afe231f9f4e1979f1765abdc677198ebf">childIndex</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">What index is this particular node in the child list it belongs to? <a href="#afe231f9f4e1979f1765abdc677198ebf"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_a_n_t_l_r3___a_r_b_o_r_e_t_u_m__struct.html">pANTLR3_ARBORETUM</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#ab2cba63bc8ae9fcd0916fa9c0903982a">factory</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Pointer to the tree factory that manufactured this token. <a href="#ab2cba63bc8ae9fcd0916fa9c0903982a"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html">pANTLR3_COMMON_TREE</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#a0c48243a71441dd67cb307dc35dc49ab">parent</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Points to the node that has this node as a child. <a href="#a0c48243a71441dd67cb307dc35dc49ab"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="antlr3defs_8h.html#a0361e6bf442e07afe923e4d05e9ebc4f">ANTLR3_MARKER</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#a2c813f62d05d88ef73b83201fd9decf6">startIndex</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Start token index that encases this tree. <a href="#a2c813f62d05d88ef73b83201fd9decf6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="antlr3defs_8h.html#a0361e6bf442e07afe923e4d05e9ebc4f">ANTLR3_MARKER</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#a4747603f0393de0e6faf824e5419b789">stopIndex</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">End token that encases this tree. <a href="#a4747603f0393de0e6faf824e5419b789"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#a7050b0be53cfd6f2aa4923becd806db5">super</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Not used by ANTLR, but if a super structure is created above this structure, it can be used to point to the start of the super structure, where additional data and function pointers can be stored. <a href="#a7050b0be53cfd6f2aa4923becd806db5"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_o_k_e_n__struct.html">pANTLR3_COMMON_TOKEN</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#a0328c4ee838188d11da140a0fd47edfe">token</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A single token, this is the payload for the tree. <a href="#a0328c4ee838188d11da140a0fd47edfe"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Interface for an ANTLR3 common tree which is what gets passed around by the AST producing parser. </p> </div><hr/><h2>Field Documentation</h2> <a class="anchor" id="aab30e9fd47c078a3343498ca41bb2b0d"></a><!-- doxytag: member="ANTLR3_COMMON_TREE_struct::baseTree" ref="aab30e9fd47c078a3343498ca41bb2b0d" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="struct_a_n_t_l_r3___b_a_s_e___t_r_e_e__struct.html">ANTLR3_BASE_TREE</a> <a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#aab30e9fd47c078a3343498ca41bb2b0d">ANTLR3_COMMON_TREE_struct::baseTree</a></td> </tr> </table> </div> <div class="memdoc"> <p>An encapsulated BASE TREE structure (NOT a pointer) that performs a lot of the dirty work of node management To this we add just a few functions that are specific to the payload. </p> <p>You can further abstract common tree so long as you always have a baseTree pointer in the top structure and copy it from the next one down. So, lets say we have a structure JIMS_TREE. It needs an ANTLR3_BASE_TREE that will support all the general tree duplication stuff. It needs a ANTLR3_COMMON_TREE structure embedded or completely provides the equivalent interface. It provides it's own methods and data. To create a new one of these, the function provided to the tree adaptor (see comments there) should allocate the memory for a new JIMS_TREE structure, then call antlr3InitCommonTree(<addressofembeddedCOMMON_TREE>) antlr3BaseTreeNew(<addressofBASETREE>) The interfaces for BASE_TREE and COMMON_TREE will then be initialized. You then call and you can override them or just init JIMS_TREE (note that the base tree in common tree will be ignored) just the top level base tree is used). Codegen will take care of the rest. </p> <p>Referenced by <a class="el" href="antlr3commontreenodestream_8c.html#a70c976c5e35cc44607db484c9644fe00">_LT()</a>, <a class="el" href="antlr3commontreenodestream_8c.html#a7bc75a78609705ded62d1aad66f2cd12">addNavigationNode()</a>, <a class="el" href="antlr3defs_8h.html#adc10027310be547445fa9ed632d5dece">antlr3ArboretumNew()</a>, <a class="el" href="antlr3defs_8h.html#abc4461044e5277193e2597fb79f1829a">antlr3SetCTAPI()</a>, <a class="el" href="antlr3treeparser_8c.html#a22c45f91acc78faa73e6b1fd637e3e0c">getMissingSymbol()</a>, <a class="el" href="antlr3commontreenodestream_8c.html#afd185c37b39ba6acee5c8aeb1e114a87">LB()</a>, <a class="el" href="antlr3commontreenodestream_8c.html#a404d1d946e8d99139eb862d7c571e9dc">newDownNode()</a>, <a class="el" href="antlr3commontree_8c.html#a629b852e537616c63e10abcea6668c40">newFromTree()</a>, <a class="el" href="antlr3commontree_8c.html#a108253520363014dfbdaf22f65f83275">newPoolTree()</a>, <a class="el" href="antlr3commontreenodestream_8c.html#aba2a1070fb666dd0aa01b84610ee41eb">newUpNode()</a>, and <a class="el" href="antlr3commontree_8c.html#a8a548aab28e9961332826e83480544b8">reuse()</a>.</p> </div> </div> <a class="anchor" id="afe231f9f4e1979f1765abdc677198ebf"></a><!-- doxytag: member="ANTLR3_COMMON_TREE_struct::childIndex" ref="afe231f9f4e1979f1765abdc677198ebf" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="antlr3defs_8h.html#a6faef5c4687f8eb633d2aefea93973ca">ANTLR3_INT32</a> <a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#afe231f9f4e1979f1765abdc677198ebf">ANTLR3_COMMON_TREE_struct::childIndex</a></td> </tr> </table> </div> <div class="memdoc"> <p>What index is this particular node in the child list it belongs to? </p> <p>Referenced by <a class="el" href="antlr3defs_8h.html#abc4461044e5277193e2597fb79f1829a">antlr3SetCTAPI()</a>.</p> </div> </div> <a class="anchor" id="ab2cba63bc8ae9fcd0916fa9c0903982a"></a><!-- doxytag: member="ANTLR3_COMMON_TREE_struct::factory" ref="ab2cba63bc8ae9fcd0916fa9c0903982a" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="struct_a_n_t_l_r3___a_r_b_o_r_e_t_u_m__struct.html">pANTLR3_ARBORETUM</a> <a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#ab2cba63bc8ae9fcd0916fa9c0903982a">ANTLR3_COMMON_TREE_struct::factory</a></td> </tr> </table> </div> <div class="memdoc"> <p>Pointer to the tree factory that manufactured this token. </p> <p>This can be used by duplication methods and so on to manufacture another auto-tracked common tree structure </p> <p>Referenced by <a class="el" href="antlr3defs_8h.html#adc10027310be547445fa9ed632d5dece">antlr3ArboretumNew()</a>, <a class="el" href="antlr3commontree_8c.html#a00872fc95025076f2ce0a1665d144a4b">dupNode()</a>, <a class="el" href="antlr3commontree_8c.html#a108253520363014dfbdaf22f65f83275">newPoolTree()</a>, and <a class="el" href="antlr3commontree_8c.html#a8a548aab28e9961332826e83480544b8">reuse()</a>.</p> </div> </div> <a class="anchor" id="a0c48243a71441dd67cb307dc35dc49ab"></a><!-- doxytag: member="ANTLR3_COMMON_TREE_struct::parent" ref="a0c48243a71441dd67cb307dc35dc49ab" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html">pANTLR3_COMMON_TREE</a> <a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#a0c48243a71441dd67cb307dc35dc49ab">ANTLR3_COMMON_TREE_struct::parent</a></td> </tr> </table> </div> <div class="memdoc"> <p>Points to the node that has this node as a child. </p> <p>If this is NULL, then this is the root node. </p> <p>Referenced by <a class="el" href="antlr3defs_8h.html#abc4461044e5277193e2597fb79f1829a">antlr3SetCTAPI()</a>.</p> </div> </div> <a class="anchor" id="a2c813f62d05d88ef73b83201fd9decf6"></a><!-- doxytag: member="ANTLR3_COMMON_TREE_struct::startIndex" ref="a2c813f62d05d88ef73b83201fd9decf6" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="antlr3defs_8h.html#a0361e6bf442e07afe923e4d05e9ebc4f">ANTLR3_MARKER</a> <a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#a2c813f62d05d88ef73b83201fd9decf6">ANTLR3_COMMON_TREE_struct::startIndex</a></td> </tr> </table> </div> <div class="memdoc"> <p>Start token index that encases this tree. </p> <p>Referenced by <a class="el" href="antlr3defs_8h.html#abc4461044e5277193e2597fb79f1829a">antlr3SetCTAPI()</a>, and <a class="el" href="antlr3commontreeadaptor_8c.html#a50fb27455e727f2eb2b780c47cb26bd4">setTokenBoundaries()</a>.</p> </div> </div> <a class="anchor" id="a4747603f0393de0e6faf824e5419b789"></a><!-- doxytag: member="ANTLR3_COMMON_TREE_struct::stopIndex" ref="a4747603f0393de0e6faf824e5419b789" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="antlr3defs_8h.html#a0361e6bf442e07afe923e4d05e9ebc4f">ANTLR3_MARKER</a> <a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#a4747603f0393de0e6faf824e5419b789">ANTLR3_COMMON_TREE_struct::stopIndex</a></td> </tr> </table> </div> <div class="memdoc"> <p>End token that encases this tree. </p> <p>Referenced by <a class="el" href="antlr3defs_8h.html#abc4461044e5277193e2597fb79f1829a">antlr3SetCTAPI()</a>, and <a class="el" href="antlr3commontreeadaptor_8c.html#a50fb27455e727f2eb2b780c47cb26bd4">setTokenBoundaries()</a>.</p> </div> </div> <a class="anchor" id="a7050b0be53cfd6f2aa4923becd806db5"></a><!-- doxytag: member="ANTLR3_COMMON_TREE_struct::super" ref="a7050b0be53cfd6f2aa4923becd806db5" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* <a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#a7050b0be53cfd6f2aa4923becd806db5">ANTLR3_COMMON_TREE_struct::super</a></td> </tr> </table> </div> <div class="memdoc"> <p>Not used by ANTLR, but if a super structure is created above this structure, it can be used to point to the start of the super structure, where additional data and function pointers can be stored. </p> </div> </div> <a class="anchor" id="a0328c4ee838188d11da140a0fd47edfe"></a><!-- doxytag: member="ANTLR3_COMMON_TREE_struct::token" ref="a0328c4ee838188d11da140a0fd47edfe" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_o_k_e_n__struct.html">pANTLR3_COMMON_TOKEN</a> <a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html#a0328c4ee838188d11da140a0fd47edfe">ANTLR3_COMMON_TREE_struct::token</a></td> </tr> </table> </div> <div class="memdoc"> <p>A single token, this is the payload for the tree. </p> <p>Referenced by <a class="el" href="antlr3defs_8h.html#a2ff90d8c29831ff6c5697fd140e3e012">antlr3CommonTreeNewFromToken()</a>, <a class="el" href="antlr3commontreenodestream_8c.html#abf1a2bd3b1d9a95b0ee1dd393790c07c">antlr3CommonTreeNodeStreamFree()</a>, <a class="el" href="antlr3defs_8h.html#af53a0945d04dc72b9a3b927c1fa5ffd7">antlr3CommonTreeNodeStreamNew()</a>, <a class="el" href="antlr3defs_8h.html#ad8c49d0bf9bb605b1b8ae992afd70077">antlr3CommonTreeNodeStreamNewStream()</a>, <a class="el" href="group__p_a_n_t_l_r3___b_a_s_e___r_e_c_o_g_n_i_z_e_r.html#gab2d77cd376112c8ff6ed7353ba78dab7">antlr3RecognitionExceptionNew()</a>, <a class="el" href="antlr3defs_8h.html#abc4461044e5277193e2597fb79f1829a">antlr3SetCTAPI()</a>, <a class="el" href="antlr3commontree_8c.html#af89cad82ec0276b7f9183476bdfaa322">getLine()</a>, <a class="el" href="antlr3commontree_8c.html#a71534b9ca7233ba47cbe8f21c9e96c62">getType()</a>, and <a class="el" href="antlr3commontree_8c.html#a629b852e537616c63e10abcea6668c40">newFromTree()</a>.</p> </div> </div> <hr/>The documentation for this struct was generated from the following file:<ul> <li>include/<a class="el" href="antlr3commontree_8h.html">antlr3commontree.h</a></li> </ul> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="struct_a_n_t_l_r3___c_o_m_m_o_n___t_r_e_e__struct.html">ANTLR3_COMMON_TREE_struct</a> </li> <li class="footer">Generated on Tue Feb 8 2011 for ANTLR3C by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li> </ul> </div> </body> </html>