Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc

09.06.2013 Views

XENIX Programming yacc: Compiler-Compiler Old Features This section mentions synonyms and features supported for historical continuity, but that, for various reasons, are not encouraged. • Literals may also be delim ited by double quotation marks ("). • Literals may be more than one character long. If all the characters are alphabetic, nu meric, or underscore, the type number of the literal is defined, just as if the literal did not have the quotation marks around it. Otherwise, it is difficult to find the value for such literals. The use of multicharacter literals is likely to mislead those unfamiliar with yacc, since it suggests that yacc is doing a job that must be actually done by the lexical analyzer. • Most places where % is legal, backslash {\) may be used. In particular, the double backslash {\ \} is the same as 9696, \left the same as 96left, etc. • There are a number of other synonyms: 96< is the same as 96left 96> is the same as %right %binary and 962 are the same as 96nonassoc 960 and 96term are the same as %token 96= is the same as 96prec • Actions may also have the form = { . .. } and the curly braces can be dropped if the action is a single C statement. • C code between 96{ and 96} used to be permitted at the head of the rules section, as well as in the declaration section. 10-39

<strong>XENIX</strong> Programming yacc: Compiler-Compiler<br />

Old Features<br />

This section mentions synonyms and features supported for historical continuity, but<br />

that, for various reasons, are not encouraged.<br />

• Literals may also be delim ited by double quotation marks (").<br />

• Literals may be more than one character long. If all the characters are<br />

alphabetic, nu meric, or underscore, the type number of the literal is defined, just<br />

as if the literal did not have the quotation marks around it. Otherwise, it is<br />

difficult to find the value for such literals. The use of multicharacter literals is<br />

likely to mislead those unfamiliar with yacc, since it suggests that yacc is doing a<br />

job that must be actually done by the lexical analyzer.<br />

• Most places where % is legal, backslash {\) may be used. In particular, the double<br />

backslash {\ \} is the same as 9696, \left the same as 96left, e<strong>tc</strong>.<br />

• There are a number of other synonyms:<br />

96< is the same as 96left<br />

96> is the same as %right<br />

%binary and 962 are the same as 96nonassoc<br />

960 and 96term are the same as %token<br />

96= is the same as 96prec<br />

• Actions may also have the form<br />

= { .<br />

.. }<br />

and the curly braces can be dropped if the action is a single C statement.<br />

• C code between 96{ and 96} used to be permitted at the head of the rules section,<br />

as well as in the declaration section.<br />

10-39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!