parser

package
v0.0.0-...-d04ca2a Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Code generated by goyacc -l -o parser.go parser.y. DO NOT EDIT.

Index

Constants

View Source
const AM = 57363
View Source
const BLANK = 57350
View Source
const COLON = 57351
View Source
const COMMA = 57352
View Source
const DASH = 57346
View Source
const DIGIT = 57349
View Source
const DIV = 57347
View Source
const DOT = 57348
View Source
const EOF = 57354
View Source
const ERROR = 57355
View Source
const HANDAY = 57360
View Source
const HANMONTH = 57359
View Source
const HANYEAR = 57358
View Source
const MONTH = 57357
View Source
const PLUS = 57353
View Source
const PM = 57364
View Source
const SPACE = 57356
View Source
const T = 57365
View Source
const WEEK = 57361
View Source
const Z = 57366
View Source
const ZONE = 57362

Variables

This section is empty.

Functions

This section is empty.

Types

type Date

type Date struct {
	Year  int
	Month int
	Day   int
}

func (*Date) PositionRange

func (d *Date) PositionRange() *PositionRange

func (*Date) Print

func (d *Date) Print() string

type DateTime

type DateTime struct {
	Year        int
	Month       int
	Day         int
	Hour        int
	Minute      int
	Second      int
	Millisecond int
}

func ParseDate

func ParseDate(input string) (*DateTime, error)

Parse parses the input and returs the result.

func (*DateTime) PositionRange

func (d *DateTime) PositionRange() *PositionRange

func (*DateTime) Print

func (d *DateTime) Print() string

type Day

type Day int

func JoinDay

func JoinDay(tokens ...Token) Day

func (Day) PositionRange

func (d Day) PositionRange() *PositionRange

func (Day) Print

func (d Day) Print() string

type Hour

type Hour int

func JoinHour

func JoinHour(tokens ...Token) Hour

func (Hour) PositionRange

func (h Hour) PositionRange() *PositionRange

func (Hour) Print

func (h Hour) Print() string

type Lexer

type Lexer struct {
	Result *DateTime
	// contains filtered or unexported fields
}

func (*Lexer) Error

func (l *Lexer) Error(s string)

Error satisfies yyLexer.

func (*Lexer) Lex

func (l *Lexer) Lex(lval *yySymType) int

Lex satisfies yyLexer.

func (*Lexer) NextItem

func (l *Lexer) NextItem(itemp *Token)

type Millisecond

type Millisecond int

func JoinMillisecond

func JoinMillisecond(tokens ...Token) Millisecond

func (Millisecond) PositionRange

func (s Millisecond) PositionRange() *PositionRange

func (Millisecond) Print

func (s Millisecond) Print() string

type Minute

type Minute int

func JoinMinute

func JoinMinute(tokens ...Token) Minute

func (Minute) PositionRange

func (m Minute) PositionRange() *PositionRange

func (Minute) Print

func (m Minute) Print() string

type Month

type Month int

func ConvToManth

func ConvToManth(m string) Month

func JoinMonth

func JoinMonth(tokens ...Token) Month

func (Month) PositionRange

func (m Month) PositionRange() *PositionRange

func (Month) Print

func (m Month) Print() string

type Node

type Node interface {
	Print() string
	PositionRange() *PositionRange
}

type ParseErr

type ParseErr struct {
	PositionRange PositionRange
	Err           error
	Input         string
	LineOffset    int
}

func (*ParseErr) Error

func (e *ParseErr) Error() string

type ParseErrors

type ParseErrors []ParseErr

func (ParseErrors) Error

func (errs ParseErrors) Error() string

type Pos

type Pos int

type PositionRange

type PositionRange struct {
	Start Pos
	End   Pos
}

type Second

type Second int

func JoinSecond

func JoinSecond(tokens ...Token) Second

func (Second) PositionRange

func (s Second) PositionRange() *PositionRange

func (Second) Print

func (s Second) Print() string

type Time

type Time struct {
	Hour        int
	Minute      int
	Second      int
	Millisecond int
}

func (*Time) PositionRange

func (t *Time) PositionRange() *PositionRange

func (*Time) Print

func (t *Time) Print() string

type Token

type Token struct {
	Typ TokenType
	Pos Pos
	Val string
}

type TokenType

type TokenType int

type Year

type Year int

func JoinYear

func JoinYear(tokens ...Token) Year

func (Year) PositionRange

func (y Year) PositionRange() *PositionRange

func (Year) Print

func (y Year) Print() string

Jump to

Keyboard shortcuts

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