Languages Features Creators CSV Resources Challenges Add Language
GitHub icon

PEG

PEG - Grammar language

< >

PEG, aka parsing expression grammar, is a grammar language created in 2002.

#407on PLDB 21Years Old 955Users
0Books 0Papers

In computer science, a parsing expression grammar, or PEG, is a type of analytic formal grammar, i.e. it describes a formal language in terms of a set of rules for recognizing strings in the language. The formalism was introduced by Bryan Ford in 2004 and is closely related to the family of top-down parsing languages introduced in the early 1970s. Read more on Wikipedia...


Example from the web:
Expr ← Sum Sum ← Product (('+' / '-') Product)* Product ← Value (('*' / '/') Value)* Value ← [0-9]+ / '(' Expr ')'
Example from Wikipedia:
Value ← [0-9.]+ / '(' Expr ')' Product ← Expr (('*' / '/') Expr)* Sum ← Expr (('+' / '-') Expr)* Expr ← Product / Sum / Value

Language features

Feature Supported Token Example
Comments
Line Comments
croc.html · peg.html · nsis.html

View source

- Build the next great programming language · Search · Day 214 · About · Blog · Acknowledgements · Traffic · Traffic Today · GitHub · feedback@pldb.com