antlr / intellij-plugin-v4

An IntelliJ plugin for ANTLR v4
https://plugins.jetbrains.com/plugin/7358-antlr-v4
BSD 3-Clause "New" or "Revised" License
462 stars 103 forks source link

The parse tree output of plugin version 1.19.3 is abnormal #613

Closed hejianlin closed 1 year ago

hejianlin commented 1 year ago

The following is the grammar file Data.g4:

grammar Data;

file : group+ ;

group: INT sequence[$INT.int] ;

sequence[int n]
locals [int i = 1;]
     : ( {$i<=$n}? INT {$i++;} )* // match n integers
     ;

INT :   [0-9]+ ;             // match integers
WS  :   [ \t\n\r]+ -> skip ; // toss out all whitespace

But I enter a string like this: 2 9 10 3 1 2 3

expect to get: image

but actually get: image

parrt commented 1 year ago

If I remember correctly, the preview of the parse tree does not have execution of actions

hejianlin commented 1 year ago

Thank you, just learning, maybe some concepts are not clear, thanks for the guidance

bjansen commented 1 year ago

See https://github.com/antlr/intellij-plugin-v4#limitations for more info.