Token vs. Production #1679
-
Greetings! Question please: Why are Of course such a production would need to mimic the token attributes, such as
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This divides the token manager and the parser itself. Tokens are parsed before and sent to the parser. There are parser generators that try to do that. JavaCC does not. Here tokens are simply regular expressions, even the simple ones, while productions for the parser accept a larger grammar space. Much of the optimizations of parsers are based on this tokenizing pre step. What benefit do you think one would have to do that? |
Beta Was this translation helpful? Give feedback.
No, but you could parse the token with some code like the bracket stuff is done.