parser

package
v1.0.0-early-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lexer

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

Lexer is the tokenizer type

func NewLexer

func NewLexer(input string) *Lexer

NewLexer creates a lexer from a string

type Parser

type Parser struct {
	Error *string
	// contains filtered or unexported fields
}

Parser is the base parsing struct

func NewParser

func NewParser(l *Lexer) *Parser

NewParser creates a parsing from a Lexer

func (*Parser) Parse

func (p *Parser) Parse() []ast.Statement

Parse is the main parsing function. Use this to get an array of Statements.

func (*Parser) ParseAtom

func (p *Parser) ParseAtom() (res ast.Expression)

ParseAtom parses all literals

func (*Parser) ParseBlock

func (p *Parser) ParseBlock() *ast.Block

ParseBlock parses a block

func (*Parser) ParseExpression

func (p *Parser) ParseExpression(pr byte) ast.Expression

ParseExpression parses an expression

func (*Parser) ParseExpressionStatement

func (p *Parser) ParseExpressionStatement() ast.Statement

ParseExpressionStatement parses an expression statement

func (*Parser) ParseIden

func (p *Parser) ParseIden() ast.Expression

ParseIden parses a variable name

func (*Parser) ParseIfElse

func (p *Parser) ParseIfElse() *ast.IfElse

ParseIfElse parses an if, else expression

func (*Parser) ParseStatement

func (p *Parser) ParseStatement() ast.Statement

ParseStatement parses a single statement

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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