| 1 |
In the file defining the tt(parse) function the following types and |
| 2 |
variables are defined in the anonymous namespace. These are mentioned here for |
| 3 |
the sake of completeness, and are not normally accessible to other parts of |
| 4 |
the parser. |
| 5 |
|
| 6 |
itemization( |
| 7 |
it() bf(char const author[]):nl() |
| 8 |
Defining the name and e-mail address of Bic()'s author. |
| 9 |
|
| 10 |
it() bf(Reserved_):nl() |
| 11 |
This enumeration defines some token values used internally by the |
| 12 |
parsing functions. They are: |
| 13 |
verb( |
| 14 |
UNDETERMINED_ = -2, |
| 15 |
EOF_ = -1, |
| 16 |
errTok_ = 256, |
| 17 |
) |
| 18 |
These tokens are used by the parser to determine whether another token |
| 19 |
should be requested from the lexical scanner, and to handle |
| 20 |
error-conditions. |
| 21 |
|
| 22 |
it() bf(StateType):nl() |
| 23 |
This enumeration defines several additional token values used |
| 24 |
internally by the parsing functions. They are: |
| 25 |
verb( |
| 26 |
NORMAL, |
| 27 |
ERR_ITEM, |
| 28 |
REQ_TOKEN, |
| 29 |
ERR_REQ, // ERR_ITEM | REQ_TOKEN |
| 30 |
DEF_RED, // state having default reduction |
| 31 |
ERR_DEF, // ERR_ITEM | DEF_RED |
| 32 |
REQ_DEF, // REQ_TOKEN | DEF_RED |
| 33 |
ERR_REQ_DEF // ERR_ITEM | REQ_TOKEN | DEF_RED |
| 34 |
) |
| 35 |
These tokens are used by the parser to define the types of the various |
| 36 |
states of the analyzed grammar. |
| 37 |
|
| 38 |
it() bf(StateTransition) |
| 39 |
This enumeration only defines a single symbolic constant: tt(ACCEPT_), |
| 40 |
which is used in the state transition tables to indicate that the |
| 41 |
em(accepting state) has been reached. |
| 42 |
|
| 43 |
it() bf(PI_) (Production Info):nl() |
| 44 |
This tt(struct) provides information about production rules. It has two |
| 45 |
fields: tt(d_nonTerm) is the identification number of the production's |
| 46 |
nonterminal, tt(d_size) represents the number of elements of the |
| 47 |
productin rule. |
| 48 |
|
| 49 |
it() bf(static PI_ s_productionInfo):nl() |
| 50 |
Used internally by the parsing function. |
| 51 |
|
| 52 |
it() bf(SR_) (Shift-Reduce Info):nl() |
| 53 |
This tt(struct) provides the shift/reduce information for the various |
| 54 |
grammatic states. tt(SR_) values are collected in arrays, one array |
| 55 |
per grammatic state. These array, named tt(s_)tt(<nr>), |
| 56 |
where tt<nr> is a state number are defined in the anonymous namespace |
| 57 |
as well. The tt(SR_) elements consist of two unions, |
| 58 |
defining fields that are applicable to, respectively, the first, |
| 59 |
intermediate and the last array elements.nl() |
| 60 |
The first element of each array consists of (1st field) a tt(StateType) |
| 61 |
and (2nd field) the index of the last array element; |
| 62 |
intermediate elements consist of (1st field) a symbol value and (2nd |
| 63 |
field) (if negative) the production rule number reducing to the |
| 64 |
indicated symbol value or (if positive) the next state when the symbol |
| 65 |
given in the 1st field is the current token; |
| 66 |
the last element of each array consists of (1st field) a placeholder for |
| 67 |
the current token and (2nd field) the (negative) rule number to reduce |
| 68 |
to by default or the (positive) number of an error-state to go to when |
| 69 |
an erroneous token has been retrieved. If the 2nd field is zero, no |
| 70 |
error or default action has been defined for the state, and |
| 71 |
error-recovery is attepted. |
| 72 |
|
| 73 |
it() bf(STACK_EXPANSION_):nl() |
| 74 |
An enumeration value specifying the number of additional elements that |
| 75 |
are added to the state- and semantic value stacks when full. |
| 76 |
|
| 77 |
it() bf(static SR_ s_<nr>[]):nl() |
| 78 |
Here, tt(<nr>) is a numerical value representing a state number. |
| 79 |
Used internally by the parsing function. |
| 80 |
|
| 81 |
it() bf(static SR_ *s_state[]):nl() |
| 82 |
Used internally by the parsing function. |
| 83 |
) |