The OLE (Optional Lambda Expression) is converted into a bovine lambda. This lambda has special short-cuts to simplify reading the semantic action definition. An OLE like this:
( $1 )
results in a lambda return which consists entirely of the string or object found by matching the first (zeroth) element of match. An OLE like this:
( ,(foo $1) )
foo on the first argument, and then splices its return
into the return list whereas:
( (foo $1) )
foo, and that is placed in the return list.
Here are other things that can appear inline:
The first object matched.
The first object spliced into the list (assuming it is a list from a non-terminal).
The first object matched, placed in a list. I.e.,
( $1 ).
foo (exactly as displayed).
A function call to foo which is stuck into the return list.
A function call to foo which is spliced into the return list.
A function call to foo which is stuck into the return list in a list.
(EXPAND $1 nonterminal depth)
A list starting with
EXPAND performs a recursive parse on the
token passed to it (represented by ‘$1’ above.) The
semantic list is a common token to expand, as there are often
interesting things in the list. The nonterminal is a symbol in
your table which the bovinator will start with when parsing.
nonterminal’s definition is the same as any other nonterminal.
depth should be at least ‘1’ when descending into a
(EXPANDFULL $1 nonterminal depth)
EXPAND, except that the parser will iterate over
nonterminal until there are no more matches. (The same way the
parser iterates over the starting rule (see Starting Rules). This
lets you have much simpler rules in this specific case, and also lets
you have positional information in the returned tokens, and error
(ASSOC symbol1 value1 symbol2 value2 …)
This is used for creating an association list. Each symbol is
included in the list if the associated value is non-
While the items are all listed explicitly, the created structure is an
association list of the form:
((symbol1 . value1) (symbol2 . value2) …)
(TAG name class [attributes])
This creates one tag in the current buffer.
Is a string that represents the tag in the language.
Is the kind of tag being create, such as
variable, though any symbol will work.
Is an optional set of labeled values such as
:constant-flag t :parent
(TAG-VARIABLE name type default-value [attributes])
(TAG-FUNCTION name type arg-list [attributes])
(TAG-TYPE name type members parents [attributes])
(TAG-INCLUDE name system-flag [attributes])
(TAG-PACKAGE name detail [attributes])
(TAG-CODE name detail [attributes])
Create a tag with name of respectively the class
See See (semantic-appdev)Creating Tags for the lisp
functions these translate into.
If the symbol
%quotemode backquote is specified, then use
,@ to splice a list in, and
, to evaluate the expression.
This lets you send
$1 as a symbol into a list instead of having
it expanded inline.