Skip to main content
1 vote
1 answer
64 views

I'm struggling with a small parser using PetitParser2. Here is a fragment of some of the rules I'm defining but their behaviour is not as I could expect: andKeyword := 'and' asPParser trim, #letter ...
rluque's user avatar
  • 11
1 vote
1 answer
149 views

I know there has been an old question How can a PetitParser parse rule signal an error?. Lukas Renggli has written it is: in general this is not good style (mixes syntactic and semantic analysis) ...
tukan's user avatar
  • 17.5k
0 votes
1 answer
162 views

Fair enough, previously was a badly worded question. I'm going to take another stab at it. I'm using Dart's PetitParser to consume input. I want a lexer that will accept any string until one of a ...
Grey's user avatar
  • 419
0 votes
0 answers
74 views

Having trouble again getting a my input properly ingested, and I'm not sure what I'm doing wrong. The full file I'm using to to define my lexers can be seen here. But specifically what I'm running ...
Grey's user avatar
  • 419
0 votes
1 answer
132 views

I don't understand the comment: /// Returns a parser that consumes nothing and succeeds. /// /// For example, `char('a').or(epsilon())` is equivalent to /// `char('a').optional()`. @useResult Parser&...
Gpack's user avatar
  • 2,263
0 votes
1 answer
73 views

Does anybody know if there is an existing implementation of an XPath parser in Java that uses PetitParser? I assume it is more or less impossible to cover all thinkable XPath expressions that are ...
Matthias's user avatar
  • 277
0 votes
1 answer
469 views

UPDATE 1: It looks like changing digit().plus() to word().plus() works. Does that seem right? Petitparser has proven to be very powerful! I have the following flutter/dart code: testString = '((S|71|...
Coltuxumab's user avatar
1 vote
1 answer
168 views

I have a series of string like this: (((S|69|L || S|69|R || S|72|L || S|72|R) && ((S|62|L && (S|78|L || S|55|L) && (S|77|L || S|1|L)) || (S|62|R && (S|78|R || S|55|R) &...
Coltuxumab's user avatar
0 votes
1 answer
105 views

I am stuck at one point with the Dart package petitparser: It seems that the "priority rule" ("parse p1, if that doesn't work parse p2 - ordered choice") is ignored by the ...
CodingFun's user avatar
0 votes
1 answer
161 views

I can successfully parse a comma-delimited list with dart-petitparser, but the same code fails when confronted with a space-delimited list: class MyDefinition extends GrammarDefinition { @override ...
Roger Lipscombe's user avatar
0 votes
1 answer
134 views

I need a parser that took only important marked parts from a text file. This is sample input: else before 1 else before 2 --Start Query 1 important 1 --End 1 else between 1 and 2 - 1 else between 1 ...
msangel's user avatar
  • 10.5k
2 votes
1 answer
257 views

Sorry, I ran into another question about using PetitParser. I've figured out my recursive issues, but now I have a problem with parentheses. If I need to be able to parse the following two expressions:...
Grey's user avatar
  • 419
2 votes
1 answer
84 views

I want to parse the root element of such data as follows <elementA> ... ...anything ... </ elementA> <elementB> <!--anything such as same element name--> <elementB>...
ZERO M's user avatar
  • 21
1 vote
1 answer
339 views

I'd like to ask for some guidance using petitparser (I'm updating this question). There's a json-based grammar called FHIRPath that I'm trying to recreate in dart. I'm new to grammars like this, so it'...
Grey's user avatar
  • 419
3 votes
1 answer
136 views

petitparser is a parser generator written in dart to be used e.g. in Flutter. According to this page, petitparser allows to use ref0 to reference the current parse class. In the section Using Grammar ...
SteAp's user avatar
  • 12k

15 30 50 per page