Posted 18 years ago
by Jared Phelps
Hello-
Hopefully this is a quick one...Why is the second parameter in the constructor of the LexicalStateAndIDTokenLexicalParseData class a byte, rather than an int? I assume from its usage in the Simple language that it's meant to correspond to a token ID, which are ints everywhere else that I can see.
I don't suppose most people have more than 256 token types, but I like to make my token IDs powers of two, which allows me to use bit masks to determine what kind of token it is (whitespace, comment, significant, etc) conveniently at design-time and very fast at run-time.
Thanks!
Jared
Hopefully this is a quick one...Why is the second parameter in the constructor of the LexicalStateAndIDTokenLexicalParseData class a byte, rather than an int? I assume from its usage in the Simple language that it's meant to correspond to a token ID, which are ints everywhere else that I can see.
I don't suppose most people have more than 256 token types, but I like to make my token IDs powers of two, which allows me to use bit masks to determine what kind of token it is (whitespace, comment, significant, etc) conveniently at design-time and very fast at run-time.
Thanks!
Jared