parser

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package parser TODO

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

Parser holds a Lexer, errors, the currentToken, and the peek peekToken (next token). Parser methods handle iterating through tokens and building and AST.

func New

func New(l *lexer.Lexer) *Parser

New takes a Lexer, creates a Parser with that Lexer, sets the current and peek tokens, and returns the Parser.

func (*Parser) Errors

func (p *Parser) Errors() string

Errors is simply a helper function that returns the parser's errors

func (*Parser) ParseJSON

func (p *Parser) ParseJSON() (ast.RootNode, error)

ParseJSON parses tokens and creates an AST. It returns the RootNode which holds a slice of Values (and in turn, the rest of the tree)

Jump to

Keyboard shortcuts

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