ast

package
v0.0.0-...-df3f4e6 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package ast provides means to represent an AST of a vql expression.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AfterExpr

type AfterExpr struct {
	NamePos token.Pos // keyword position
	X       Lit       // operand
}

func (*AfterExpr) End

func (x *AfterExpr) End() token.Pos

func (*AfterExpr) Pos

func (x *AfterExpr) Pos() token.Pos

type BeforeExpr

type BeforeExpr struct {
	NamePos token.Pos // keyword position
	X       Lit       // operand
}

func (*BeforeExpr) End

func (x *BeforeExpr) End() token.Pos

func (*BeforeExpr) Pos

func (x *BeforeExpr) Pos() token.Pos

type BinaryExpr

type BinaryExpr struct {
	X     Expr        // left operand
	OpPos token.Pos   // position of Op
	Op    token.Token // operator
	Y     Expr        // right operand
}

A BinaryExpr node represents a binary expression.

func (*BinaryExpr) End

func (x *BinaryExpr) End() token.Pos

func (*BinaryExpr) Pos

func (x *BinaryExpr) Pos() token.Pos

type Expr

type Expr interface {
	Node
	// contains filtered or unexported methods
}

All expression nodes implement the Expr interface.

type Ident

type Ident struct {
	NamePos token.Pos // identifier position
	Name    string    // identifier name
}

func (*Ident) End

func (x *Ident) End() token.Pos

func (*Ident) Pos

func (x *Ident) Pos() token.Pos

type IsExpr

type IsExpr struct {
	NamePos token.Pos // keyword position
	X       Ident     // ident (image, video, ...)
}

func (*IsExpr) End

func (x *IsExpr) End() token.Pos

func (*IsExpr) Pos

func (x *IsExpr) Pos() token.Pos

type LatLon

type LatLon struct {
	Lparen token.Pos
	Lat    Lit
	Comma  token.Pos
	Lon    Lit
	Rparen token.Pos
}

func (*LatLon) End

func (x *LatLon) End() token.Pos

func (*LatLon) Pos

func (x *LatLon) Pos() token.Pos

type Lit

type Lit struct {
	ValuePos token.Pos  // literal position
	Kind     token.Kind // token.INT, token.FLOAT, token.STRING or token.TIME
	Value    string     // literal string
}

func (*Lit) End

func (x *Lit) End() token.Pos

func (*Lit) Pos

func (x *Lit) Pos() token.Pos

type LocExpr

type LocExpr struct {
	NamePos token.Pos // keyword position
	LatLon  *LatLon   // loc:(lat,lon)
	Value   string    // loc:paris, loc:"paris, france"
}

func (*LocExpr) End

func (x *LocExpr) End() token.Pos

func (*LocExpr) Pos

func (x *LocExpr) Pos() token.Pos

type Node

type Node interface {
	Pos() token.Pos // position of first character belonging to the node
	End() token.Pos // position of first character immediately after the node
	// contains filtered or unexported methods
}

All node types implement the Node interface.

type ParenExpr

type ParenExpr struct {
	Lparen token.Pos
	X      Expr
	Rparen token.Pos
}

func (*ParenExpr) End

func (x *ParenExpr) End() token.Pos

func (*ParenExpr) Pos

func (x *ParenExpr) Pos() token.Pos

type RefExpr

type RefExpr struct {
	NamePos token.Pos // keyword position
	X       Lit       // literal
}

func (*RefExpr) End

func (x *RefExpr) End() token.Pos

func (*RefExpr) Pos

func (x *RefExpr) Pos() token.Pos

type TagExpr

type TagExpr struct {
	NamePos token.Pos // keyword position
	X       Lit       // literal
}

func (*TagExpr) End

func (x *TagExpr) End() token.Pos

func (*TagExpr) Pos

func (x *TagExpr) Pos() token.Pos

type UnaryExpr

type UnaryExpr struct {
	OpPos token.Pos   // position of Op
	Op    token.Token // operator
	X     Expr        // operand
}

A UnaryExpr node represents a unary expression.

func (*UnaryExpr) End

func (x *UnaryExpr) End() token.Pos

func (*UnaryExpr) Pos

func (x *UnaryExpr) Pos() token.Pos

Jump to

Keyboard shortcuts

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