| 1 |
computeTailCounts: |
| 2 |
|
| 3 |
for each tailcount of row[0]: visitTailcount |
| 4 |
|
| 5 |
visitTailCount: |
| 6 |
|
| 7 |
set current rule, call determineTailCount |
| 8 |
|
| 9 |
determineTailCount: |
| 10 |
|
| 11 |
d_sawAccept set to zero if fmRow = 0: start with clean sawAccept for each |
| 12 |
new transition from row 0. |
| 13 |
|
| 14 |
setTailCount: the tailcount is set for the current row, using the |
| 15 |
tailCount of the previous row. |
| 16 |
Done if this returns false (see setTailCount's |
| 17 |
description) |
| 18 |
|
| 19 |
Next, for each of the input-ranges that are used for this row, |
| 20 |
transitTailCount - transit from this row to the row matching |
| 21 |
the input ranges |
| 22 |
|
| 23 |
setTailCount: |
| 24 |
See the tech manual (The logic used in 'setTailCount'). |
| 25 |
That table shows all possible flag/sawAccept combinations and describes |
| 26 |
the action to perform on each combination |
| 27 |
|
| 28 |
if the PROCESSED flag has already been set, then nothing happens |
| 29 |
(this is NEW in 1.06, until 1.05 the set functions were called, and at the |
| 30 |
end PROCESSED was tested) |
| 31 |
|
| 32 |
calls: |
| 33 |
* setIncTailCount for POST states |
| 34 |
* setInitTailCount for 1st time ACCEPT states |
| 35 |
* setNextTailCount for PRE/ACCEPT and POST states |
| 36 |
|
| 37 |
raises the flag PROCESSED at the end |
| 38 |
|
| 39 |
transitTailCount: |
| 40 |
|
| 41 |
determineTailCount defines (TailCount &tailCount, size_t thisRow, |
| 42 |
TailCount *fmTailCount, size_t fmRow) |
| 43 |
|
| 44 |
it calls transitTailCount with a value of the map of range-row |
| 45 |
transitions, its own tailcount and its own row index. |
| 46 |
|
| 47 |
The map's 2nd value defines the to-row, and if the to-row has tailcounts |
| 48 |
for the current rule (d_rule) then determineTailCount is called for the |
| 49 |
toRow, passing it the toRow's tailCount and index, as well as tailCount |
| 50 |
and thisRow, which become transitTailCount's fmTailCount and fmRow. |
| 51 |
|
| 52 |
setIncTailCount: |
| 53 |
Only one statement, adding TailCount::INCREMENTING to the current |
| 54 |
tailCount flags. |
| 55 |
|
| 56 |
setInitTailCount: |
| 57 |
Initializes the current tailcount value to 0, raises the |
| 58 |
TailCount::COUNT flag, sets sawAccept to true. |
| 59 |
|
| 60 |
setNextTailCount: |
| 61 |
if the current TailCount didn't already show the COUNT flag, |
| 62 |
then COUNT | PROCESSED is set. |
| 63 |
else, if transiting from an earlier row nothing is changed; if transiting |
| 64 |
from a later row and the expected and actual next counts differ, a warning |
| 65 |
message is issued and the tailcount of the current row is reset to 0. |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|