parser

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 12 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

View Source
var ErrEmptyConnDef error = errors.New("Connection must be either normal or array bypass")

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) ParseFiles

func (p Parser) ParseFiles(
	modRef src.ModuleRef,
	pkgName string,
	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(
	modRef src.ModuleRef,
	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