File: polymorphicshorthand.yo

package info (click to toggle)
bisonc%2B%2B 6.09.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,984 kB
  • sloc: cpp: 9,375; ansic: 1,505; fortran: 1,134; makefile: 1,062; sh: 526; yacc: 84; lex: 60
file content (16 lines) | stat: -rw-r--r-- 995 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
The tt(%polymorphic) directive is used to specify a series of semantic value
types. (Non)terminals can be associated with exactly one of these types, or
with the generic tt(STYPE_) semantic value type. When the latter type is used
either another tt(STYPE_) value can be assigned to it, or a value of one of
the defined polymorphic value types can be assigned to it.  At any time an
tt(STYPE_) can only hold one single value type. Polymorphic semantic types
are type safe: types cannot be confused. Furthermore, as tt(STYPE_) objects
are responsible for their own memory management, memory leaks cannot occur,
assuming that the different semantic value types do not leak.

In the next overview the available dollar-notations that are available with
polymorphic semantic values are described. In this overview $1 is used as a
generic reference to semantic values of production rule components. Instead of
$1 other available numbered dollar references can also be used.

includefile(polydollar.yo)