Closed autonomousapps closed 1 month ago
first you should right click the rule name you want to start, then you click test rule, it should be work;
A-ha! That worked. Thanks! <3
Closing as resolved (not sure how this might be better documented 🤷 ).
Given a grammar with multiple start rules (for example, Kotlin), the ANTRL Preview window can show an error when the input doesn't match the default start rule (how is that even determined?). In the screencap below, the Preview window is trying to parse my input as if it were a
kotlinFile
, but actually it should match from another start rule, agradleScript
(see below for my currently internal customizations of the official grammar). The only way I have discovered to get the preview to work is to comment out the other start rules, let the preview work, and then uncomment them again; at that point, the window "remembers" (?) the correct start rule. It would be really great if I could tell it from where to start parsing.