Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EvaluationError ¶
type EvaluationError struct { // Source line/column position where the error occurred. Expr Expr // Error message. Message string }
EvaluationError is the type of error returned by interpreter when evaluating errors.
func (*EvaluationError) Error ¶
func (e *EvaluationError) Error() string
Error returns a formatted version of the error, including the line number.
type Interpreter ¶
type Interpreter struct {
// contains filtered or unexported fields
}
func New ¶
func New(expression string) (*Interpreter, error)
type LiteralExpr ¶
type LiteralExpr struct {
Name string
}
LiteralExpr is an expression like 'cpu123'
func (*LiteralExpr) Accept ¶
func (l *LiteralExpr) Accept(a *AST) value
Accept looks into AST variables map and return the numberic value of the variable or it panics.
func (*LiteralExpr) String ¶
func (l *LiteralExpr) String() string
type ParseError ¶
type ParseError struct { // Source line/column position where the error occurred. Position int // Error message. Message string }
ParseError (actually *ParseError) is the type of error returned by parse.
func (*ParseError) Error ¶
func (e *ParseError) Error() string
Error returns a formatted version of the error, including the line number.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.