Questions tagged [parse-forest]

The set of parse trees of an ambiguous sentence.

The set of parse trees of an ambiguous sentence.

See also:

6 questions
17
votes
1 answer

GLL Parser Combinator or Generator in/for C or C++

Is there any existing implementation of the GLL algorithm, either in the form of parser combinators (preferred) or as a parser generator for C or C++? My requirements are that the output is a shared packed parse forest (SPPF) which I can later…
Joe
  • 6,497
  • 4
  • 29
  • 55
8
votes
1 answer

Scala Parser Combinator, Ambiguous Grammar & Parse Forest

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…
4
votes
1 answer

Does a C# parser generator that returns parse forests for ambiguous statements exist?

I would like to explore the use of formal language processing in the context of natural languages. To do so, I am searching for a parser generator that is robust to ambiguity in the sense that it won't denote EBNF as invalid when it multiple…
Doug
  • 2,441
  • 2
  • 19
  • 22
4
votes
2 answers

How to iterate "along" a Marpa parse forest rather than "through" its parse trees?

Say I have a nice ambiguous Marpa grammar and a nice ambiguous input string. I can parse the string with Marpa and end up with a parse forest. I can even iterate through each parse tree in the forest. But how can I iterate "along" the parse…
hippietrail
  • 15,848
  • 18
  • 99
  • 158
4
votes
1 answer

How to use SDF's {avoid} in rascal MPL

I'm trying to design an island grammar using Rascal MPL, but I ran into a problem: When implementing an Island Grammar in SDF a very common approach is to define a "catch-all" water production using the {avoid} attribute. This prevents the parser…
0
votes
2 answers

Trying to iterate over a forest Haskell compilation error

I try to assign to each node of a forest a number, such that there will be no 2 nodes with the same number. I try to use 2 functions which call eachother recursive but I get some compilation errors. Here is the code : numberTree :: Int -> Tree a…