Skip to content

tvanriel/go-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-parser

A simple parser helper written in go with the go-lexer in mind.

Usage

import(
    lex "github.com/bbuck/go-lexer"
)

func Parse(tokens []*lex.Token) (*parse.AST, error) {
	p := &parse.Parser{
		Tokens: tokens,
		Cur:    0,
		AST:    &parse.AST{},
	}
	for p.Continue() {
		ParseTextOrDirective(p)
	}
	if p.Err() != nil {
		return nil, p.Err()
	}
	return p.AST, nil
}

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages