Questions tagged [parser-combinator]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
1answer
104 views

Semantic action in parser combinators

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 ...
74
votes
4answers
11k views

When to use a Parser Combinator? When to use a Parser Generator?

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: ...
1
vote
2answers
347 views

How are line/column position data dealt with in parser combinator libraries?

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/...
7
votes
2answers
1k views

Parser combinator that looks like BNF

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 ...
18
votes
5answers
7k views

Are separate parsing and lexing passes good practice with parser combinators?

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 ...