Skip to content

Need an extended example for your typical math expression like grammar #141

Open
@LegalizeAdulthood

Description

@LegalizeAdulthood

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 ==, !=, <, <=, >, >=

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions