parser

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

This parser package provides lexer and parser of lambda calculus.

Note that parser.go is auto-generated from parser.y, using goyacc. (So there is some auto-generated constants even in godoc of this package.)

If you want to re-generate parser.go, run

$ go generate

or use goyacc directly (please look at generate.go).

If you want to know more, especially about <prefix>Lexer and <prefix>Parser, read the godoc of goyacc.

References:

TODO(nekketsuuu): Add a location info into yyLex, and print a error with the location.

TODO(nekketsuuu): Use buffer instead of naive []bytes.

Index

Constants

View Source
const DOT = 57349
View Source
const IDENT = 57350
View Source
const LAMBDA = 57348
View Source
const LPAR = 57346
View Source
const RPAR = 57347

Variables

This section is empty.

Functions

func IsBasicDigit

func IsBasicDigit(r rune) bool

IsBasicDigit reports whether the rune is a letter of [0-9].

func IsBasicLatinAlphabet

func IsBasicLatinAlphabet(r rune) bool

IsBasicLatinAlphabet reports whether the rune is a letter of [A-Za-z].

func ParseExpr

func ParseExpr(e string) (syntax.Lambda, error)

ParseExpr returns the lambda AST of the argument.

func ParseFile

func ParseFile(filename string) (syntax.Lambda, error)

ParseFile parses single file as a lambda term, and return the AST.

Note that this function is different from go/parser.ParseFile. ParseFile converts the content of the file into the AST

Note that the interface of this function is different from go/parser.ParseFile

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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