Download GIDL User Guide - Computer Science

Transcript
To accomodate operator overloading in the IDL grammer, we introduced a
new terminal, called OPERATOR ID that recognizes symbols of the form:
operator"<any>", where <any> can be any string that does not contain the
space, tab, or the end of line characters.
Figure 11 presents the changes we made to the idl grammer to support
operator overloading. <id or op> denotes either an identifier or an operator
identifier. The <ops overl metadata> is a sequence of pairs of one of the strings
"Java", "Cpp", or "Aldor" and a gidl identifier or operator. The method
name is an identifier or an operator, where the latter can be followed by an
<ops overl metadata> product.
Note that at the parser level, an operator name can be any string. It is the
type-checking job to decide whether the operator is supported by gidl or not.
This allows the set of supported operators to be extended in the compiler without
modifying the parser.