parser

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 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 Manifest

type Manifest struct {
	WantCompilerVersion string      `yaml:"compiler"`
	Deps                []ModuleRef `yaml:"deps"`
}

type ModuleRef

type ModuleRef struct {
	Path    string `yaml:"path"`
	Version string `yaml:"version"`
	Alias   string `yaml:"alias"`
}

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,
	modRef src.ModuleRef,
) (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