Skip to content

Echorial/carpeg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://www.echorial.com GitHub code size in bytes GitHub last commit license

A simple parser generator inspired by Peg.js

Demo

Online editor

Tutorial

Installation

$ npm install carpeg-cli

Basic parser

// myParser.cpeg
import WhiteSpace
import String

map|start = "~" _ items: Item*|"|" _ "~";

map|Item = _ value: ([0-9] / String)
{map|
	export = $value;
};

Generating

$ carpeg generate myParser.cpeg myParser.js --target javascript

Parser usage

const myParser = require("myParser.js");
myParser.parse("~ 1|3|4|'Hello' ~") // Array(1, 3, 4, "hello")

Platform support

https://www.echorial.com https://www.echorial.com

About

A simple parser generator inspired by Peg.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published