Documentation ¶
Index ¶
- Variables
- type Node
- type Tree
- func (t *Tree) AddAction(text string)
- func (t *Tree) AddAlternate()
- func (t *Tree) AddCharacter(text string)
- func (t *Tree) AddDot()
- func (t *Tree) AddDoubleCharacter(text string)
- func (t *Tree) AddDoubleRange()
- func (t *Tree) AddExpression()
- func (t *Tree) AddHexaCharacter(text string)
- func (t *Tree) AddImport(text string)
- func (t *Tree) AddName(text string)
- func (t *Tree) AddNil()
- func (t *Tree) AddOctalCharacter(text string)
- func (t *Tree) AddPackage(text string)
- func (t *Tree) AddPeekFor()
- func (t *Tree) AddPeekNot()
- func (t *Tree) AddPeg(text string)
- func (t *Tree) AddPlus()
- func (t *Tree) AddPredicate(text string)
- func (t *Tree) AddPush()
- func (t *Tree) AddQuery()
- func (t *Tree) AddRange()
- func (t *Tree) AddRule(name string)
- func (t *Tree) AddSequence()
- func (t *Tree) AddStar()
- func (t *Tree) AddState(text string)
- func (t *Tree) AddStateChange(text string)
- func (t *Tree) Compile(file string, args []string, out io.Writer) (err error)
- func (n *Tree) Copy() *node
- func (n *Tree) Escaped() string
- func (n *Tree) Front() *node
- func (n *Tree) GetId() int
- func (n *Tree) Init()
- func (n *Tree) Len() (c int)
- func (n *Tree) Next() *node
- func (n *Tree) ParentDetect() bool
- func (n *Tree) ParentMultipleKey() bool
- func (n *Tree) PopFront() *node
- func (n *Tree) PushBack(value *node)
- func (n *Tree) PushFront(value *node)
- func (n *Tree) SetId(id int)
- func (n *Tree) SetParentDetect(detect bool)
- func (n *Tree) SetParentMultipleKey(multipleKey bool)
- func (n *Tree) SetString(s string)
- func (n *Tree) SetType(t Type)
- func (n *Tree) Slice() []*node
- func (n *Tree) String() string
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeMap = [...]string{
"TypeUnknown",
"TypeRule",
"TypeName",
"TypeDot",
"TypeCharacter",
"TypeRange",
"TypeString",
"TypePredicate",
"TypeStateChange",
"TypeCommit",
"TypeAction",
"TypePackage",
"TypeImport",
"TypeState",
"TypeAlternate",
"TypeUnorderedAlternate",
"TypeSequence",
"TypePeekFor",
"TypePeekNot",
"TypeQuery",
"TypeStar",
"TypePlus",
"TypePeg",
"TypePush",
"TypeImplicitPush",
"TypeNil",
"TypeLast"}
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node interface { fmt.Stringer Escaped() string SetString(s string) GetType() Type SetType(t Type) GetId() int SetId(id int) Init() Front() *node Next() *node PushFront(value *node) PopFront() *node PushBack(value *node) Len() int Copy() *node Slice() []*node ParentDetect() bool SetParentDetect(detect bool) ParentMultipleKey() bool SetParentMultipleKey(detect bool) // contains filtered or unexported methods }
type Tree ¶
type Tree struct { Rules map[string]Node Ast bool Strict bool Generator string RuleNames []Node PackageName string Imports []string EndSymbol rune PegRuleType string StructName string StructVariables string RulesCount int Bits int HasActions bool Actions []Node HasPush bool HasCommit bool HasDot bool HasCharacter bool HasString bool HasRange bool // contains filtered or unexported fields }
A tree data structure into which a PEG can be parsed.
func (*Tree) AddAlternate ¶
func (t *Tree) AddAlternate()
func (*Tree) AddCharacter ¶
func (*Tree) AddDoubleCharacter ¶
func (*Tree) AddDoubleRange ¶
func (t *Tree) AddDoubleRange()
func (*Tree) AddExpression ¶
func (t *Tree) AddExpression()
func (*Tree) AddHexaCharacter ¶
func (*Tree) AddOctalCharacter ¶
func (*Tree) AddPackage ¶
func (*Tree) AddPeekFor ¶
func (t *Tree) AddPeekFor()
func (*Tree) AddPeekNot ¶
func (t *Tree) AddPeekNot()
func (*Tree) AddPredicate ¶
func (*Tree) AddSequence ¶
func (t *Tree) AddSequence()
func (*Tree) AddStateChange ¶
func (*Tree) ParentDetect ¶ added in v1.0.6
func (n *Tree) ParentDetect() bool
func (*Tree) ParentMultipleKey ¶ added in v1.0.6
func (n *Tree) ParentMultipleKey() bool
func (*Tree) SetParentDetect ¶ added in v1.0.6
func (n *Tree) SetParentDetect(detect bool)
func (*Tree) SetParentMultipleKey ¶ added in v1.0.6
func (n *Tree) SetParentMultipleKey(multipleKey bool)
type Type ¶
type Type uint8
const ( TypeUnknown Type = iota TypeRule TypeName TypeDot TypeCharacter TypeRange TypeString TypePredicate TypeStateChange TypeCommit TypeAction TypePackage TypeImport TypeState TypeAlternate TypeUnorderedAlternate TypeSequence TypePeekFor TypePeekNot TypeQuery TypeStar TypePlus TypePeg TypePush TypeImplicitPush TypeNil TypeLast )
Click to show internal directories.
Click to hide internal directories.