pegman

package module
v0.0.0-...-86832bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

README

PEGman

An experimental, opinionated parser generator

Maintaining the handcrafted parser for our ntt project is challenging, mostly because aligning parser-dependent syntax trees and visitors is tedious. Hence I decided to automate this task with a custom parser generator.
Existing solutions did not fit our requirements very well. Some parsers are not sufficient for large scale input. Others could not produce a lossless syntax tree.

This parser generator is an experiment. I do not know where this project will take us, yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func First

func First(g ebnf.Grammar, x ebnf.Expression) []string

First returns the first token set of a given expression

func Inspect

func Inspect(e ebnf.Expression, fn func(e ebnf.Expression) bool) bool

Inspect traverses the given expression and calls the given function for each.

func IsLexical

func IsLexical(name string) bool

IsLexical returns true, when given name is a lexical production.

func Productions

func Productions(g ebnf.Grammar) []*ebnf.Production

Productions returns the productions of the grammar in the order they appear in the source file.

func Tokens

func Tokens(g ebnf.Grammar) []string

Tokens returns an alphabetically sorted list of unique tokens that are used in the grammar.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL