{"repo":"alecthomas/participle","free":true,"listed":false,"github":"https://github.com/alecthomas/participle","clone":"git clone https://github.com/alecthomas/participle.git","description":"A parser library for Go","language":"Go","stars":3876,"topics":["go","parser","lexer","grammar","ast","parser-library","parser-framework","parser-api","golang","ebnf"],"license":"MIT","category":"dev-tools","readme_excerpt":"A dead simple parser package for Go - V2 - Introduction - Tutorial - Tag syntax - Overview - Grammar syntax - Capturing - Capturing boolean value - \"Union\" types - Custom parsing - Lexing - Stateful lexer - Example stateful lexer - Example simple/non-stateful lexer - Experimental - code generation - Options - Examples - Performance - Concurrency - Error reporting - Comments - Limitations - EBNF - Syntax/Railroad Diagrams V2 This is version 2 of Participle. It can be installed with: The latest version from v0 can be installed via: Introduction The goal of this package is to provide a simple, idiomatic and elegant way of defining parsers in Go. Participle's method of defining grammars should be familiar to any Go programmer who has used the encoding/json package: struct field tags define what and how input is mapped to those same fields. This is not unusual for Go encoders, but is unusual for a parser. Tutorial A tutorial is available, walking through the creation of an .ini parser. Tag syntax Participle supports two forms of struct tag grammar syntax. The easiest to read is when the grammar uses the entire struct tag content, eg. However, this does not coexist well with other tags such as JSON, etc. and may cause issues with linters. If this is an issue then you can use the parser:\"\" tag format. In this case single quotes can be used to quote literals making the tags somewhat easier to write, eg. Overview A grammar is an annotated Go structure used to both define the parser gr","default_branch":null,"files":null,"tree":[],"storefront":"/r/alecthomas","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/alecthomas/participle/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}