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