How to set Prediction Mode to 'SLL' in a parser generated for python2?

370 views
Skip to first unread message

Reshma Godse

unread,
Dec 31, 2014, 4:19:20 AM12/31/14
to antlr-di...@googlegroups.com
Hello,

I am working on the grammar to parse input file of our tool. Using lexer-parser generated for java, the time taken to parse a 500 line file is fraction of seconds when I set prediction mode to 'SLL'. What is the way to set prediction mode to 'SLL' in a parser generated for python2? Without this setting the python2 lexer-parser take around 8+ minutes to parse the same 500 line file.

Thanks for help!

Reshma

Reshma Godse

unread,
Dec 31, 2014, 4:43:47 AM12/31/14
to antlr-di...@googlegroups.com

I have also tried following:

parser._interp.predictionMode = PredictionMode.SLL

It has some effect on the performance. But still after setting Prediction mode to SLL, the response time is around 3.5 min. Is there any other way to improve performance for python2 parser?

Reshma Godse

unread,
Dec 31, 2014, 7:05:19 AM12/31/14
to antlr-di...@googlegroups.com
Hello,

As mentioned in the previous post, I have found a way to set the PredictionMode to 'SLL' in python. And found that the parser performance improved a lot. But the lexer became bottleneck. Hence I will open a separate thread for python lexer performance.

~ Reshma


On Wednesday, December 31, 2014 2:49:20 PM UTC+5:30, Reshma Godse wrote:
Reply all
Reply to author
Forward
0 new messages