parser

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: MIT Imports: 11 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	Lexer *lexer.Lexer

	Mode ParserMode
	// contains filtered or unexported fields
}

Parser represents lexical analyzer struct

func New

func New(l *lexer.Lexer) *Parser

New initializes a parser and returns it

func (*Parser) IsNotDefMethodToken added in v0.1.9

func (p *Parser) IsNotDefMethodToken() bool

IsNotDefMethodToken ensures correct naming in Def statement

func (*Parser) IsNotParamsToken added in v0.1.9

func (p *Parser) IsNotParamsToken() bool

IsNotParamsToken ensures correct parameters which means it is not InstanceVariable

func (*Parser) ParseProgram

func (p *Parser) ParseProgram() (program *ast.Program, err *errors.Error)

ParseProgram update program statements and return program

type ParserMode added in v0.1.11

type ParserMode int

ParserMode determines the running mode. These are the enums for marking parser's mode, which decides whether it should pop unused values.

const (
	NormalMode ParserMode = iota + 1
	REPLMode
	TestMode
)

These are the enums for marking parser's mode, which decides whether it should pop unused values.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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