Back to main page.

KindCons: Language Description File

Language description file is divided into several sections. Some sections are optional, some must be specified. Section order must be preserved.
Language
Terminals
Nonterminals
OutTerms
Actions
Productions
Keywords
Symbols
OutShapes
Instructions

[Language]

There are some global settings (names and limits) in this section. All the lines in this section have the format variable = value. Names of the variables are not case sensitive, values are case sensitive. Here is a list of varaibles that can (or should) be set in this section:
Language section variables
NameDescription
StartingSymbol name of the starting nonterminal; the nonterminal should also be in the list in the [Nonterminals] section.
lookaheadlength of the lookahead (selects grammar class)
terminalslimit for number of terminals
nonterminalslimit for number of nonterminals
edgeslimit for number of nonterminal edges
nodeslimit for number of nonterminal node elements
viewslimit for number of nonterminal lookaheda elements
keywordslimit for number of keyword shapes
symbolslimit for number of symbol shape nodes
actionslimit for number of semantic actions
outtermslimit for number of output terminals
IdNameterminal name for identifiers (if not specified, no identifiers are recognized)
NumNameterminal name for numbers (if not specified, no numbers are recognized)
CharNameterminal name for characters (if not specified, no characters are recognized; the character delimiter must be also set)
StrNameterminal name for strings (if not specified, no strings are recognized; the string delimiter must be also set)
EofNameterminal name for end-of-file (if needed)
StackSizespecifies semantic stack size (has influence of complexity of recognized language);
in KindCons supported for compatibility with KindTran (v0.11+)
SemInstslimit for number of semantic instructions;
in KindCons supported for compatibility with KindTran (v0.11+)
StrDelim(input) string delimiter (v0.12+)
CharDelim(input) character delimiter (v0.12+)
OutStrDelimoutput string delimiter (v0.12+)
OutCharDelimoutput character delimiter (v0.12+)
ExtendedIs the grammar "extended kind" (i.e. is 'dangling else' allowed)? Default: No. (v0.12+)
IgnoreValuesDo not use values of special terminals (identifiers, numbers, characters, and strings). Added for compatibility with KindTran. (v0.12+)
CaseSensitiveDistinguish between small and capital letters? (i.e. are 'x' and 'X' mentioned as different?)

[Terminals]

Here should be list of all terminal names one per row (special terminals inclusive).

[Nonterminals]

Here should be list of all nonterminal names one per row (inclusive starting symbol).

[OutTerms]

Here should be list of all output terminal names one per row. This section may be omitted.

[Actions]

Here should be list of all semantic action names one per row. This section may be omitted.

[Productions]

Here should be list of all productions one per row. Each production should have the shape nonterminal name = list where list may be empty or string of bracketed names (terminals in parentheses "(" and ")", nonterminals in square brackets "[" and "]", semantic actions in curly brackets "{" and "}", and output terminals in angle brackets "<" and ">").

[Keywords]

Here is a list of keyword shapes. terminal name = keyword shape. This section may be omitted.

[Symbols]

Here is a list of nonalphanumerical terminal symbol shapes. terminal name = shape. This section may be omitted.

[OutShapes]

Here is a list of output terminal symbol shapes. output terminal name = shape. This section may be omitted.

[Instructions]

Here is a list of semantic action descriptions. Each consist of header (line containing '#'-character followed by semantic action name) and several lines with instructions. Instruction lines consist of
semantic instruction mnemos (operations) and list of operands. Available from v0.11.

If there is no semantic program for some semantic action, the semantic action is treated as empty (doing nothing).

This section may be omitted.

Generation of semantic instruction code is enabled by the "-s" command line option. (v0.20+)