gppg_reading
//=== no-lines—suppresses emission of output #line directives. The hyphen is optional, with “/nolines” having the same effect. /nolines is equivalent.
–> to hide the marked lines led by # #line 2 “Calc.y” int[] regs = new int[26]; #line 3 “Calc.y” int _base;
//=== The parser implements a “bottom-up LALR(1)” shift-reduce algorithm, and relies for its operation on the invariant code of the generic ShiftReduceParser class …
//=== The “%partial” marker, at the beginning of a line in the .y file, declares that the generated parser class will be a partial class.
//=== 2.6.4 Choosing the Semantic Value Type Name — %YYSTYPE ValueTypeName %YYSTYPE TypeConstructor
“%valuetype” is a deprecated synonym for the %YYSTYPE marker. The first form simply declares the name of the type. If there is a %union declaration, then the name should be a simple identifier, and will be the name given to the struct that implements the “union”. If there is no %union declaration, then the name may be a qualified (“dotted”) name that references a named type defined elsewhere.
//=== [Q] international website report? ?????
All such occurrences are canonicalized so that, for example, the same lexical value may be referred to as ‘\n’, ‘\012’, ‘\x0a’, or even ‘\u000a’.
Tokens declared in the same list have the same precedence, while those declared in later lists have higher precedence than those on all earlier lists.
//=== token precedence , subtract or unaryMinus There is a special mechanism that can be used for those unusual cases of tokens that have more than one precedence. The familiar example of this occurs for the “minus” sign of conventional arithmetic grammars, where the same token may denote subtraction (which has low precedence), and unary negation (which has very high precedence). The special mechanism is described in Section 2.7.2.
//=== newly hand-written scanners the code may be written to conform to the AbstractScanner interface
existing scanners, or scanners produced by other tools, it is usually necessary to write adapter code to wrap the scanner API to adapt to the expected interface
//===
The effect is to substitute a product type for the usual union, with the loss of
some storage efficiency.
The type declared by the union construct may be an arbitrary type. For example,
the declaration in gppg’s own parser specification is
%union { public int iVal;
public List