parser

package
v0.0.0-...-8c2d49f Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode int

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

const (
	NormalMode Mode = iota
	REPLMode
	TestMode
	CommandLineMode
)

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

type Parser

type Parser struct {
	Lexer lexer.Lexer

	Mode Mode
	// contains filtered or unexported fields
}

Parser represents lexical analyzer struct

func New

func New(l lexer.Lexer, mode Mode) *Parser

New creates a new parser and returns it

func (*Parser) IsNotDefMethodToken

func (p *Parser) IsNotDefMethodToken() bool

IsNotDefMethodToken ensures correct naming in Def statement

func (*Parser) IsNotParamsToken

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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