Skip to content

QuarticCat/qc-parser-comb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QC Parser Comb

c++20 header-only

A header-only parser combinator library for fun. Aiming to be simple and elegant.

QCPC_DECL(expr);

QCPC_DECL_DEF_(sep)
  = *one<' ', '\t', '\r', '\n'>
  ;
QCPC_DECL_DEF(value)
  = +range<'0', '9'>
  | join(sep, one<'('>, expr, one<')'>)
  ;
QCPC_DECL_DEF(product_op)
  = one<'*', '/'>
  ;
QCPC_DECL_DEF(product)
  = list(value, product_op, sep)
  ;
QCPC_DECL_DEF(sum_op)
  = one<'+', '-'>
  ;
QCPC_DECL_DEF(sum)
  = list(product, sum_op, sep)
  ;
QCPC_DEF(expr)
  = sum
  ;
QCPC_DECL_DEF(grammar)
  = boi & expr & eoi
  ;

Examples

Documentation

See doc folder.

License

MIT

Credits

This project was inspired by following excellent works:

About

A header-only parser combinator library for fun

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published