Documentation
¶
Index ¶
Constants ¶
const ( SegmentTypeIdentifier = iota SegmentTypeOptional )
Variables ¶
var IdentifierRegexp = regexp.MustCompile("[a-z]+")
A regexp which describes an identifier
Functions ¶
This section is empty.
Types ¶
type Definition ¶
A Definition is a named regexp along with comments to clarify the regexp's purpose It corresponds to the <commdef> BNF definition
type Filename ¶
type Filename struct {
Segments []Segment
Extension Identifier
}
Filename represents the flename defintion, made up of a series of segments and a file extension
type Identifier ¶
type Identifier string
An Identifier is a lowercase alphabetical string. It corresponds to the <id> BNF definition
type Segment ¶
type Segment struct {
Kind SegmentType
Value *Identifier
Subsegments []Segment
}
A Segment is a section of the main filename It corresponds to the <segment> BNF definition
type SegmentType ¶
type SegmentType uint
type Synta ¶
type Synta struct {
Definitions map[Identifier]Definition
Filename Filename
}
Synta represents the contents of a Synta file It corresponds to the <language> BNF definition The last segment of the Filename is the extension
func ParseSynta ¶
ParseSynta attempts to parse a file's contents into a Synta internal representation. If an error is encountered the parsing is aborted and the error returned