| 1 |
When polymorphic semantic values are used then, in addition to the parser and |
| 2 |
parse-base classes, several more classes are defined. Some of them are class |
| 3 |
templates; most are defined in tt(parserbase.h); an occasional implementation |
| 4 |
is added to the tt(parse.cc) source file. |
| 5 |
|
| 6 |
To minimize namespace pollution most of the extra code is contained in a |
| 7 |
namespace of its own: tt(Meta_). If the tt(%namespace) directive was used then |
| 8 |
tt(Meta_) is nested under the namespace declared by that directive. The name |
| 9 |
tt(Meta_) is used because much of the code implementing polymorphic semantic |
| 10 |
values uses template meta programming. |
| 11 |
|
| 12 |
bf(The enumeration 'enum class Tag_') |
| 13 |
|
| 14 |
One notable exception to the above is the enumeration tt(Tag_). To simplify |
| 15 |
its use it is declared outside of tt(Meta_) (but inside the tt(%namespace) |
| 16 |
namespace, if specified). Its tags are declared at the tt(%polymorphic) |
| 17 |
directive. tt(Targs_) is a strongly typed enumeration. The tt(%weak-tags) |
| 18 |
directive can be used to declare a pre C++-11 standard `tt(enum Tag_)'. |
| 19 |
|
| 20 |
bf(The namespace Meta_) |
| 21 |
|
| 22 |
Below, tt(DataType) refers to the semantic value's data type that is |
| 23 |
associated with a tt(Tag_) identifier. |
| 24 |
|
| 25 |
Several classes are defined in the namespace tt(Meta_). The most important |
| 26 |
class is tt(SType), providing the interface to the semantic value |
| 27 |
types. The class tt(SType) becomes the parser's tt(STYPE_) type. Each |
| 28 |
tt(SType) object is either a default tt(SType) object, not containing a |
| 29 |
semantic value, or it contains a semantic value of a single tt(DataType). All |
| 30 |
operations related to semantic values are handled by this class. |
| 31 |
|
| 32 |
The class tt(SType) provides the following public interface: |
| 33 |
|
| 34 |
includefile(stypeinterface) |
| 35 |
|