Documentation ¶
Index ¶
- func Pretty(pretty bool) func(*PRD) error
- func Size(size int) func(*PRD) error
- func SyntaxErrorf(c *ParseContext, node *node32, f string, args ...any) error
- type Definition
- type Expression
- type OptionList
- type PRD
- func (t *PRD) AST() *node32
- func (t *PRD) Add(rule pegRule, begin, end, index uint32)
- func (p *PRD) Init(options ...func(*PRD) error) error
- func (p *PRD) Parse(rule ...int) error
- func (t *PRD) PrettyPrintSyntaxTree(buffer string)
- func (t *PRD) Print()
- func (p *PRD) PrintSyntaxTree()
- func (p *PRD) Reset()
- func (p *PRD) SprintSyntaxTree() string
- func (t *PRD) Tokens() []token32
- func (t *PRD) Trim(length uint32)
- func (p *PRD) WriteSyntaxTree(w io.Writer)
- type ParseContext
- type SyntaxError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SyntaxErrorf ¶
func SyntaxErrorf(c *ParseContext, node *node32, f string, args ...any) error
Types ¶
type Definition ¶
type Definition struct { DefType string ID string Options OptionList Body []any }
type Expression ¶
type OptionList ¶
type PRD ¶
func (*PRD) PrettyPrintSyntaxTree ¶
func (t *PRD) PrettyPrintSyntaxTree(buffer string)
func (*PRD) PrintSyntaxTree ¶
func (p *PRD) PrintSyntaxTree()
func (*PRD) SprintSyntaxTree ¶
func (*PRD) WriteSyntaxTree ¶
type ParseContext ¶
type ParseContext struct {
// contains filtered or unexported fields
}
func MakeParseContext ¶
func MakeParseContext(script string) (*ParseContext, error)
func (*ParseContext) PrintTree ¶
func (c *ParseContext) PrintTree()
func (*ParseContext) Run ¶
func (c *ParseContext) Run() ([]*Definition, error)
type SyntaxError ¶
type SyntaxError struct {
// contains filtered or unexported fields
}
func (*SyntaxError) Cause ¶
func (s *SyntaxError) Cause() error
func (*SyntaxError) Error ¶
func (s *SyntaxError) Error() string
func (*SyntaxError) Unwrap ¶
func (s *SyntaxError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.