Having trouble in building parser

14 views
Skip to first unread message

Heet Sheth

unread,
Dec 21, 2015, 6:30:32 AM12/21/15
to antlr-di...@googlegroups.com
Hello,
I am planning to build a parser, that parse only particular format as below.
Dec 17 14:00:00 IP firewall,info FFFW forward: in:<pppoe-mm.demo.649> out:sfp-sfpplus1.vlan113, proto TCP (ACK,PSH), IP:PORT->IP:PORT, NAT (IP:PORT->IP:PORT)->IP:PORT, len 250

This is one of the log for the router. I am naive developer. And just encountered ANTLR4 few days back. Using ANTLRWorks2, I tested my grammar. I created lexer and parser - two classes using ANTLR4. From now I don't know what to do. Please guide.

I guess, I have to create another java file which imports parser.java file and in that file I have to write parser logic.

I am attaching grammar file herewith.
Hello.g4
Reply all
Reply to author
Forward
0 new messages