parser

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package parser provides a recursive descent parser for the oh language.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

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

T holds the state of the parser.

func New

func New(emit func(cell.I), item func() *token.T) *T

New creates a new parser. It connects a producer of tokens with a consumer of cells.

func (*T) Copy

func (p *T) Copy(emit func(cell.I), item func() *token.T) *T

Copy copies the current parser but replaces its emit and item functions.

func (*T) Current

func (p *T) Current() cell.I

Current returns the command currently being parsed.

func (*T) Parse

func (p *T) Parse() (err error)

Parse consumes tokens and emits cells until there are no more tokens.

Jump to

Keyboard shortcuts

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