parse-forest

Scala Parser Combinator, Ambiguous Grammar & Parse Forest

♀尐吖头ヾ 提交于 2019-12-09 04:44:57
问题 I am trying to get the parser to return all possible parse results (parse forest) from an ambiguous grammar and choose from the parse forest by evaluating them against user context / history and a knowledge base. For performance reason, this should probably be done with the packrat parser and a search limit / upper-bound parameter to limite the number of recursive calls in applying production rules to avoid infinite loops. Being new to both Scala and its Parser Combinators, I can't figure out