Documentation
¶
Overview ¶
Package ast defines the Abstract Syntax Tree node types for ClassAds expressions.
Index ¶
- type AttributeAssignment
- type AttributeReference
- type AttributeScope
- type BinaryOp
- type BooleanLiteral
- type ClassAd
- type ConditionalExpr
- type ElvisExpr
- type ErrorLiteral
- type Expr
- type FunctionCall
- type IntegerLiteral
- type ListLiteral
- type Node
- type RealLiteral
- type RecordLiteral
- type SelectExpr
- type StringLiteral
- type SubscriptExpr
- type UnaryOp
- type UndefinedLiteral
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttributeAssignment ¶
AttributeAssignment represents an attribute assignment (name = expr).
func (*AttributeAssignment) String ¶
func (a *AttributeAssignment) String() string
type AttributeReference ¶
type AttributeReference struct {
Name string
Scope AttributeScope
}
AttributeReference represents a reference to an attribute by name.
func (*AttributeReference) String ¶
func (a *AttributeReference) String() string
type AttributeScope ¶
type AttributeScope int
AttributeScope represents the scope of an attribute reference.
const ( // NoScope represents an unscoped attribute reference NoScope AttributeScope = iota // MyScope represents MY.attr (current ClassAd) MyScope // TargetScope represents TARGET.attr (target ClassAd in matching) TargetScope // ParentScope represents PARENT.attr (parent ClassAd) ParentScope )
type BooleanLiteral ¶
type BooleanLiteral struct {
Value bool
}
BooleanLiteral represents a boolean constant (true or false).
func (*BooleanLiteral) String ¶
func (b *BooleanLiteral) String() string
type ClassAd ¶
type ClassAd struct {
Attributes []*AttributeAssignment
}
ClassAd represents a complete ClassAd (a record of attribute assignments).
type ConditionalExpr ¶
ConditionalExpr represents a ternary conditional expression (cond ? true_expr : false_expr).
func (*ConditionalExpr) String ¶
func (c *ConditionalExpr) String() string
type ElvisExpr ¶
type ElvisExpr struct {
Left Expr // The expression to test for undefined
Right Expr // The fallback expression if Left is undefined
}
ElvisExpr represents the Elvis operator (expr1 ?: expr2). If expr1 evaluates to undefined, returns expr2; otherwise returns expr1.
type ErrorLiteral ¶
type ErrorLiteral struct{}
ErrorLiteral represents an error value.
func (*ErrorLiteral) String ¶
func (e *ErrorLiteral) String() string
type Expr ¶
type Expr interface {
Node
// contains filtered or unexported methods
}
Expr represents a ClassAd expression.
type FunctionCall ¶
FunctionCall represents a function call with arguments.
func (*FunctionCall) String ¶
func (f *FunctionCall) String() string
type IntegerLiteral ¶
type IntegerLiteral struct {
Value int64
}
IntegerLiteral represents an integer constant.
func (*IntegerLiteral) String ¶
func (i *IntegerLiteral) String() string
type ListLiteral ¶
type ListLiteral struct {
Elements []Expr
}
ListLiteral represents a list of expressions.
func (*ListLiteral) String ¶
func (l *ListLiteral) String() string
type RealLiteral ¶
type RealLiteral struct {
Value float64
}
RealLiteral represents a floating-point constant.
func (*RealLiteral) String ¶
func (r *RealLiteral) String() string
type RecordLiteral ¶
type RecordLiteral struct {
ClassAd *ClassAd
}
RecordLiteral represents a record (nested ClassAd).
func (*RecordLiteral) String ¶
func (r *RecordLiteral) String() string
type SelectExpr ¶
SelectExpr represents attribute selection (expr.attr).
func (*SelectExpr) String ¶
func (s *SelectExpr) String() string
type StringLiteral ¶
type StringLiteral struct {
Value string
}
StringLiteral represents a string constant.
func (*StringLiteral) String ¶
func (s *StringLiteral) String() string
type SubscriptExpr ¶
SubscriptExpr represents list/record subscripting (expr[index]).
func (*SubscriptExpr) String ¶
func (s *SubscriptExpr) String() string
type UndefinedLiteral ¶
type UndefinedLiteral struct{}
UndefinedLiteral represents an undefined value.
func (*UndefinedLiteral) String ¶
func (u *UndefinedLiteral) String() string