ast

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicLit

type BasicLit struct {
	ValuePos token.Pos   // literal position
	Kind     token.Token // token.STRING or token.CHAR
	Value    string
}

BasicLit: STRING | CHAR

func (*BasicLit) End

func (p *BasicLit) End() token.Pos

func (*BasicLit) Pos

func (p *BasicLit) Pos() token.Pos

type BinaryExpr

type BinaryExpr struct {
	X     Expr        // left operand
	OpPos token.Pos   // operator position
	Op    token.Token // operator: token.REM (list operator)
	Y     Expr        // right operand
}

BinaryExpr: R1 % R2

func (*BinaryExpr) End

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

func (*BinaryExpr) Pos

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

type Choice

type Choice struct {
	Options []Expr // multiple options
}

Choice: R1 | R2 | ... | Rn

func (*Choice) End

func (p *Choice) End() token.Pos

func (*Choice) Pos

func (p *Choice) Pos() token.Pos

type Decl

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

Decl: Rule

type Expr

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

Expr: Ident, BasicLit, Choice, Sequence, UnaryExpr, BinaryExpr

type File

type File struct {
	Decls     []Decl
	FileStart token.Pos
}

File: *Decl

func (*File) End

func (p *File) End() token.Pos

func (*File) Pos

func (p *File) Pos() token.Pos

type Ident

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

Ident: IDENT

func (*Ident) End

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

func (*Ident) Pos

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

type Node

type Node interface {
	Pos() token.Pos
	End() token.Pos
}

Node: File, Decl, Expr

type Rule

type Rule struct {
	Name   *Ident
	TokPos token.Pos // position of '='
	Expr   Expr
}

Rule: IDENT '=' Expr

func (*Rule) End

func (p *Rule) End() token.Pos

func (*Rule) Pos

func (p *Rule) Pos() token.Pos

type Sequence

type Sequence struct {
	Items []Expr // multiple items
}

Sequence: R1 R2 ... Rn

func (*Sequence) End

func (p *Sequence) End() token.Pos

func (*Sequence) Pos

func (p *Sequence) Pos() token.Pos

type UnaryExpr

type UnaryExpr struct {
	OpPos token.Pos   // operator position
	Op    token.Token // operator: token.MUL, token.ADD or token.QUESTION
	X     Expr        // operand
}

UnaryExpr: *R, +R or ?R

func (*UnaryExpr) End

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

func (*UnaryExpr) Pos

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳