| tokenPrecedence |
(int token) |
yoix.parser |
| |
Returns the precedence of
token
when it represents a Yoix operator, and
LASTTOKEN
otherwise.
The constants associated with Yoix operators, including
LASTTOKEN,
are all defined in the
yoix.parser.YoixConstants
dictionary.
This built-in probably will only be used by specialized Yoix applications,
like a program checker, that examine parse trees associated
with other Yoix programs.
| |
| Example: |
The program,
import yoix.parser.*;
import yoix.stdio.*;
import yoix.type.*;
String image;
int token;
int prec;
int n;
for (n = 0; n < YoixConstants@length; n++) {
if (isInt(YoixConstants[n])) {
token = YoixConstants[n];
image = tokenImage(token);
if ((prec = tokenPrecedence(token))
!= YoixConstants.LASTTOKEN)
printf("%12s %2d\n", image, prec);
}
}
prints the name and precedence of every Yoix operator.
| | |
| Return: |
int
| | |
| See Also: |
ParseTree,
tokenAssociativity,
tokenImage,
tokenValue
|
|
Yoix is a registered trademark of AT&T Inc.
|