Information Chunks in Context-Free Grammars

The context-free grammar follows the general grammar format described in the section "General Format of a Grammar," earlier in this section. A context-free grammar contains one (and only one) of each of the following information chunks:

· SRCKCFG_WORDS (optional)

· SRCKCFG_RULES (required)

· SRCKCFG_EXPORTRULES (required)

· SRCKCFG_IMPORTRULES (optional)

· SRCKCFG_LISTS (optional)

Words (SRCKCFG_WORDS)

This chunk contains a list of SRWORD structures that specify the words in the grammar.

Rules (SRCKCFG_RULES)

This chunk contains a list of SRCFGRULE structures that specify the rules for the grammar.

Exported Rules (SRCKCFG_EXPORTRULES)

This chunk contains a list of SRCFGXRULE structures that specify the exported rules for the grammar. When an application activates a context-free grammar, it must specify which exported rule to activate. If the engine supports automatic linking, this is a list of rules to link. A grammar must have at least one exported rule. Many engines lose efficiency when using too many exported rules, so keep exported rules to a minimum. Rule names are case insensitive.

Imported Rules (SRCKCFG_IMPORTRULES)

This chunk contains a list of SRCFGIMPRULE structures that specify the imported rules for the grammar. Imported rules are automatically linked to exported rules as soon as the application loads another grammar that has the same rule name as an imported rule. Some engines do not support automatic linking and cannot load grammars with imported rules. Rule names are case insensitive.

Run-Time Lists (SRCKCFG_LISTS)

This chunk contains a list of SRCFGLIST structures that specify the run-time lists that the grammar requires. List names are case insensitive.