parser

package
v0.0.0-...-f86670d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Parser = participle.MustBuild[AST](participle.Lexer(lex))

Functions

This section is empty.

Types

type AST

type AST struct {
	Type  *string `(@Type WS)?`
	Items []*Item `@@*`
}

type Change

type Change struct {
	Pos   lexer.Position
	Type  string     `@("FM"|"BECMG"|"TEMPO")`
	Time  string     `@Number?`
	Valid *ValidPair `WS? @@?`
}

type Flag

type Flag struct {
	Pos   lexer.Position
	CAVOK bool `@"CAVOK"`
}

type Item

type Item struct {
	Pos          lexer.Position
	Time         *string       `( @Number "Z" WS`
	Valid        *ValidPair    `  @@`
	Probability  *Probability  `| @@`
	Change       *Change       `| @@`
	WindSpeed    *WindSpeed    `| @@`
	Visibility   *Visibility   `| @@`
	SkyCondition *SkyCondition `| @@`
	Vicinity     *Vicinity     `| @@`
	Weather      *Weather      `| @@`
	Temperature  *Temperature  `| @@`
	Flag         *Flag         `| @@`
	Remark       *string       `| @Remark`
	ID           *string       `| @Ident ) WS?`
}

type Probability

type Probability struct {
	Pos   lexer.Position
	Value string    `Prob @Number`
	Valid ValidPair `(WS @@)?`
}

type SkyCondition

type SkyCondition struct {
	Pos       lexer.Position
	Type      string `@("FEW"|"SCT"|"BKN"|"OVC"|"VV"|"SKC")`
	Altitude  string `@Number?`
	CloudType string `@("CB"|"TCU")?`
}

type Temperature

type Temperature struct {
	Pos   lexer.Position
	Type  string `@("TX"|"TN")`
	Value string `@Number "/"`
	Time  string `@Number "Z"`
}

type ValidPair

type ValidPair struct {
	Pos   lexer.Position
	Start string `@Number "/"`
	End   string `@Number`
}

type Vicinity

type Vicinity struct {
	Pos           lexer.Position
	Descriptor    string `"VC" ( @Descriptor`
	Precipitation string `     | @Precip )`
}

type Visibility

type Visibility struct {
	Pos   lexer.Position
	Plus  bool   `@"P"?`
	Value string `@Number @WS? @(Number? "/" Number)?`
	Unit  string `@"SM"?`
}

type Weather

type Weather struct {
	Pos           lexer.Position
	Modifier      string `@Modifier?`
	Descriptor    string `@Descriptor?`
	Precipitation string ` ( @Precip`
	Obscuration   string ` | @Obscur`
	Other         string ` | @Phenom )`
}

type WindSpeed

type WindSpeed struct {
	Pos       lexer.Position
	WindShear string `("WS" @Number "/")?`
	Variable  bool   `@"VRB"?`
	Value     string `@Number`
	Gusts     string `("G" @Number)?`
	Unit      string `@("MPS"|"KMH"|"KT")`
}

Jump to

Keyboard shortcuts

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