parser

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package parser implements source code parsing. It uses parser (and lexer) generated by ANTLR4 from neva.g4 grammar file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomErrorListener added in v0.4.0

type CustomErrorListener struct {
	*antlr.DefaultErrorListener
	Errors []error
}

func (*CustomErrorListener) SyntaxError added in v0.4.0

func (c *CustomErrorListener) SyntaxError(
	_ antlr.Recognizer,
	offendingSymbol any,
	line, column int,
	msg string,
	e antlr.RecognitionException,
)

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func New

func New(isDebug bool) Parser

func (Parser) ParseFile

func (p Parser) ParseFile(bb []byte) (f src.File, err *compiler.Error)

func (Parser) ParseFiles

func (p Parser) ParseFiles(files map[string][]byte) (map[string]src.File, *compiler.Error)

func (Parser) ParseManifest

func (p Parser) ParseManifest(raw []byte) (src.ModuleManifest, error)

func (Parser) ParseModules

func (p Parser) ParseModules(
	rawMods map[src.ModuleRef]compiler.RawModule,
) (map[src.ModuleRef]src.Module, *compiler.Error)

func (Parser) ParsePackages

func (p Parser) ParsePackages(
	rawPkgs map[string]compiler.RawPackage,
) (map[string]src.Package, *compiler.Error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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