deployr: Index | Files

package parser

import ""

Package parser is the package which parses our input.

Given a lexer, wrapping a given input-file, we parse tokens from it into a series of statements which we then return for processing.


Package Files


type Parser Uses

type Parser struct {
    // Our tokenizer.
    Tokenizer tokenizer

Parser holds our internal state.

func New Uses

func New(tk tokenizer) *Parser

New returns a new Parser object, consuming tokens from the specified tokenizer-interface.

func (*Parser) GetArguments Uses

func (p *Parser) GetArguments(expected []token.Token) ([]token.Token, error)

GetArguments fetches arguments from the lexer, ensuring they're the expected types.

func (*Parser) Parse Uses

func (p *Parser) Parse() ([]statement.Statement, error)

Parse the given program, catching errors.

Package parser imports 3 packages (graph) and is imported by 1 packages. Updated 2020-04-07. Refresh now. Tools for package owners.