parser

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package parser implements the syntax analyzer.

Index

Constants

View Source
const (
	TkDot                = 57369
	TkEQ                 = 57363
	TkGE                 = 57367
	TkGT                 = 57365
	TkIdent              = 57358
	TkKeywordAnd         = 57349
	TkKeywordContains    = 57351
	TkKeywordCurrentTime = 57352
	TkKeywordFalse       = 57347
	TkKeywordList        = 57354
	TkKeywordNot         = 57350
	TkKeywordNumber      = 57353
	TkKeywordOr          = 57348
	TkKeywordTrue        = 57346
	TkKeywordVersion     = 57355
	TkLE                 = 57368
	TkLT                 = 57364
	TkNE                 = 57366
	TkNumber             = 57356
	TkParL               = 57359
	TkParR               = 57360
	TkSBktL              = 57361
	TkSBktR              = 57362
	TkText               = 57357
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Lex

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

Lex provides the lexical scanner interface required by the generated parser.

func (*Lex) Error

func (l *Lex) Error(s string)

func (*Lex) Lex

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

Lex is called by the syntatical parser to request the next token.

type Result

type Result struct {
	Eval      bool   // evaluation result
	Errors    int    // number of non-syntactic errors
	Status    int    // parser status is 0 <=> 0 syntax erros
	LastError string // record last error message
}

Result returns parser result.

func Run

func Run(input io.Reader, vars map[string]interface{}, debug bool) Result

Run executes parser for input.

func RunString

func RunString(input string, vars map[string]interface{}, debug bool) Result

RunString executes parser for string.

func (Result) IsError

func (r Result) IsError() bool

IsError is a helper method to check for parser errors.

Jump to

Keyboard shortcuts

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