Parsanol

Parser Combinators

Basic Atoms

Basic atoms are the building blocks of parsers. They match specific patterns in the input.

str("pattern") - String Matching

Matches a literal string exactly.

re("pattern") - Regular Expression

Matches a regular expression pattern.

any() - Any Character

Matches any single character.

Combinators

Combinators combine parsers to create more complex patterns.

Sequence - .then() or >>

Alternative - .or() or |

Repetition - .repeat(min, max)

Optional - .maybe()

Advanced

Named Capture - .as("name")

Lookahead - .lookahead(bool)

Ignore Results - .ignore()

Dynamic Parser - dynamic()

Infix Expressions

Parsanol provides special support for parsing infix expressions like mathematical expressions with operator precedence.