Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 2.17 KB

README.md

File metadata and controls

37 lines (28 loc) · 2.17 KB

piraha-peg

Piraha is a Parsing Expression Grammar library written in Java

The name comes from the spoken language called Pirahã, which by some measure is considered the simplest language in the world.

The syntax is loosely based on regular expressions as they are found in Perl or Java. The Reference link below provides a detailed description of the pattern elements. The Quick Start describes how to use the API. See the Calculator and CSscript examples to get a more detailed idea on how to write programs with Piraha.

Note, however, that since Piraha does not describe a Regular Language the pattern expressions used to describe it are not properly called "regular expressions." However, because of the similarity in form between Parsing Expression Grammars (PEGs) and regular expressions, I use the term "pegular expressions" instead.

Reference - This reference card provides a description of the pattern elements that can be used in a pegular expression.

Quick Start - This guide shows you how to call the Piraha engine from Java. It also explains the differences between the Piraha matcher and a regular expression matcher.

Grammar Files - This document explains how to construct and use Piraha expressions from inside a Grammar File, i.e. a file containing multiple pegular expressions.

Calculator - What grammar engine is complete without a calculator example?

CScript - Calculators are boring! Here's how you can write a complete language using Piraha.

Citing Piraha This is a link to the Piraha Paper. You can also cite the digital object identifier: [https://dx.doi.org/10.6084/m9.figshare.3837840](DOI: https://dx.doi.org/10.6084/m9.figshare.3837840)