Fix initialization of ATNConfig when computing SLL prediction

termination condition.

The PredictionMode::hasSLLConflictTerminatingPrediction method aims to
create ATNConfig objects from another ATNConfig and SemanticContext
objects. In case of the Python targets, the initialization
happened without keyword arguments. Since the called __init__
method had default values set for all the parameters, the parameter
substitution worked by indices. As a consequence, the first ATNConfig
parameter was wrongly interpreted as an ATNState and the SemanticContext as
an alternative. The patch fixes this by adding the missing keywords.
This commit is contained in:
Renata Hodovan 2016-05-06 15:59:55 +02:00
parent d430f495ea
commit 4e3325c9da
2 changed files with 2 additions and 2 deletions

View File

@ -213,7 +213,7 @@ class PredictionMode(object):
# dup configs, tossing out semantic predicates
dup = ATNConfigSet()
for c in configs:
c = ATNConfig(c,SemanticContext.NONE)
c = ATNConfig(config=c, semantic=SemanticContext.NONE)
dup.add(c)
configs = dup
# now we have combined contexts for configs with dissimilar preds

View File

@ -216,7 +216,7 @@ class PredictionMode(Enum):
# dup configs, tossing out semantic predicates
dup = ATNConfigSet()
for c in configs:
c = ATNConfig(c,SemanticContext.NONE)
c = ATNConfig(config=c, semantic=SemanticContext.NONE)
dup.add(c)
configs = dup
# now we have combined contexts for configs with dissimilar preds