parser

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

This is a *generic* implementation of a lexer. gengen should be used to create a specific version of this lexer. If this file does not contain the gengen package, then it has already been generated by gengen. TODO: remove this hack if/when golang ever supports proper generics.

This is a *generic* implementation of a parser. gengen should be used to create a specific version of this parser. If this file does not contain the gengen package, then it has already been generated by gengen. TODO: remove this hack if/when golang ever supports proper generics.

Index

Constants

View Source
const EOFRUNE = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type AstNode

type AstNode interface {
	// Connect connects this AstNode to another AstNode with the given predicate,
	// and returns the same AstNode.
	Connect(predicate string, other AstNode) AstNode

	// Decorate decorates this AstNode with the given property and string value,
	// and returns the same AstNode.
	Decorate(property string, value string) AstNode

	// Decorate decorates this AstNode with the given property and int value,
	// and returns the same AstNode.
	DecorateWithInt(property string, value int) AstNode
}

AstNode defines an interface for working with nodes created by this parser.

type NodeBuilder

type NodeBuilder func(source compilercommon.InputSource, kind generic.U) AstNode

NodeBuilder is a function for building AST nodes.

Jump to

Keyboard shortcuts

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