Skip to main content

Questions tagged [parser-combinator]

Filter by
Sorted by
Tagged with
8 votes
2 answers
2k views

I'm very interested in the topic of parsers, especially in the topic of parser combinators like Superpower. The problem with them is that the grammars that they can work with are a bit limited. For ...
125 votes
4 answers
26k views

I've taken a deep dive into the world of parsers recently, wanting to create my own programming language. However, I found out that there exist two somewhat different approaches of writing parsers: ...
4 votes
3 answers
1k views

I'm building a parser using a parser combinator library. I need to keep track of where AST nodes started and ended in the textual input -- line and column numbers. How is this problem approached and/...
-1 votes
1 answer
148 views

I have a parser that can be defined as int = a:/[0-9]+/ {parseInt(a)}. It is supposed to match an int and convert it into a number. There can also be a parser like sum = a:int b:int {a+b} As ...
24 votes
5 answers
9k views

When I began to use parser combinators my first reaction was a sense of liberation from what felt like an artificial distinction between parsing and lexing. All of a sudden everything was just ...
7 votes
2 answers
1k views

Is it possible to construct a parser combinator library that reads like a BNF grammar? I don't know of any, so I started wondering if there are reasons it's impossible or undesirable to do so. It ...