Skip to content

New backend: C++17 using std::variant - #567

Draft
Error10556 wants to merge 238 commits into
BNFC:masterfrom
Error10556:cpp-var
Draft

New backend: C++17 using std::variant#567
Error10556 wants to merge 238 commits into
BNFC:masterfrom
Error10556:cpp-var

Conversation

@Error10556

@Error10556 Error10556 commented Jun 1, 2026

Copy link
Copy Markdown

The idea is to represent categories as std::variant<Label,...> and ditch the visitor pattern (replace with std::visit).

Requires and includes PR #568 .

Features:

  • Built-in and custom tokens (with general regex subtraction)
  • Multiple (non-ambiguous) entrypoints in Bison
  • Full UTF-8 support
  • Pattern matching "language extension" for C++ to simplify std::visit
  • 4 printer classes: ClassicPrettyPrinter, ContextFreePrettyPrinter, SyntaxPrinter (ASCII tree), HaskellPrinter
  • Hierarchical C++ namespaces
  • By-value and by-pointer lists
  • Left-recursive terminator lists in the grammar
  • --positions=start and --positions=range
  • System tests pass
  • No memory leaks (checked with -fsanitize=address and fsanitize=leak in system tests)
  • Lexer and syntax errors reported
  • Rich Makefile
  • README.md tutorial
  • Haddock for all functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant