summaryrefslogtreecommitdiff
path: root/colm/tree.h
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2011-09-24 19:13:14 +0000
committerAdrian Thurston <thurston@complang.org>2011-09-24 19:13:14 +0000
commit27cd19ae03ad8f7f01fbc338eda87d14cd4b219a (patch)
tree734a3bf749c63e04458b9be053ef9e3c37d15388 /colm/tree.h
parentc0014b8565bf6e491522160242aaf1a1c968f312 (diff)
downloadcolm-27cd19ae03ad8f7f01fbc338eda87d14cd4b219a.tar.gz
Merging ignore lists is now done with a left-or-right push: the new list goes
at the top and the existing list becomes either a left-ignore or a right-ignore of the new list. During backtracking we can then just pop. All operations are O(1). No traversing the ignore list to put items at the end. Leaky, but functional. refs #323.
Diffstat (limited to 'colm/tree.h')
-rw-r--r--colm/tree.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/colm/tree.h b/colm/tree.h
index f6f5d488..a5947bac 100644
--- a/colm/tree.h
+++ b/colm/tree.h
@@ -36,6 +36,10 @@ typedef struct _TreePair
void treeUpref( Tree *tree );
void treeDownref( Program *prg, Tree **sp, Tree *tree );
long cmpTree( Program *prg, const Tree *tree1, const Tree *tree2 );
+void attachLeftIgnore( Program *prg, Tree *tree, Tree *ignoreList );
+void attachRightIgnore( Program *prg, Tree *tree, Tree *ignoreList );
+void removeLeftIgnore( Program *prg, Tree *tree );
+void removeRightIgnore( Program *prg, Tree *tree );
Tree *treeLeftIgnore( Program *prg, Tree *tree );
Tree *treeRightIgnore( Program *prg, Tree *tree );
Kid *treeLeftIgnoreKid( Program *prg, Tree *tree );
@@ -56,6 +60,7 @@ Tree *makeTree( Tree **root, Program *prg, long nargs );
Stream *openFile( Program *prg, Tree *name, Tree *mode );
Stream *openStreamFd( Program *prg, long fd );
Kid *copyIgnoreList( Program *prg, Kid *ignoreHeader );
+Kid *copyKidList( Program *prg, Kid *kidList );
void streamFree( Program *prg, Stream *s );
Tree *copyTree( Program *prg, Tree *tree, Kid *oldNextDown, Kid **newNextDown );