2017-07-07 11:41:37 +02:00
|
|
|
package parser
|
2017-07-05 15:51:21 +02:00
|
|
|
|
2017-07-05 16:37:46 +02:00
|
|
|
// Grammar supplies the parser with syntax information about blocks.
|
2017-07-05 15:51:21 +02:00
|
|
|
type Grammar interface {
|
|
|
|
BlockSyntax(string) (BlockSyntax, bool)
|
|
|
|
}
|
|
|
|
|
2017-07-05 16:37:46 +02:00
|
|
|
// BlockSyntax supplies the parser with syntax information about blocks.
|
2017-07-05 15:51:21 +02:00
|
|
|
type BlockSyntax interface {
|
|
|
|
IsBlock() bool
|
|
|
|
CanHaveParent(BlockSyntax) bool
|
|
|
|
IsBlockEnd() bool
|
|
|
|
IsBlockStart() bool
|
2017-07-12 14:27:15 +02:00
|
|
|
IsClause() bool
|
2017-07-05 15:51:21 +02:00
|
|
|
ParentTags() []string
|
|
|
|
RequiresParent() bool
|
|
|
|
TagName() string
|
|
|
|
}
|
|
|
|
|
2017-07-05 16:37:46 +02:00
|
|
|
// Grammar returns a configuration's grammar.
|
2017-07-07 11:41:37 +02:00
|
|
|
// func (c *Config) Grammar() Grammar { return c }
|