parser

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenEOF = TokenType(iota)
	TokenIdent
	TokenInt
	TokenReservedKeyword
	TokenString
	TokenOperator
	TokenUnknown
)

Variables

This section is empty.

Functions

func IsReservedKeyword added in v1.5.1

func IsReservedKeyword(s string) bool

IsReservedKeyword reports whether s is a reserved Cedar keyword.

func MarshalExpr added in v1.6.0

func MarshalExpr(n ast.IsNode) string

MarshalExpr marshals an AST expression node to its Cedar text representation.

func ParsePattern

func ParsePattern(v string) (types.Pattern, error)

ParsePattern will parse an unquoted rust-style string with \*'s in it.

Types

type Decoder added in v1.2.7

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

func NewDecoder added in v1.2.7

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Decode added in v1.2.7

func (d *Decoder) Decode(p *Policy) error

type Encoder added in v1.2.7

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

func NewEncoder added in v1.2.7

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Encode added in v1.2.7

func (e *Encoder) Encode(p *Policy) error

type IsNode

type IsNode interface {
	// contains filtered or unexported methods
}

type NodeTypeAccess

type NodeTypeAccess struct {
	ast.NodeTypeAccess
	// contains filtered or unexported fields
}

type NodeTypeAdd

type NodeTypeAdd struct {
	ast.NodeTypeAdd
	// contains filtered or unexported fields
}

type NodeTypeAnd

type NodeTypeAnd struct{ ast.NodeTypeAnd }

type NodeTypeContains

type NodeTypeContains struct {
	ast.NodeTypeContains
	// contains filtered or unexported fields
}

type NodeTypeContainsAll

type NodeTypeContainsAll struct {
	ast.NodeTypeContainsAll
	// contains filtered or unexported fields
}

type NodeTypeContainsAny

type NodeTypeContainsAny struct {
	ast.NodeTypeContainsAny
	// contains filtered or unexported fields
}

type NodeTypeEquals

type NodeTypeEquals struct {
	ast.NodeTypeEquals
	// contains filtered or unexported fields
}

type NodeTypeExtensionCall

type NodeTypeExtensionCall struct {
	ast.NodeTypeExtensionCall
	// contains filtered or unexported fields
}

type NodeTypeGetTag added in v1.1.0

type NodeTypeGetTag struct {
	ast.NodeTypeGetTag
	// contains filtered or unexported fields
}

type NodeTypeGreaterThan

type NodeTypeGreaterThan struct {
	ast.NodeTypeGreaterThan
	// contains filtered or unexported fields
}

type NodeTypeGreaterThanOrEqual

type NodeTypeGreaterThanOrEqual struct {
	ast.NodeTypeGreaterThanOrEqual
	// contains filtered or unexported fields
}

type NodeTypeHas

type NodeTypeHas struct {
	ast.NodeTypeHas
	// contains filtered or unexported fields
}

type NodeTypeHasTag added in v1.1.0

type NodeTypeHasTag struct {
	ast.NodeTypeHasTag
	// contains filtered or unexported fields
}

type NodeTypeIf

type NodeTypeIf struct{ ast.NodeTypeIfThenElse }

type NodeTypeIn

type NodeTypeIn struct {
	ast.NodeTypeIn
	// contains filtered or unexported fields
}

type NodeTypeIs

type NodeTypeIs struct {
	ast.NodeTypeIs
	// contains filtered or unexported fields
}

type NodeTypeIsEmpty added in v1.2.0

type NodeTypeIsEmpty struct {
	ast.NodeTypeIsEmpty
	// contains filtered or unexported fields
}

type NodeTypeIsIn

type NodeTypeIsIn struct {
	ast.NodeTypeIsIn
	// contains filtered or unexported fields
}

type NodeTypeLessThan

type NodeTypeLessThan struct {
	ast.NodeTypeLessThan
	// contains filtered or unexported fields
}

type NodeTypeLessThanOrEqual

type NodeTypeLessThanOrEqual struct {
	ast.NodeTypeLessThanOrEqual
	// contains filtered or unexported fields
}

type NodeTypeLike

type NodeTypeLike struct {
	ast.NodeTypeLike
	// contains filtered or unexported fields
}

type NodeTypeMult

type NodeTypeMult struct{ ast.NodeTypeMult }

type NodeTypeNegate

type NodeTypeNegate struct {
	ast.NodeTypeNegate
	UnaryNode
}

type NodeTypeNot

type NodeTypeNot struct {
	ast.NodeTypeNot
	UnaryNode
}

type NodeTypeNotEquals

type NodeTypeNotEquals struct {
	ast.NodeTypeNotEquals
	// contains filtered or unexported fields
}

type NodeTypeOr

type NodeTypeOr struct{ ast.NodeTypeOr }

type NodeTypeRecord

type NodeTypeRecord struct {
	ast.NodeTypeRecord
	// contains filtered or unexported fields
}

type NodeTypeSet

type NodeTypeSet struct {
	ast.NodeTypeSet
	// contains filtered or unexported fields
}

type NodeTypeSub

type NodeTypeSub struct {
	ast.NodeTypeSub
	// contains filtered or unexported fields
}

type NodeTypeVariable

type NodeTypeVariable struct {
	ast.NodeTypeVariable
	// contains filtered or unexported fields
}

type NodeValue

type NodeValue struct {
	ast.NodeValue
	// contains filtered or unexported fields
}

type Policy

type Policy ast.Policy

func (*Policy) MarshalCedar

func (p *Policy) MarshalCedar(buf *bytes.Buffer)

func (*Policy) UnmarshalCedar

func (p *Policy) UnmarshalCedar(b []byte) error

type PolicySlice

type PolicySlice []*Policy

func (*PolicySlice) UnmarshalCedar

func (p *PolicySlice) UnmarshalCedar(b []byte) error

type Position

type Position ast.Position

func (Position) String

func (pos Position) String() string

type Token

type Token struct {
	Type TokenType
	Pos  Position
	Text string
}

func Tokenize

func Tokenize(src []byte) ([]Token, error)

func TokenizeReader added in v1.2.7

func TokenizeReader(r io.Reader) ([]Token, error)

type TokenType

type TokenType int

type UnaryNode

type UnaryNode struct{ ast.UnaryNode }

Jump to

Keyboard shortcuts

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