antlr / antlr4

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
http://antlr.org
BSD 3-Clause "New" or "Revised" License
17.04k stars 3.27k forks source link

netbeans module trouble #2533

Open peterremote1980 opened 5 years ago

peterremote1980 commented 5 years ago

Hi My Netbeans antlr plugin has trouble. my antlr plugin try to parse a false-file. The input string is:

(bits 64){
    adc ax,cx
}

In the listener, it print out:

(bits 64){cxadcax,cx}<EOF>

As you can see, there is a fake "cx", in front of "cxadcax,cx". Same code running outside the netbeans, it works. But if the antlr code is running as a netbeans module, it become fake. Any hints?

I am using Netbeans 8.2 and it embedded antlr 4.5.3

thanks From Peter

peterremote1980 commented 5 years ago

i print out all tokens one by one, it is correct. But in listener, i just get a fake token, why?

                for (Token t : tokenStream.getTokens()) {
                    System.out.println("token=" + t.getText());
                }