diff options
author | Adrian Thurston <thurston@complang.org> | 2011-11-19 06:15:16 +0000 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2011-11-19 06:15:16 +0000 |
commit | 1afd6c564f69918e6f5beea1984f56856b169beb (patch) | |
tree | 077c7a54cbc943192d101297c1ce66679f631b4d /colm/pdabuild.cc | |
parent | 4dd3e3c3635657b7cf0b984ef795ecfa20eb9b2f (diff) | |
download | colm-1afd6c564f69918e6f5beea1984f56856b169beb.tar.gz |
Use zero for the null region. Required shifting the array over by one.
Entirely removed tree arg to pushBtPoint. Backtracking points are all computed
now from accumIgnore and the token list.
Diffstat (limited to 'colm/pdabuild.cc')
-rw-r--r-- | colm/pdabuild.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/colm/pdabuild.cc b/colm/pdabuild.cc index 007d7205..00fe768f 100644 --- a/colm/pdabuild.cc +++ b/colm/pdabuild.cc @@ -1842,9 +1842,10 @@ PdaTables *ParseData::makePdaTables( PdaGraph *pdaGraph ) pdaTables->commitLen[count++] = asi->key.commitLen; /* - * tokenRegionInds + * tokenRegionInds. Start at one so region index 0 is null (unset). */ - count = pos = 0; + count = 0; + pos = 1; pdaTables->tokenRegionInds = new int[pdaTables->numStates]; for ( PdaStateList::Iter state = pdaGraph->stateList; state.lte(); state++ ) { pdaTables->tokenRegionInds[count++] = pos; @@ -1852,10 +1853,10 @@ PdaTables *ParseData::makePdaTables( PdaGraph *pdaGraph ) } /* - * tokenRegions + * tokenRegions. Build in a null at the beginning. */ - count = 0; + count = 1; for ( PdaStateList::Iter state = pdaGraph->stateList; state.lte(); state++ ) count += state->regions.length() + 1; @@ -1863,6 +1864,7 @@ PdaTables *ParseData::makePdaTables( PdaGraph *pdaGraph ) pdaTables->tokenRegions = new int[pdaTables->numRegionItems]; count = 0; + pdaTables->tokenRegions[count++] = 0; for ( PdaStateList::Iter state = pdaGraph->stateList; state.lte(); state++ ) { for ( RegionVect::Iter reg = state->regions; reg.lte(); reg++ ) pdaTables->tokenRegions[count++] = (*reg)->id + 1; |