Documentation
¶
Index ¶
- Variables
- func IsBlank(conformance Conformance) bool
- func IsDeprecated(conformance Conformance) bool
- func IsDescribed(conformance Conformance) bool
- func IsDisallowed(conformance Conformance) bool
- func IsGeneric(conformance Conformance) bool
- func IsMandatory(conformance Conformance) bool
- func IsProvisional(conformance Conformance) bool
- func IsRequired(conformance Conformance) bool
- func IsZigbee(conformance Conformance) bool
- func Parse(filename string, b []byte, opts ...Option) (any, error)
- func ParseFile(filename string, opts ...Option) (i any, err error)
- func ParseReader(filename string, r io.Reader, opts ...Option) (any, error)
- type BooleanValue
- func (bv BooleanValue) ASCIIDocString() string
- func (bv BooleanValue) Clone() ComparisonValue
- func (bv *BooleanValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (result ExpressionResult, err error)
- func (bv BooleanValue) Description() string
- func (bv *BooleanValue) Equal(ofv ComparisonValue) bool
- func (bv *BooleanValue) Result() ComparisonValue
- func (bv *BooleanValue) Value(context Context) (ExpressionResult, error)
- type Choice
- type ChoiceExactLimit
- type ChoiceLimit
- type ChoiceMaxLimit
- type ChoiceMinLimit
- type ChoiceRangeLimit
- type ComparisonExpression
- func (ce *ComparisonExpression) ASCIIDocString() string
- func (ce *ComparisonExpression) Clone() Expression
- func (ce *ComparisonExpression) Description() string
- func (ce *ComparisonExpression) Equal(e Expression) bool
- func (ce *ComparisonExpression) Eval(context Context) (ExpressionResult, error)
- func (ce *ComparisonExpression) MarshalJSON() ([]byte, error)
- type ComparisonOperator
- type ComparisonValue
- type Confidence
- type Conformance
- type ConformanceState
- type Context
- type Deprecated
- func (d *Deprecated) ASCIIDocString() string
- func (d *Deprecated) Clone() Conformance
- func (d *Deprecated) Description() string
- func (d *Deprecated) Equal(c Conformance) bool
- func (d *Deprecated) Eval(context Context) (ConformanceState, error)
- func (d *Deprecated) RawText() string
- func (d *Deprecated) Type() Type
- type Described
- type Disallowed
- func (d *Disallowed) ASCIIDocString() string
- func (d *Disallowed) Clone() Conformance
- func (d *Disallowed) Description() string
- func (d *Disallowed) Equal(c Conformance) bool
- func (d *Disallowed) Eval(context Context) (ConformanceState, error)
- func (d *Disallowed) RawText() string
- func (d *Disallowed) Type() Type
- type EqualityExpression
- func (ee *EqualityExpression) ASCIIDocString() string
- func (ee *EqualityExpression) Clone() Expression
- func (ee *EqualityExpression) Description() string
- func (ee *EqualityExpression) Equal(e Expression) bool
- func (ee *EqualityExpression) Eval(context Context) (result ExpressionResult, err error)
- func (ee *EqualityExpression) MarshalJSON() ([]byte, error)
- type Expression
- type ExpressionResult
- type ExpressionType
- type FloatValue
- func (fv FloatValue) ASCIIDocString() string
- func (fv FloatValue) Clone() ComparisonValue
- func (fv *FloatValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
- func (fv FloatValue) Description() string
- func (fv *FloatValue) Equal(ofv ComparisonValue) bool
- func (fv *FloatValue) Value(context Context) (ExpressionResult, error)
- type Generic
- type HasConformance
- type HasExpression
- type HexValue
- func (fv HexValue) ASCIIDocString() string
- func (fv HexValue) Clone() ComparisonValue
- func (fv *HexValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
- func (fv HexValue) Description() string
- func (fv *HexValue) Equal(ofv ComparisonValue) bool
- func (fv *HexValue) Value(context Context) (ExpressionResult, error)
- type IdentifierExpression
- func (ie *IdentifierExpression) ASCIIDocString() string
- func (ie *IdentifierExpression) Clone() Expression
- func (ie *IdentifierExpression) Description() string
- func (ie *IdentifierExpression) Equal(e Expression) bool
- func (ie *IdentifierExpression) Eval(context Context) (ExpressionResult, error)
- func (ie *IdentifierExpression) MarshalJSON() ([]byte, error)
- type IdentifierValue
- func (ie *IdentifierValue) ASCIIDocString() string
- func (ie *IdentifierValue) Clone() ComparisonValue
- func (ie *IdentifierValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
- func (ie *IdentifierValue) Description() string
- func (ie *IdentifierValue) Equal(e ComparisonValue) bool
- func (ie *IdentifierValue) Value(context Context) (ExpressionResult, error)
- type IntValue
- func (fv IntValue) ASCIIDocString() string
- func (fv IntValue) Clone() ComparisonValue
- func (fv *IntValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
- func (fv IntValue) Description() string
- func (fv *IntValue) Equal(ofv ComparisonValue) bool
- func (fv *IntValue) Value(context Context) (ExpressionResult, error)
- type LogicalExpression
- func (le *LogicalExpression) ASCIIDocString() string
- func (le *LogicalExpression) Clone() Expression
- func (le *LogicalExpression) Description() string
- func (le *LogicalExpression) Equal(e Expression) bool
- func (le *LogicalExpression) Eval(context Context) (ExpressionResult, error)
- func (le *LogicalExpression) MarshalJSON() ([]byte, error)
- type Mandatory
- type MathOperand
- type MathOperation
- func (mv *MathOperation) ASCIIDocString() string
- func (mv *MathOperation) Clone() ComparisonValue
- func (mv *MathOperation) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
- func (mv *MathOperation) Description() string
- func (mv *MathOperation) Equal(e ComparisonValue) bool
- func (mv *MathOperation) Value(context Context) (ExpressionResult, error)
- type NullValue
- func (fv NullValue) ASCIIDocString() string
- func (fv NullValue) Clone() ComparisonValue
- func (fv *NullValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
- func (fv NullValue) Description() string
- func (fv *NullValue) Equal(ofv ComparisonValue) bool
- func (fv NullValue) Value(context Context) (ExpressionResult, error)
- type Option
- type Optional
- type Provisional
- type ReferenceExpression
- func (re *ReferenceExpression) ASCIIDocString() string
- func (re *ReferenceExpression) Clone() Expression
- func (re *ReferenceExpression) Description() string
- func (re *ReferenceExpression) Equal(e Expression) bool
- func (re *ReferenceExpression) Eval(context Context) (ExpressionResult, error)
- func (re *ReferenceExpression) MarshalJSON() ([]byte, error)
- type ReferenceValue
- func (re *ReferenceValue) ASCIIDocString() string
- func (ie *ReferenceValue) Clone() ComparisonValue
- func (ie *ReferenceValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
- func (ie *ReferenceValue) Description() string
- func (re *ReferenceValue) Equal(e ComparisonValue) bool
- func (ie *ReferenceValue) Value(context Context) (ExpressionResult, error)
- type Set
- func (cs Set) ASCIIDocString() string
- func (cs Set) Clone() Conformance
- func (cs Set) CloneSet() Set
- func (cs Set) Description() string
- func (cs Set) Equal(c Conformance) bool
- func (cs Set) Eval(context Context) (ConformanceState, error)
- func (cs Set) MarshalJSON() ([]byte, error)
- func (cs Set) Type() Type
- type State
- type Stats
- type StatusCodeValue
- func (scv StatusCodeValue) ASCIIDocString() string
- func (scv StatusCodeValue) Clone() ComparisonValue
- func (scv *StatusCodeValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
- func (scv StatusCodeValue) Description() string
- func (scv *StatusCodeValue) Equal(ofv ComparisonValue) bool
- func (scv *StatusCodeValue) Value(context Context) (ExpressionResult, error)
- type Type
Constants ¶
This section is empty.
Variables ¶
var ConfidenceNames = map[Confidence]string{ ConfidenceUnknown: "Unknown", ConfidenceDefinite: "Definite", ConfidenceImpossible: "Impossible", ConfidencePossible: "Possible", }
var ExpressionTypeNames = map[ExpressionType]string{ ExpressionTypeUnknown: "unknown", ExpressionTypeMandatory: "mandatory", ExpressionTypeOptional: "optional", ExpressionTypeProvisional: "provisional", ExpressionTypeDeprecated: "deprecated", ExpressionTypeDisallowed: "disallowed", ExpressionTypeDescribed: "described", ExpressionTypeGeneric: "generic", ExpressionTypeSet: "set", }
var StateNames = map[State]string{ StateUnknown: "Unknown", StateMandatory: "Mandatory", StateOptional: "Optional", StateProvisional: "Provisional", StateDeprecated: "Deprecated", StateDisallowed: "Disallowed", }
var TypeNames = map[Type]string{ TypeUnknown: "unknown", TypeMandatory: "mandatory", TypeOptional: "optional", TypeProvisional: "provisional", TypeDeprecated: "deprecated", TypeDisallowed: "disallowed", TypeDescribed: "described", TypeGeneric: "generic", TypeSet: "set", }
Functions ¶
func IsBlank ¶
func IsBlank(conformance Conformance) bool
func IsDeprecated ¶
func IsDeprecated(conformance Conformance) bool
func IsDescribed ¶
func IsDescribed(conformance Conformance) bool
func IsDisallowed ¶
func IsDisallowed(conformance Conformance) bool
func IsGeneric ¶
func IsGeneric(conformance Conformance) bool
func IsMandatory ¶
func IsMandatory(conformance Conformance) bool
func IsProvisional ¶
func IsProvisional(conformance Conformance) bool
func IsRequired ¶
func IsRequired(conformance Conformance) bool
func IsZigbee ¶
func IsZigbee(conformance Conformance) bool
Types ¶
type BooleanValue ¶
type BooleanValue struct {
Boolean bool `json:"value"`
// contains filtered or unexported fields
}
func NewBooleanValue ¶
func NewBooleanValue(value bool, raw string) *BooleanValue
func (BooleanValue) ASCIIDocString ¶
func (bv BooleanValue) ASCIIDocString() string
func (BooleanValue) Clone ¶
func (bv BooleanValue) Clone() ComparisonValue
func (*BooleanValue) Compare ¶
func (bv *BooleanValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (result ExpressionResult, err error)
func (BooleanValue) Description ¶
func (bv BooleanValue) Description() string
func (*BooleanValue) Equal ¶
func (bv *BooleanValue) Equal(ofv ComparisonValue) bool
func (*BooleanValue) Result ¶
func (bv *BooleanValue) Result() ComparisonValue
func (*BooleanValue) Value ¶
func (bv *BooleanValue) Value(context Context) (ExpressionResult, error)
type Choice ¶
type Choice struct {
Set string `json:"set,omitempty"`
Limit ChoiceLimit `json:"limit,omitempty"`
}
func (*Choice) ASCIIDocString ¶
func (*Choice) Description ¶
type ChoiceExactLimit ¶
type ChoiceExactLimit struct {
Limit int64 `json:"limit"`
}
func (*ChoiceExactLimit) ASCIIDocString ¶
func (c *ChoiceExactLimit) ASCIIDocString() string
func (*ChoiceExactLimit) Clone ¶
func (c *ChoiceExactLimit) Clone() ChoiceLimit
func (*ChoiceExactLimit) Description ¶
func (c *ChoiceExactLimit) Description(set string) string
func (*ChoiceExactLimit) Equal ¶
func (c *ChoiceExactLimit) Equal(cl ChoiceLimit) bool
func (*ChoiceExactLimit) MarshalJSON ¶
func (c *ChoiceExactLimit) MarshalJSON() ([]byte, error)
type ChoiceLimit ¶
type ChoiceLimit interface {
Description(set string) string
ASCIIDocString() string
Equal(cl ChoiceLimit) bool
Clone() ChoiceLimit
}
type ChoiceMaxLimit ¶
type ChoiceMaxLimit struct {
Max int64 `json:"max"`
}
func (*ChoiceMaxLimit) ASCIIDocString ¶
func (c *ChoiceMaxLimit) ASCIIDocString() string
func (*ChoiceMaxLimit) Clone ¶
func (c *ChoiceMaxLimit) Clone() ChoiceLimit
func (*ChoiceMaxLimit) Description ¶
func (c *ChoiceMaxLimit) Description(set string) string
func (*ChoiceMaxLimit) Equal ¶
func (c *ChoiceMaxLimit) Equal(cl ChoiceLimit) bool
func (*ChoiceMaxLimit) MarshalJSON ¶
func (c *ChoiceMaxLimit) MarshalJSON() ([]byte, error)
type ChoiceMinLimit ¶
type ChoiceMinLimit struct {
Min int64 `json:"min"`
}
func (*ChoiceMinLimit) ASCIIDocString ¶
func (c *ChoiceMinLimit) ASCIIDocString() string
func (*ChoiceMinLimit) Clone ¶
func (c *ChoiceMinLimit) Clone() ChoiceLimit
func (*ChoiceMinLimit) Description ¶
func (c *ChoiceMinLimit) Description(set string) string
func (*ChoiceMinLimit) Equal ¶
func (c *ChoiceMinLimit) Equal(cl ChoiceLimit) bool
func (*ChoiceMinLimit) MarshalJSON ¶
func (c *ChoiceMinLimit) MarshalJSON() ([]byte, error)
type ChoiceRangeLimit ¶
func (*ChoiceRangeLimit) ASCIIDocString ¶
func (c *ChoiceRangeLimit) ASCIIDocString() string
func (*ChoiceRangeLimit) Clone ¶
func (c *ChoiceRangeLimit) Clone() ChoiceLimit
func (*ChoiceRangeLimit) Description ¶
func (c *ChoiceRangeLimit) Description(set string) string
func (*ChoiceRangeLimit) Equal ¶
func (c *ChoiceRangeLimit) Equal(cl ChoiceLimit) bool
func (*ChoiceRangeLimit) MarshalJSON ¶
func (c *ChoiceRangeLimit) MarshalJSON() ([]byte, error)
type ComparisonExpression ¶
type ComparisonExpression struct {
Op ComparisonOperator
Left ComparisonValue
Right ComparisonValue
}
func (*ComparisonExpression) ASCIIDocString ¶
func (ce *ComparisonExpression) ASCIIDocString() string
func (*ComparisonExpression) Clone ¶
func (ce *ComparisonExpression) Clone() Expression
func (*ComparisonExpression) Description ¶
func (ce *ComparisonExpression) Description() string
func (*ComparisonExpression) Equal ¶
func (ce *ComparisonExpression) Equal(e Expression) bool
func (*ComparisonExpression) Eval ¶
func (ce *ComparisonExpression) Eval(context Context) (ExpressionResult, error)
func (*ComparisonExpression) MarshalJSON ¶
func (ce *ComparisonExpression) MarshalJSON() ([]byte, error)
type ComparisonOperator ¶
type ComparisonOperator uint8
const ( ComparisonOperatorNone ComparisonOperator = iota ComparisonOperatorEqual ComparisonOperatorNotEqual ComparisonOperatorLessThan ComparisonOperatorLessThanOrEqual ComparisonOperatorGreaterThan ComparisonOperatorGreaterThanOrEqual )
func (ComparisonOperator) String ¶
func (co ComparisonOperator) String() string
type ComparisonValue ¶
type ComparisonValue interface {
ASCIIDocString() string
Description() string
Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
Value(context Context) (ExpressionResult, error)
Equal(e ComparisonValue) bool
Clone() ComparisonValue
}
type Confidence ¶
type Confidence uint8
const ( ConfidenceUnknown Confidence = iota ConfidencePossible ConfidenceDefinite ConfidenceImpossible )
The order here is important; impossible overrides definite, which overrides possible
func (Confidence) String ¶ added in v1.5.48
func (c Confidence) String() string
type Conformance ¶
type Conformance interface {
ASCIIDocString() string
Description() string
Type() Type
Eval(context Context) (ConformanceState, error)
Equal(oc Conformance) bool
Clone() Conformance
}
type ConformanceState ¶
type ConformanceState struct {
State State
Confidence Confidence
}
type Deprecated ¶
type Deprecated struct {
// contains filtered or unexported fields
}
func (*Deprecated) ASCIIDocString ¶
func (d *Deprecated) ASCIIDocString() string
func (*Deprecated) Clone ¶
func (d *Deprecated) Clone() Conformance
func (*Deprecated) Description ¶
func (d *Deprecated) Description() string
func (*Deprecated) Equal ¶
func (d *Deprecated) Equal(c Conformance) bool
func (*Deprecated) Eval ¶
func (d *Deprecated) Eval(context Context) (ConformanceState, error)
func (*Deprecated) RawText ¶
func (d *Deprecated) RawText() string
func (*Deprecated) Type ¶
func (d *Deprecated) Type() Type
type Described ¶
type Described struct {
}
func (*Described) ASCIIDocString ¶
func (*Described) Clone ¶
func (d *Described) Clone() Conformance
func (*Described) Description ¶
func (*Described) Equal ¶
func (d *Described) Equal(c Conformance) bool
type Disallowed ¶
type Disallowed struct {
// contains filtered or unexported fields
}
func (*Disallowed) ASCIIDocString ¶
func (d *Disallowed) ASCIIDocString() string
func (*Disallowed) Clone ¶
func (d *Disallowed) Clone() Conformance
func (*Disallowed) Description ¶
func (d *Disallowed) Description() string
func (*Disallowed) Equal ¶
func (d *Disallowed) Equal(c Conformance) bool
func (*Disallowed) Eval ¶
func (d *Disallowed) Eval(context Context) (ConformanceState, error)
func (*Disallowed) RawText ¶
func (d *Disallowed) RawText() string
func (*Disallowed) Type ¶
func (d *Disallowed) Type() Type
type EqualityExpression ¶
type EqualityExpression struct {
Not bool
Left Expression
Right Expression
}
func (*EqualityExpression) ASCIIDocString ¶
func (ee *EqualityExpression) ASCIIDocString() string
func (*EqualityExpression) Clone ¶
func (ee *EqualityExpression) Clone() Expression
func (*EqualityExpression) Description ¶
func (ee *EqualityExpression) Description() string
func (*EqualityExpression) Equal ¶
func (ee *EqualityExpression) Equal(e Expression) bool
func (*EqualityExpression) Eval ¶
func (ee *EqualityExpression) Eval(context Context) (result ExpressionResult, err error)
func (*EqualityExpression) MarshalJSON ¶
func (ee *EqualityExpression) MarshalJSON() ([]byte, error)
type Expression ¶
type Expression interface {
ASCIIDocString() string
Description() string
Eval(context Context) (ExpressionResult, error)
Equal(e Expression) bool
Clone() Expression
}
type ExpressionResult ¶
type ExpressionResult interface {
Confidence() Confidence
Result() any
IsTrue() bool
}
type ExpressionType ¶
type ExpressionType uint8
const ( ExpressionTypeUnknown ExpressionType = iota ExpressionTypeMandatory ExpressionTypeOptional ExpressionTypeProvisional ExpressionTypeDeprecated ExpressionTypeDisallowed ExpressionTypeDescribed ExpressionTypeGeneric ExpressionTypeSet )
func (ExpressionType) MarshalJSON ¶
func (et ExpressionType) MarshalJSON() ([]byte, error)
func (ExpressionType) String ¶
func (et ExpressionType) String() string
func (*ExpressionType) UnmarshalJSON ¶
func (et *ExpressionType) UnmarshalJSON(data []byte) error
type FloatValue ¶
type FloatValue struct {
Float decimal.Decimal `json:"value"`
// contains filtered or unexported fields
}
func NewFloatValue ¶
func NewFloatValue(d decimal.Decimal, raw string) *FloatValue
func (FloatValue) ASCIIDocString ¶
func (fv FloatValue) ASCIIDocString() string
func (FloatValue) Clone ¶
func (fv FloatValue) Clone() ComparisonValue
func (*FloatValue) Compare ¶
func (fv *FloatValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
func (FloatValue) Description ¶
func (fv FloatValue) Description() string
func (*FloatValue) Equal ¶
func (fv *FloatValue) Equal(ofv ComparisonValue) bool
func (*FloatValue) Value ¶
func (fv *FloatValue) Value(context Context) (ExpressionResult, error)
type Generic ¶
type Generic struct {
// contains filtered or unexported fields
}
func (*Generic) ASCIIDocString ¶
func (*Generic) Clone ¶
func (g *Generic) Clone() Conformance
func (*Generic) Description ¶
func (*Generic) Equal ¶
func (g *Generic) Equal(c Conformance) bool
type HasConformance ¶
type HasConformance interface {
GetConformance() Set
}
type HasExpression ¶
type HasExpression interface {
GetExpression() Expression
}
type HexValue ¶
type HexValue struct {
Hex uint64 `json:"value"`
// contains filtered or unexported fields
}
func NewHexValue ¶
func (HexValue) ASCIIDocString ¶
func (HexValue) Clone ¶
func (fv HexValue) Clone() ComparisonValue
func (*HexValue) Compare ¶
func (fv *HexValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
func (HexValue) Description ¶
func (*HexValue) Equal ¶
func (fv *HexValue) Equal(ofv ComparisonValue) bool
type IdentifierExpression ¶
type IdentifierExpression struct {
ID string `json:"id"`
Not bool `json:"not,omitempty"`
Field ComparisonValue `json:"field,omitempty"`
Entity types.Entity `json:"-"`
}
func (*IdentifierExpression) ASCIIDocString ¶
func (ie *IdentifierExpression) ASCIIDocString() string
func (*IdentifierExpression) Clone ¶
func (ie *IdentifierExpression) Clone() Expression
func (*IdentifierExpression) Description ¶
func (ie *IdentifierExpression) Description() string
func (*IdentifierExpression) Equal ¶
func (ie *IdentifierExpression) Equal(e Expression) bool
func (*IdentifierExpression) Eval ¶
func (ie *IdentifierExpression) Eval(context Context) (ExpressionResult, error)
func (*IdentifierExpression) MarshalJSON ¶
func (ie *IdentifierExpression) MarshalJSON() ([]byte, error)
type IdentifierValue ¶
type IdentifierValue struct {
ID string `json:"id"`
Field ComparisonValue `json:"field,omitempty"`
Entity types.Entity `json:"-"`
}
func (*IdentifierValue) ASCIIDocString ¶
func (ie *IdentifierValue) ASCIIDocString() string
func (*IdentifierValue) Clone ¶
func (ie *IdentifierValue) Clone() ComparisonValue
func (*IdentifierValue) Compare ¶
func (ie *IdentifierValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
func (*IdentifierValue) Description ¶
func (ie *IdentifierValue) Description() string
func (*IdentifierValue) Equal ¶
func (ie *IdentifierValue) Equal(e ComparisonValue) bool
func (*IdentifierValue) Value ¶
func (ie *IdentifierValue) Value(context Context) (ExpressionResult, error)
type IntValue ¶
type IntValue struct {
Int int64 `json:"value"`
// contains filtered or unexported fields
}
func NewIntValue ¶
func (IntValue) ASCIIDocString ¶
func (IntValue) Clone ¶
func (fv IntValue) Clone() ComparisonValue
func (*IntValue) Compare ¶
func (fv *IntValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
func (IntValue) Description ¶
func (*IntValue) Equal ¶
func (fv *IntValue) Equal(ofv ComparisonValue) bool
type LogicalExpression ¶
type LogicalExpression struct {
Operand string
Left Expression
Right []Expression
Not bool
}
func NewLogicalExpression ¶
func NewLogicalExpression(operand string, left Expression, right []any) (*LogicalExpression, error)
func (*LogicalExpression) ASCIIDocString ¶
func (le *LogicalExpression) ASCIIDocString() string
func (*LogicalExpression) Clone ¶
func (le *LogicalExpression) Clone() Expression
func (*LogicalExpression) Description ¶
func (le *LogicalExpression) Description() string
func (*LogicalExpression) Equal ¶
func (le *LogicalExpression) Equal(e Expression) bool
func (*LogicalExpression) Eval ¶
func (le *LogicalExpression) Eval(context Context) (ExpressionResult, error)
func (*LogicalExpression) MarshalJSON ¶
func (le *LogicalExpression) MarshalJSON() ([]byte, error)
type Mandatory ¶
type Mandatory struct {
Expression Expression `json:"expression,omitempty"`
}
func (*Mandatory) ASCIIDocString ¶
func (*Mandatory) Clone ¶
func (m *Mandatory) Clone() Conformance
func (*Mandatory) Description ¶
func (*Mandatory) Equal ¶
func (m *Mandatory) Equal(c Conformance) bool
type MathOperand ¶
type MathOperand uint8
const ( MathOperandNone MathOperand = iota MathOperandAdd MathOperandSubtract MathOperandMultiply MathOperandDivide )
func (MathOperand) String ¶
func (mo MathOperand) String() string
type MathOperation ¶
type MathOperation struct {
Operand MathOperand
Left ComparisonValue
Right ComparisonValue
}
func (*MathOperation) ASCIIDocString ¶
func (mv *MathOperation) ASCIIDocString() string
func (*MathOperation) Clone ¶
func (mv *MathOperation) Clone() ComparisonValue
func (*MathOperation) Compare ¶
func (mv *MathOperation) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
func (*MathOperation) Description ¶
func (mv *MathOperation) Description() string
func (*MathOperation) Equal ¶
func (mv *MathOperation) Equal(e ComparisonValue) bool
func (*MathOperation) Value ¶
func (mv *MathOperation) Value(context Context) (ExpressionResult, error)
type NullValue ¶
type NullValue struct {
// contains filtered or unexported fields
}
func NewNullValue ¶
func (NullValue) ASCIIDocString ¶
func (NullValue) Clone ¶
func (fv NullValue) Clone() ComparisonValue
func (*NullValue) Compare ¶
func (fv *NullValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
func (NullValue) Description ¶
func (*NullValue) Equal ¶
func (fv *NullValue) Equal(ofv ComparisonValue) bool
type Option ¶
type Option func(*parser) Option
Option is a function that can set an option on the parser. It returns the previous setting as an Option.
func AllowInvalidUTF8 ¶
AllowInvalidUTF8 creates an Option to allow invalid UTF-8 bytes. Every invalid UTF-8 byte is treated as a utf8.RuneError (U+FFFD) by character class matchers and is matched by the any matcher. The returned matched value, c.text and c.offset are NOT affected.
The default is false.
func Entrypoint ¶
Entrypoint creates an Option to set the rule name to use as entrypoint. The rule name must have been specified in the -alternate-entrypoints if generating the parser with the -optimize-grammar flag, otherwise it may have been optimized out. Passing an empty string sets the entrypoint to the first rule in the grammar.
The default is to start parsing at the first rule in the grammar.
func GlobalStore ¶
GlobalStore creates an Option to set a key to a certain value in the globalStore.
func MaxExpressions ¶
MaxExpressions creates an Option to stop parsing after the provided number of expressions have been parsed, if the value is 0 then the parser will parse for as many steps as needed (possibly an infinite number).
The default for maxExprCnt is 0.
type Optional ¶
type Optional struct {
Expression Expression `json:"expression,omitempty"`
Choice *Choice `json:"choice,omitempty"`
}
func (*Optional) ASCIIDocString ¶
func (*Optional) Clone ¶
func (o *Optional) Clone() Conformance
func (*Optional) Description ¶
func (*Optional) Equal ¶
func (o *Optional) Equal(c Conformance) bool
type Provisional ¶
type Provisional struct {
}
func (*Provisional) ASCIIDocString ¶
func (p *Provisional) ASCIIDocString() string
func (*Provisional) Clone ¶
func (p *Provisional) Clone() Conformance
func (*Provisional) Description ¶
func (p *Provisional) Description() string
func (*Provisional) Equal ¶
func (p *Provisional) Equal(c Conformance) bool
func (*Provisional) Eval ¶
func (p *Provisional) Eval(context Context) (ConformanceState, error)
func (*Provisional) Type ¶
func (p *Provisional) Type() Type
type ReferenceExpression ¶
type ReferenceExpression struct {
Reference string `json:"ref"`
Field ComparisonValue `json:"field,omitempty"`
Label string `json:"label,omitempty"`
Not bool `json:"not,omitempty"`
Entity types.Entity `json:"-"`
}
func (*ReferenceExpression) ASCIIDocString ¶
func (re *ReferenceExpression) ASCIIDocString() string
func (*ReferenceExpression) Clone ¶
func (re *ReferenceExpression) Clone() Expression
func (*ReferenceExpression) Description ¶
func (re *ReferenceExpression) Description() string
func (*ReferenceExpression) Equal ¶
func (re *ReferenceExpression) Equal(e Expression) bool
func (*ReferenceExpression) Eval ¶
func (re *ReferenceExpression) Eval(context Context) (ExpressionResult, error)
func (*ReferenceExpression) MarshalJSON ¶
func (re *ReferenceExpression) MarshalJSON() ([]byte, error)
type ReferenceValue ¶
type ReferenceValue struct {
Reference string `json:"ref"`
Field ComparisonValue `json:"field,omitempty"`
Label string `json:"label,omitempty"`
Entity types.Entity `json:"-"`
}
func (*ReferenceValue) ASCIIDocString ¶
func (re *ReferenceValue) ASCIIDocString() string
func (*ReferenceValue) Clone ¶
func (ie *ReferenceValue) Clone() ComparisonValue
func (*ReferenceValue) Compare ¶
func (ie *ReferenceValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
func (*ReferenceValue) Description ¶
func (ie *ReferenceValue) Description() string
func (*ReferenceValue) Equal ¶
func (re *ReferenceValue) Equal(e ComparisonValue) bool
func (*ReferenceValue) Value ¶
func (ie *ReferenceValue) Value(context Context) (ExpressionResult, error)
type Set ¶
type Set []Conformance
func ParseConformance ¶
func TryParseConformance ¶
func (Set) ASCIIDocString ¶
func (Set) Clone ¶
func (cs Set) Clone() Conformance
func (Set) Description ¶
func (Set) Equal ¶
func (cs Set) Equal(c Conformance) bool
func (Set) MarshalJSON ¶
type Stats ¶
type Stats struct {
// ExprCnt counts the number of expressions processed during parsing
// This value is compared to the maximum number of expressions allowed
// (set by the MaxExpressions option).
ExprCnt uint64
// ChoiceAltCnt is used to count for each ordered choice expression,
// which alternative is used how may times.
// These numbers allow to optimize the order of the ordered choice expression
// to increase the performance of the parser
//
// The outer key of ChoiceAltCnt is composed of the name of the rule as well
// as the line and the column of the ordered choice.
// The inner key of ChoiceAltCnt is the number (one-based) of the matching alternative.
// For each alternative the number of matches are counted. If an ordered choice does not
// match, a special counter is incremented. The name of this counter is set with
// the parser option Statistics.
// For an alternative to be included in ChoiceAltCnt, it has to match at least once.
ChoiceAltCnt map[string]map[string]int
}
Stats stores some statistics, gathered during parsing
type StatusCodeValue ¶
type StatusCodeValue struct {
StatusCode types.StatusCode `json:"statusCode"`
// contains filtered or unexported fields
}
func NewStatusCodeValue ¶
func NewStatusCodeValue(statusCode types.StatusCode, raw string) *StatusCodeValue
func (StatusCodeValue) ASCIIDocString ¶
func (scv StatusCodeValue) ASCIIDocString() string
func (StatusCodeValue) Clone ¶
func (scv StatusCodeValue) Clone() ComparisonValue
func (*StatusCodeValue) Compare ¶
func (scv *StatusCodeValue) Compare(context Context, other ComparisonValue, op ComparisonOperator) (ExpressionResult, error)
func (StatusCodeValue) Description ¶
func (scv StatusCodeValue) Description() string
func (*StatusCodeValue) Equal ¶
func (scv *StatusCodeValue) Equal(ofv ComparisonValue) bool
func (*StatusCodeValue) Value ¶
func (scv *StatusCodeValue) Value(context Context) (ExpressionResult, error)