ANTLR 4.5 C# and SLL Prediction Mode

153 views
Skip to first unread message

Ryan Sommers

unread,
Mar 27, 2015, 3:24:57 PM3/27/15
to antlr-di...@googlegroups.com
I have written a grammar describing a file-type I don't have control over.  After having StackOverflowErrors with the TestRig I discovered that if I set the -SLL prediction mode flag the test rig would perform just fine.  I then moved to trying to use the grammar in Python but found that regardless of prediction mode the interpreter would hang while processing a file the Java runtime with SLL enabled handled just fine.  Internet research suggested that the Python2 runtime might not support optimized SLL the way Java and C# would.  So, I then tried the C# runtime.  I attempted to set the Prediction mode in C# via "parser.Interpreter.PredictionMode = Antlr4.Runtime.Atn.PredictionMode.Sll;."  However, even with this C# would complain about stack overflows.

Is SLL supported in C# the same as Java?  If so, what could the reason be for the grammar to perform fine in Java but not in C# with SLL prediction?

Thanks,
Ryan

Eric Vergnaud

unread,
Mar 27, 2015, 10:14:13 PM3/27/15
to antlr-di...@googlegroups.com
Hi,

we are maybe missing test cases for SLL mode in non java runtimes.
could you file bugs in antler-python(x) and antlr-csharp, attach the grammar and a test case?
Reply all
Reply to author
Forward
0 new messages