| 1 |
A DFARow defines a row in a DFA table. It contains |
| 2 |
|
| 3 |
- d_final: the rule matched when this state cannot continue (or 0) |
| 4 |
|
| 5 |
- d_transit: the unordered map linking an input symbol (category) |
| 6 |
to a row in a DFA table. The key is the input symbol |
| 7 |
category, the value the row index. |
| 8 |
|
| 9 |
A Usage object (In DFA) determines the number of different input symbol |
| 10 |
categories. |
| 11 |
|
| 12 |
Subset construction results in a set of states, of the d_states array. For each |
| 13 |
character in the alphabet a new set of states is determined. If the set isn't |
| 14 |
already found in the DFA it is added to it. |
| 15 |
|
| 16 |
Subset construction (ASU) is used to determine the row to transit to. |
| 17 |
|
| 18 |
When traversing the states vector and a state is the final state of a rule |
| 19 |
d_final is set to the rule's number. When d_final is already set then it is |
| 20 |
overwritten if the current rule number precedes d_final's value. This |
| 21 |
eventually allows us to find the active rules by simply walking the lines of |
| 22 |
the DFA and marking the d_final rules. Those that aren't marked aren't |
| 23 |
matched. |
| 24 |
|
| 25 |
Handling accept states. |
| 26 |
|
| 27 |
[To do] |
| 28 |
|
| 29 |
When a rule's accept state is encountered DFAaccept[rule] is set to the DFA |
| 30 |
row index. DFA index 0 is never used. Moreover, the accept state is flagged as |
| 31 |
`inheriting' or `non inheriting' (see README.lookaheads) |
| 32 |
|
| 33 |
|
| 34 |
- d_states: the set of states defining this row |
| 35 |
|
| 36 |
|
| 37 |
|