Documentation ¶
Index ¶
- Variables
- func GetBnf() string
- func LexFile(path string) ([]lexer.Token, error)
- func Lexer() *lexer.StatefulDefinition
- func Parser() *participle.Parser
- type Args
- type BlockImport
- type Bool
- type Comment
- type Const
- type File
- type Ident
- type IdentWithArgs
- type IdentWithType
- type Import
- type Meta
- type Rational
- type SingleImport
- type Statement
- type Statements
- type Struct
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var CommentRegexp = regexp.MustCompile(`(?m)^/([\w.-]+:[\w.-]+)(?:\s+([\w.-]+:[\w.-]+))*/(?:\s*\n)?([\s\S]*)$`)
Functions ¶
func Lexer ¶
func Lexer() *lexer.StatefulDefinition
Types ¶
type Args ¶
type Args struct { Statements Statements `parser:"'(' EOS* (@@ ((EOS|',')+ @@)*)? EOS* ')'" json:"Statements,omitempty"` Meta `json:"-"` }
type BlockImport ¶
type BlockImport struct { Imports []Import `parser:"'import' '(' EOS* (@@ EOS)* @@? EOS* ')'" json:"Imports,omitempty"` Meta `json:"-"` }
func (BlockImport) AstNode ¶
func (c BlockImport) AstNode() []ast.Node
type Comment ¶
type Const ¶
type File ¶
type File struct { Name string `parser:"" json:"-"` Statements Statements `parser:"EOS* (@@ EOS+)*" json:"Statements,omitempty"` }
type IdentWithArgs ¶
type IdentWithType ¶
type Import ¶
type SingleImport ¶
type SingleImport struct { Import Import `parser:"'import' @@ " json:"Import,omitempty"` Meta `json:"-"` }
func (SingleImport) AstNode ¶
func (c SingleImport) AstNode() *ast.Node
type Statement ¶
type Statement struct { Comment *Comment `parser:"( @(LineComment | BlockComment+)" json:"Comment,omitempty"` SingleImport *SingleImport `parser:"| @@" json:"SingleImport,omitempty"` BlockImport *BlockImport `parser:"| @@" json:"BlockImport,omitempty"` Type *Type `parser:") | (@@ " json:"Type,omitempty"` Default *Type `parser:"('=' @@)? )" json:"Default,omitempty"` Meta `json:"-"` }
type Statements ¶
type Statements []Statement
type Struct ¶
type Struct struct { Statements Statements `parser:"'{' EOS* (@@ ((EOS|',')+ @@)*)? EOS* '}'" json:"Statements,omitempty"` Meta `json:"-"` }
type Type ¶
type Type struct { Args *Args `parser:"@@?" json:"Args,omitempty"` IdentWithType *IdentWithType `parser:"(@@" json:"IdentWithType,omitempty"` IdentWithArgs *IdentWithArgs `parser:"| @@" json:"IdentWithArgs,omitempty"` Ident *Ident `parser:"| @@" json:"Ident,omitempty"` Const *Const `parser:"| @@" json:"Const,omitempty"` Struct *Struct `parser:"| @@)" json:"Struct,omitempty"` Meta `json:"-"` }
Click to show internal directories.
Click to hide internal directories.