parser

package
v0.0.0-...-055c8ff Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2015 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fuzz

func Fuzz(data []byte) int

Types

type ParseError

type ParseError struct {
	Line, Column int
	File         *ast.File
	// contains filtered or unexported fields
}

ParseError represents an error found during parsing.

func (ParseError) Error

func (p ParseError) Error() string

func (ParseError) String

func (p ParseError) String() string

type ParseErrorList

type ParseErrorList []ParseError

ParseErrorList is a list of ParseErrors.

func (ParseErrorList) Error

func (p ParseErrorList) Error() string

Error formats p into a string.

type Parser

type Parser struct {
	Debug       bool // Debug causes the parser to print all errors to stdout and relay any panic upon internal panic recovery.
	PrintTokens bool // PrintTokens causes the parser to print all tokens received from the lexer to stdout.
	MaxErrors   int  // Indicates the number of errors to allow before triggering a panic. The default is 10.
	FileSet     *ast.FileSet
	// contains filtered or unexported fields
}

Parser handles scanning through and parsing a PHP source string into an AST. It is configurable to have various types of debugging features.

func NewParser

func NewParser() *Parser

NewParser readies a parser

func (*Parser) Parse

func (p *Parser) Parse(filepath, input string) (file *ast.File, err error)

Parse consumes the input string to produce an AST that represents it.

Jump to

Keyboard shortcuts

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