7.2.1 Production Left-Hand Side

The left-hand side of a production of a bottom-up template grammar contains a nonterminal symbol and, optionally, an #l-… marker for specifying a nonterminal symbol at the left-hand side of a corresponding production in a source PCFG. The former nonterminal symbol can be a compound one (see Compound Nonterminal Symbols).

Example

S #l-S: RHS ;

Here a nonterminal symbol of a bottom-up template grammar and a nonterminal symbol of a source PCFG are the same nonterminal symbol S.

The rege-markup-cfg tool typically adds #l-… markers to a bottom-up template grammar. See Marking a Left-Hand Side, for more information on #l-… markers.

If a nonterminal symbol at the left-hand side of the first production of a bottom-up template grammar does not have a length specification, the rege-bottom-up tool considers the nonterminal symbol the start one.

If a nonterminal symbol at the left-hand side of the first production of a bottom-up template grammar has a length specification, rege-bottom-up determines a stem nonterminal symbol name by removing the length specification and treats all nonterminal symbols with the stem name as start ones. A particular start nonterminal symbol for processing a parse unit has length equal to the length of the parse unit measured in terminal symbols.

Example

If a bottom-up template grammar begins with productions

S/3 #l-S: RHS1 ;
S/5 #l-S: RHS2 ;
S/9 #l-S: RHS3 ;

and a parse unit consists of 5 terminal symbols, the nonterminal symbol S/5 will be a start nonterminal symbol for processing the parse unit.