boostorg / boostorg/parser

Need an extended example for your typical math expression like grammar

Open
#141 18 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
182
Forks
28
PR merge metrics
No merged PRs in 30d

Description

Lots of times when people get down into the nitty gritty of using a parsing framework, it's because their ad-hoc attempts at using a regex or whatever for a complicated grammar becomes unwieldy. One of the most common needs for using a parsing framework is when you need to parse arithmetic expressions with operator precedence similar to C/C++.

An elaborated example that demonstrated parsing expression using all the typical operators:

- additive operators `+`, `-` (unary and binary)
- multiplicative operators `/`, `*`
- bitwise operators `&`, `|`, `^`, `~`, `<<`, `>>`
- comparison operators `==`, `!=`, `<`, `<=`, `>`, `>=`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.