waxeye-org / waxeye

Waxeye is a parser generator based on parsing expression grammars (PEGs). It supports C, Java, JavaScript, Python, Racket, and Ruby.
https://waxeye-org.github.io/waxeye/index.html
Other
235 stars 38 forks source link

Are there backreferences / capture groups in Waxeye? #19

Open JoshuaGross opened 9 years ago

JoshuaGross commented 9 years ago

Seems like an important feature for a PEG parser but I can't find anything about it?

orlandohill commented 9 years ago

Currently, Waxeye doesn't have backreferences or capture groups.

The grammar file that defines the Waxeye grammar language has a way to label the result of a parsing expression, and give those results to external code. The external code would then be used to do context sensitive checks beyond what a normal parsing expression grammar can support. However, I haven't implemented those features yet, because I have never had the need.

What problem are you trying to solve?

JoshuaGross commented 9 years ago

Basically HTML tag parsing: For now I'm just hoping that they match up; I could assert that they match, also. If they don't it's definitely user error. So not a critical issue. 

Sent from Outlook

On Wed, Aug 26, 2015 at 7:34 PM -0700, "Orlando Hill" notifications@github.com wrote:

Currently, Waxeye doesn't have backreferences or capture groups.

The grammar file that defines the Waxeye grammar language has a way to label the result of a parsing expression, and give those results to external code. The external code would then be used to do context sensitive checks beyond what a normal parsing expression grammar can support. However, I haven't implemented those features yet, because I have never had the need.

What problem are you trying to solve?

— Reply to this email directly or view it on GitHub.

orlandohill commented 9 years ago

Yes, checking that the tag names match in another phase would be an easy solution. Specifically for HTML, I'd try to use preexisting libraries, if at all possible.

JoshuaGross commented 9 years ago

Yeah, it's not HTML so I do need a parser generator, but I hear ya.