diff options
author | Adrian Thurston <thurston@complang.org> | 2012-05-12 09:32:16 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2012-05-12 09:32:16 -0400 |
commit | 3b32ebd1ad020b5e3116ec74d73245bb056651d1 (patch) | |
tree | ee8d17251557a4cdb19bfdfc34cb044f4abc97eb | |
parent | 975a07de6f10bacb873375c2515b33798e22d5bd (diff) | |
download | colm-3b32ebd1ad020b5e3116ec74d73245bb056651d1.tar.gz |
Use data trees in the token list, not parse trees.
-rw-r--r-- | colm/pdarun.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/colm/pdarun.c b/colm/pdarun.c index 3720b069..66cf6352 100644 --- a/colm/pdarun.c +++ b/colm/pdarun.c @@ -269,8 +269,8 @@ void detachIgnores( Program *prg, Tree **sp, PdaRun *pdaRun, FsmRun *fsmRun, Kid /* Right ignore are immediately discarded since they are copies of * left-ignores. */ Tree *rightIgnore = 0; - if ( pdaRun->tokenList != 0 && pt(pdaRun->tokenList->kid->tree)->shadow->tree->flags & AF_RIGHT_IL_ATTACHED ) { - Kid *riKid = treeRightIgnoreKid( prg, pt(pdaRun->tokenList->kid->tree)->shadow->tree ); + if ( pdaRun->tokenList != 0 && pdaRun->tokenList->kid->tree->flags & AF_RIGHT_IL_ATTACHED ) { + Kid *riKid = treeRightIgnoreKid( prg, pdaRun->tokenList->kid->tree ); /* If the right ignore has a left ignore, then that was the original * right ignore. */ @@ -285,8 +285,8 @@ void detachIgnores( Program *prg, Tree **sp, PdaRun *pdaRun, FsmRun *fsmRun, Kid else { rightIgnore = riKid->tree; treeUpref( rightIgnore ); - removeRightIgnore( prg, sp, pt(pdaRun->tokenList->kid->tree)->shadow->tree ); - pt(pdaRun->tokenList->kid->tree)->shadow->tree->flags &= ~AF_RIGHT_IL_ATTACHED; + removeRightIgnore( prg, sp, pdaRun->tokenList->kid->tree ); + pdaRun->tokenList->kid->tree->flags &= ~AF_RIGHT_IL_ATTACHED; } } @@ -683,10 +683,10 @@ void attachIgnore( Program *prg, Tree **sp, PdaRun *pdaRun, Kid *to ) input->tree->flags |= AF_LEFT_IL_ATTACHED; if ( pdaRun->tokenList != 0 ) { - if ( pt(pdaRun->tokenList->kid->tree)->shadow->tree->flags & AF_RIGHT_IGNORE ) { + if ( pdaRun->tokenList->kid->tree->flags & AF_RIGHT_IGNORE ) { /* The previous token already has a right ignore. Merge by * attaching it as a left ignore of the new list. */ - Kid *curIgnore = treeRightIgnoreKid( prg, pt(pdaRun->tokenList->kid->tree)->shadow->tree ); + Kid *curIgnore = treeRightIgnoreKid( prg, pdaRun->tokenList->kid->tree ); attachLeftIgnore( prg, (Tree*)rightIgnore, (IgnoreList*)curIgnore->tree ); /* Replace the current ignore. */ @@ -696,10 +696,10 @@ void attachIgnore( Program *prg, Tree **sp, PdaRun *pdaRun, Kid *to ) } else { /* Attach The ignore list. */ - attachRightIgnore( prg, pt(pdaRun->tokenList->kid->tree)->shadow->tree, rightIgnore ); + attachRightIgnore( prg, pdaRun->tokenList->kid->tree, rightIgnore ); } - pt(pdaRun->tokenList->kid->tree)->shadow->tree->flags |= AF_RIGHT_IL_ATTACHED; + pdaRun->tokenList->kid->tree->flags |= AF_RIGHT_IL_ATTACHED; } } else { @@ -1546,9 +1546,9 @@ head: tree->flags |= AF_COMMITTED; /* Do not recures on trees that are terminal dups. */ - if ( !(pt(tree)->shadow->tree->flags & AF_TERM_DUP) && - !(pt(tree)->shadow->tree->flags & AF_NAMED) && - !(pt(tree)->shadow->tree->flags & AF_ARTIFICIAL) && + if ( !(pt(tree)->flags & AF_TERM_DUP) && + !(pt(tree)->flags & AF_NAMED) && + !(pt(tree)->flags & AF_ARTIFICIAL) && tree->child != 0 ) { vm_push( (Tree*)lel ); @@ -1745,7 +1745,7 @@ again: attachIgnore( prg, sp, pdaRun, pdaRun->lel ); Ref *ref = (Ref*)kidAllocate( prg ); - ref->kid = pdaRun->lel; + ref->kid = pt(pdaRun->lel->tree)->shadow; //treeUpref( pdaRun->lel->tree ); ref->next = pdaRun->tokenList; pdaRun->tokenList = ref; |