AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
tokenValue (String image [, int parser]) yoix.parser
 
Returns the token number that the specified parser associates with image, or -1 if image is not recognized for the specified parser, which must be one of PARSER_YOIX (the default), PARSER_XML, or PARSER_DTD, which are constants defined in yoix.parser. The tokens associated with the available parsers are defined in the yoix.parser.YoixConstants and yoix.parser.XMLConstants dictionaries. Note that the XML and DTD parsers are really just two flavors of the same XML parser.
 
 Example:   The program,
import yoix.parser.*;
import yoix.stdio.*;

Array tokens = {"+=", "&&", "<<", "$$"};

for (; tokens@sizeof > 0; tokens++)
    printf("%s   %d\n", *tokens, tokenValue(*tokens));
prints something like
+=   40
&&   36
<<   21
$$   -1
on standard output.
 
 Return:   int
 
 See Also:   ParseTree, tokenAssociativity, tokenImage, tokenPrecedence

 

Yoix is a registered trademark of AT&T Inc.