parse

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Special
	ILLEGAL = iota //ILLEGAL represents anything that cannot be identified by any other token
	EOF            //EOF represents the end of file token
	WS             //WS identifies a whitespace

	//Literals
	IDENT //todos and dates

	//Key Symbols
	STATUS_OPEN  //[
	STATUS_CLOSE //]

	//Misc
	SLASH         // /
	SEMICOLON     // ;
	COLON         // :
	ASTERISK      // *
	COMMA         // ,
	DOT           // .
	HASHTAG       // #
	BRACKET       // ( )
	CURRENCY_SIGN // $ €
	PARAGRAPH     // §
	AMPERSAND     // &
	EQUALS        // =
	TILDE         // ~
	AT            // @
	PERCENT       // %
	DASH          // -
	UNDERSCORE    // _
)
View Source
const Timeformat string = "02.01.06"

Timeformat describes the format used to parse dates

Variables

This section is empty.

Functions

func NewScanner

func NewScanner(r io.Reader) *scanner

NewScanner returns a new instance of Scanner

Types

type Parser

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

Parser provides the functionality to parse files that were tokenized by lexer

func NewParser

func NewParser(r io.Reader) *Parser

NewParser returns an instance of a new parser

func (*Parser) Parse

func (p *Parser) Parse() (task.Day, error)

Parse returns a the next task.Day struct that can be parsed from the input or an error if no new task.Day can be parsed

func (Parser) Scan

func (s Parser) Scan() (tok Token, lit string)

Scan returns the next token and its value

type Token

type Token int

Token identifies the type of data that was read

Jump to

Keyboard shortcuts

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