Documentation
¶
Index ¶
- type ActionExpr
- type Adapter
- type AndExpr
- type Associativity
- type ChoiceExpr
- type Expr
- type Grammar
- type InfixInfo
- type NamedExpr
- type NodeExpr
- type NotExpr
- type OptionalExpr
- type Parser
- func (p *Parser) Errorf(format string, args ...interface{}) error
- func (p *Parser) Expect(tokenType string) (stringParsing.ParsedNode, error)
- func (p *Parser) NextToken() (stringParsing.ParsedNode, error)
- func (p *Parser) Parse(code string, opts ...*parsing.ParseOption) ([]stringParsing.ParsedNode, error)
- func (p *Parser) Peek() (stringParsing.ParsedNode, error)
- func (p *Parser) SkipIgnored()
- func (p *Parser) String() string
- type PeekExpr
- type PrattExpr
- type RepeatExpr
- type Rule
- type SeparatedRepeatExpr
- type SequenceExpr
- type TokenExpr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionExpr ¶ added in v1.3.2
type ActionExpr struct {
Expr Expr
Action func([]stringParsing.ParsedNode) (stringParsing.ParsedNode, error)
}
func (ActionExpr) Parse ¶ added in v1.3.2
func (a ActionExpr) Parse(p *Parser) ([]stringParsing.ParsedNode, error)
type Adapter ¶ added in v1.3.5
type Adapter struct {
Parser *Parser
}
func (*Adapter) ParseFlat ¶ added in v1.3.5
func (a *Adapter) ParseFlat(code string, o ...*parsing.ParseOption) ([]stringParsing.ParsedNode, error)
type AndExpr ¶ added in v1.3.5
type AndExpr struct {
Expr Expr
}
func (AndExpr) Parse ¶ added in v1.3.5
func (a AndExpr) Parse(p *Parser) ([]stringParsing.ParsedNode, error)
type Associativity ¶ added in v1.3.5
type Associativity int
const ( LeftAssoc Associativity = iota RightAssoc NonAssoc )
type ChoiceExpr ¶
type ChoiceExpr struct {
Alternatives []Expr
}
func (ChoiceExpr) Parse ¶
func (c ChoiceExpr) Parse(p *Parser) ([]stringParsing.ParsedNode, error)
type Expr ¶
type Expr interface {
Parse(p *Parser) ([]stringParsing.ParsedNode, error)
}
type InfixInfo ¶ added in v1.3.5
type InfixInfo struct {
Precedence int
Assoc Associativity
}
type NamedExpr ¶
type NamedExpr struct {
RuleName string
}
func (NamedExpr) Parse ¶
func (n NamedExpr) Parse(p *Parser) ([]stringParsing.ParsedNode, error)
type NodeExpr ¶
func (NodeExpr) Parse ¶
func (n NodeExpr) Parse(p *Parser) ([]stringParsing.ParsedNode, error)
type NotExpr ¶ added in v1.3.5
type NotExpr struct {
Expr Expr
}
func (NotExpr) Parse ¶ added in v1.3.5
func (n NotExpr) Parse(p *Parser) ([]stringParsing.ParsedNode, error)
type OptionalExpr ¶
type OptionalExpr struct {
Expr Expr
}
func (OptionalExpr) Parse ¶
func (o OptionalExpr) Parse(p *Parser) ([]stringParsing.ParsedNode, error)
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) Expect ¶
func (p *Parser) Expect(tokenType string) (stringParsing.ParsedNode, error)
func (*Parser) NextToken ¶ added in v1.3.2
func (p *Parser) NextToken() (stringParsing.ParsedNode, error)
func (*Parser) Parse ¶
func (p *Parser) Parse(code string, opts ...*parsing.ParseOption) ([]stringParsing.ParsedNode, error)
func (*Parser) Peek ¶
func (p *Parser) Peek() (stringParsing.ParsedNode, error)
func (*Parser) SkipIgnored ¶ added in v1.3.2
func (p *Parser) SkipIgnored()
type PeekExpr ¶ added in v1.3.5
type PeekExpr struct {
TokenType string
}
func (PeekExpr) Parse ¶ added in v1.3.5
func (p PeekExpr) Parse(prs *Parser) ([]stringParsing.ParsedNode, error)
type PrattExpr ¶ added in v1.3.5
func (*PrattExpr) Parse ¶ added in v1.3.5
func (p *PrattExpr) Parse(prs *Parser) ([]stringParsing.ParsedNode, error)
type RepeatExpr ¶
func (RepeatExpr) Parse ¶
func (r RepeatExpr) Parse(p *Parser) ([]stringParsing.ParsedNode, error)
type SeparatedRepeatExpr ¶ added in v1.3.5
func (SeparatedRepeatExpr) Parse ¶ added in v1.3.5
func (s SeparatedRepeatExpr) Parse(p *Parser) ([]stringParsing.ParsedNode, error)
type SequenceExpr ¶
type SequenceExpr struct {
Exprs []Expr
}
func (SequenceExpr) Parse ¶
func (s SequenceExpr) Parse(p *Parser) ([]stringParsing.ParsedNode, error)
type TokenExpr ¶
type TokenExpr struct {
TokenType string
}
func (TokenExpr) Parse ¶
func (t TokenExpr) Parse(p *Parser) ([]stringParsing.ParsedNode, error)
Click to show internal directories.
Click to hide internal directories.