The TableGen programming language
In this section, we will offer a primer on the TableGen syntax. The goal here is not for you to become a TableGen programmer but to know enough so that you can understand what you read and write when working with TableGen in the rest of this book. For a more thorough explanation of the TableGen syntax, consult the Further reading section.
As you saw in the previous section, TableGen is a language used to generate records. It relies on two main constructs to describe its records:
class
: A way to structure, pre-fill, and specify a type for recordsdef
: An instantiation of a record
The general syntax to describe a record is as follows:
def [optionalName][: optionalClassA[<argN[, argM]*>][, optionalClassB[<argV[, argW]*>]]*] [{
[type fieldName [ = value];]*
}];
In this snippet, everything between [
and ]
is optional, and the *
character means, as usual for regular expression, that the previous expression...