• Home
  • Raw
  • Download

Lines Matching refs:tree

36 static void				*	getChild			(pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i);
37 static ANTLR3_UINT32 getChildCount (pANTLR3_BASE_TREE tree);
39 (pANTLR3_BASE_TREE tree);
40 static ANTLR3_UINT32 getLine (pANTLR3_BASE_TREE tree);
43 (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 type);
44 static void addChild (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE child);
45 static void addChildren (pANTLR3_BASE_TREE tree, pANTLR3_LIST kids);
48 static void freshenPACIndexesAll(pANTLR3_BASE_TREE tree);
49 static void freshenPACIndexes (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 offset);
51 static void setChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i, void * child);
52 static void * deleteChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i);
53 static void * dupTree (pANTLR3_BASE_TREE tree);
54 static pANTLR3_STRING toStringTree (pANTLR3_BASE_TREE tree);
58 antlr3BaseTreeNew(pANTLR3_BASE_TREE tree) in antlr3BaseTreeNew() argument
61 tree->getChild = getChild; in antlr3BaseTreeNew()
62 tree->getChildCount = getChildCount; in antlr3BaseTreeNew()
63 tree->addChild = (void (*)(pANTLR3_BASE_TREE, void *))(addChild); in antlr3BaseTreeNew()
64 tree->addChildren = addChildren; in antlr3BaseTreeNew()
65 tree->setChild = setChild; in antlr3BaseTreeNew()
66 tree->deleteChild = deleteChild; in antlr3BaseTreeNew()
67 tree->dupTree = dupTree; in antlr3BaseTreeNew()
68 tree->toStringTree = toStringTree; in antlr3BaseTreeNew()
69 tree->getCharPositionInLine = getCharPositionInLine; in antlr3BaseTreeNew()
70 tree->getLine = getLine; in antlr3BaseTreeNew()
71 tree->replaceChildren = replaceChildren; in antlr3BaseTreeNew()
72 tree->freshenPACIndexesAll = freshenPACIndexesAll; in antlr3BaseTreeNew()
73 tree->freshenPACIndexes = freshenPACIndexes; in antlr3BaseTreeNew()
74 tree->getFirstChildWithType = (void *(*)(pANTLR3_BASE_TREE, ANTLR3_UINT32))(getFirstChildWithType); in antlr3BaseTreeNew()
75 tree->children = NULL; in antlr3BaseTreeNew()
76 tree->strFactory = NULL; in antlr3BaseTreeNew()
80 return tree; in antlr3BaseTreeNew()
84 getCharPositionInLine (pANTLR3_BASE_TREE tree) in getCharPositionInLine() argument
90 getLine (pANTLR3_BASE_TREE tree) in getLine() argument
95 getFirstChildWithType (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 type) in getFirstChildWithType() argument
101 if (tree->children != NULL) in getFirstChildWithType()
103 cs = tree->children->size(tree->children); in getFirstChildWithType()
106 t = (pANTLR3_BASE_TREE) (tree->children->get(tree->children, i)); in getFirstChildWithType()
107 if (tree->getType(t) == type) in getFirstChildWithType()
119 getChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i) in getChild() argument
121 if ( tree->children == NULL in getChild()
122 || i >= tree->children->size(tree->children)) in getChild()
126 return tree->children->get(tree->children, i); in getChild()
131 getChildCount (pANTLR3_BASE_TREE tree) in getChildCount() argument
133 if (tree->children == NULL) in getChildCount()
139 return tree->children->size(tree->children); in getChildCount()
144 addChild (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE child) in addChild() argument
156 if (child->children != NULL && child->children == tree->children) in addChild()
168 if (tree->children == NULL) in addChild()
176 tree->children = child->children; in addChild()
178 freshenPACIndexesAll(tree); in addChild()
196tree->children->add(tree->children, entry, (void (ANTLR3_CDECL *) (void *))child->free); in addChild()
206 if (tree->children == NULL) in addChild()
211 tree->createChildrenList(tree); in addChild()
214 tree->children->add(tree->children, child, (void (ANTLR3_CDECL *)(void *))child->free); in addChild()
222 addChildren (pANTLR3_BASE_TREE tree, pANTLR3_LIST kids) in addChildren() argument
230 tree->addChild(tree, (pANTLR3_BASE_TREE)(kids->get(kids, i+1))); in addChildren()
236 setChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i, void * child) in setChild() argument
238 if (tree->children == NULL) in setChild()
240 tree->createChildrenList(tree); in setChild()
242 tree->children->set(tree->children, i, child, NULL, ANTLR3_FALSE); in setChild()
246 deleteChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i) in deleteChild() argument
248 if ( tree->children == NULL) in deleteChild()
253 return tree->children->remove(tree->children, i); in deleteChild()
257 dupTree (pANTLR3_BASE_TREE tree) in dupTree() argument
263 newTree = tree->dupNode (tree); in dupTree()
265 if (tree->children != NULL) in dupTree()
267 s = tree->children->size (tree->children); in dupTree()
274 t = (pANTLR3_BASE_TREE) tree->children->get(tree->children, i); in dupTree()
288 toStringTree (pANTLR3_BASE_TREE tree) in toStringTree() argument
295 if (tree->children == NULL || tree->children->size(tree->children) == 0) in toStringTree()
297 return tree->toString(tree); in toStringTree()
302 string = tree->strFactory->newRaw(tree->strFactory); in toStringTree()
304 if (tree->isNilNode(tree) == ANTLR3_FALSE) in toStringTree()
307 string->appendS (string, tree->toString(tree)); in toStringTree()
310 if (tree->children != NULL) in toStringTree()
312 n = tree->children->size(tree->children); in toStringTree()
316 t = (pANTLR3_BASE_TREE) tree->children->get(tree->children, i); in toStringTree()
325 if (tree->isNilNode(tree) == ANTLR3_FALSE) in toStringTree()
461 freshenPACIndexesAll(pANTLR3_BASE_TREE tree) in freshenPACIndexesAll() argument
463 tree->freshenPACIndexes(tree, 0); in freshenPACIndexesAll()
470 freshenPACIndexes (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 offset) in freshenPACIndexes() argument
475 count = tree->getChildCount(tree); // How many children do we have in freshenPACIndexes()
483 child = tree->getChild(tree, c); in freshenPACIndexes()
486 child->setParent(child, tree); in freshenPACIndexes()