[antlr-interest] What does ANTLR use the reserved char codes and Token IDs for?
Ric Klaren
klaren at cs.utwente.nl
Mon Nov 4 01:45:00 PST 2002
On Sun, Nov 03, 2002 at 09:16:32PM -0000, micheal_jor wrote:
> ANTLR reserves the following character codes /u0000 to /u0003. What
> are they used for?
>
> On a similar note, the Token IDs 0 to 3 are also reserved. What are
> they used for as well. I mean, if I come across a node in my AST with
> these Token IDs, what does it represent?
Copy-paste:
static const int MIN_USER_TYPE = 4;
static const int NULL_TREE_LOOKAHEAD = 3;
static const int INVALID_TYPE = 0;
static const int EOF_TYPE = 1;
static const int SKIP = -1;
SKIP -> internally used for the skipping of tokens. When you set a token to
type skip in the lexer.
EOF -> end of file token.
INVALID_TYPE -> default value for token constructors
NULL_TREE_LOOKAHEAD -> eof kindoff but in treewalkers, used for the
ASTNULLtype sentinel.
HTH,
Ric
--
-----+++++*****************************************************+++++++++-------
---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722 ----
-----+++++*****************************************************+++++++++-------
Wo das Chaos auf die Ordnung trifft, gewinnt meist das Chaos, weil es
besser organisiert ist. --- Friedrich Nietzsche
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list