Next: , Up: Querying grammars


5.2.1 Grammar Tags

This section describes the available grammar tags. see Semantic Tags.

Each tag description has the form class name optional-attributes.

— tag: code "prologue"

Tag produced from a prologue section (see Prologue). The prologue code is the text in between tag's bounds.

— tag: code "epilogue"

Tag produced from the epilogue section (see Epilogue). The epilogue code is the text in between tag's bounds.

— tag: start nonterminal1 rest-nonterminals

Tag produced from a %start declaration (see start Decl).

nonterminal1
First nonterminal symbol name.
rest-nonterminals
List of nonterminal symbol names which follow the first one. Associated to the attribute :rest.

— tag: languagemode mode1 rest-modes

Tag produced from a %languagemode declaration (see languagemode Decl).

mode1
First mode symbol name.
rest-modes
List of mode symbol names which follow the first one. Associated to the attribute :rest.

— tag: scopestart nonterminal

Tag produced from a %scopestart declaration (see scopestart Decl).

nonterminal
Nonterminal symbol name.

— tag: quotemode symbol

Tag produced from a %quotemode declaration (see quotemode Decl).

symbol
Symbol name, value of quote mode.

— tag: assoc associativity type-name tokens

Tag produced from a %left, %right, or %nonassoc declaration (see precedence Decl).

associativity
"left", "right", or "nonassoc".
type-name
Symbol name of the token type. Associated to the attribute :type.
tokens
List of terminal symbol names. Associated to the attribute :value.

— tag: assoc "default-prec" FLAG

Tag produced from a %default-prec, or %no-default-prec declaration (see default-prec Decl).

flag
(list "t") or (list "nil") for respectively %default-prec and %no-default-prec. Associated to the attribute :value.

— tag: keyword keyword-name keyword-value

Tag produced from a %keyword declaration (see keyword Decl).

keyword-value
Name of the keyword symbol.
keyword-value
Value of the keyword as a string. Associated to the attribute :value.

— tag: token token-name1 type-name match-value
— tag: token token-name1 type-name rest-tokens

Tag produced from a %token declaration (see token Decl).

token-name1
First or unique token symbol name.
type-name
Symbol name of the token type. Associated to the attribute :type.
match-value
Value of the token as a string. Associated to the attribute :value.
rest-tokens
List of token symbol names which follow the first one in the declaration. Associated to the attribute :rest.

— tag: type type-name properties

Tag produced from a %type declaration (see type Decl).

type-name
Symbol name of the type.
properties
List of properties. Each property is a pair (symbol . value) where symbol is the property symbol name, and value the property value as string which contains a readable Lisp expression. Associated to the attribute :value.

— tag: put keyword-name1 rest-keywords properties

Tag produced from a %put declaration (see put Decl).

keyword-name1
First or unique keyword [or type] symbol name.
rest-keywords
List of keyword [or type] symbol names which follow the first one in the declaration. Associated to the attribute :rest.
properties
List of properties. Each property is a pair (symbol . value) where symbol is the property symbol name, and value the property value as string which contains a readable Lisp expression. Associated to the attribute :value.

— tag: macro "macro" library macro-names

Tag produced from a %use-macros declaration (see use-macros Decl).

library
Library name. Associated to the attribute :type.
macro-names
List of macro names. Associated to the attribute :value.

— tag: nonterminal nonterminal rule-tags

Tag produced from a nonterminal description (see Grammar Rules).

nonterminal
Nonterminal symbol name.
rule-tags
List rule tags. Associated to the attribute :children.

— tag: rule rule-name :value components :prec terminal :expr action

Tag produced from an individual grammar rule (see Grammar Rules).

rule-name
Generated rule name.
components
List of rule's components. A component is a nonterminal/terminal symbol name, a string that represent a C-like character, or a list of one string element which contains the readable Lisp form of a mid-rule semantic action. Associated to the attribute :value.
prec
Terminal symbol name or a string that represent a C-like character. Associated to the attribute :prec.
action
String which contains the readable Lisp form of the main semantic action. Associated to the attribute :expr.