Documentation
¶
Overview ¶
Copyright (c) 2021 Ke Yuchang(aceking.ke@gmail.com). All rights reserved. Use of this source code is governed by MIT license that can be found in the LICENSE file.
Copyright (c) 2021 Ke Yuchang(aceking.ke@gmail.com). All rights reserved. Use of this source code is governed by MIT license that can be found in the LICENSE file.
Copyright (c) 2021 Ke Yuchang(aceking.ke@gmail.com). All rights reserved. Use of this source code is governed by MIT license that can be found in the LICENSE file.
Copyright (c) 2021 Ke Yuchang(aceking.ke@gmail.com). All rights reserved. Use of this source code is governed by MIT license that can be found in the LICENSE file.
Index ¶
- Constants
- func ActionQuoteState(l *lexer) stateFn
- func ActionState(l *lexer) stateFn
- func CodeQuoteBegin(l *lexer) stateFn
- func CommentState(l *lexer) stateFn
- func DirectiveOtherState(l *lexer) stateFn
- func DirectiveState(l *lexer) stateFn
- func DirectiveUnionState(l *lexer) stateFn
- func IdentifyState(l *lexer) stateFn
- func Lex(source string) *lexer
- func RemoveTempName(in string) string
- func TestPrefix(in string) bool
- type Base
- type DeclareNode
- type IDType
- type Idendity
- type Kind
- type Location
- type NilNode
- type Node
- type PrecAssocType
- type PrecDef
- type RightSymActType
- type RightSymOrAction
- type RootNode
- type RootVistor
- type RuleDef
- type RuleDefNode
- type RuleVistor
- type Token
- type TokenDef
- type TypeDef
- type Vistor
- type Walker
Constants ¶
View Source
const ( TERMID = iota + 1 NONTERMID )
View Source
const ( LeftAssocType = iota + 1 RightAssocype NonAssocType )
View Source
const ( RightSyType = iota + 1 RightActionType )
Variables ¶
This section is empty.
Functions ¶
func ActionState ¶
func ActionState(l *lexer) stateFn
func CodeQuoteBegin ¶
func CodeQuoteBegin(l *lexer) stateFn
func CommentState ¶
func CommentState(l *lexer) stateFn
func DirectiveOtherState ¶
func DirectiveOtherState(l *lexer) stateFn
func DirectiveState ¶
func DirectiveState(l *lexer) stateFn
func IdentifyState ¶
func IdentifyState(l *lexer) stateFn
func RemoveTempName ¶
func TestPrefix ¶
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func (*Base) SetLocation ¶
type DeclareNode ¶
type Kind ¶
type Kind string
const ( Identifier Kind = "Identifier" Number Kind = "Number" Section Kind = "Section" CodeQuote Kind = "CodeQuote" ActionQuote Kind = "ActionQuote" EOF Kind = "EOF" TypeDirective Kind = "TypeDirective" TokenDirective Kind = "TokenDirective" UnionDirective Kind = "UnionDirective" LeftAssoc Kind = "LeftAssoc" RightAssoc Kind = "RightAssoc" NoneAssoc Kind = "NoneAssoc" PrecDirective Kind = "PrecDirective" Precedence Kind = "Precedence" StartDirective Kind = "StartDirective" ActionSelf Kind = "ActionSelf" ActionN Kind = "ActionN" ActionAccept Kind = "ActionAccept" ActionEnd Kind = "ActionEnd" RuleOR Kind = "RuleOR" // | RuleDefine Kind = "RuleDefine" // : RuleEnd Kind = "RuleEnd" // ; LeftAngleBracket Kind = "LeftAngleBracket" // Aangle brackets < RightAngleBracket Kind = "RightAngleBracket" // RightAngleBracket > Charater Kind = "Charater" StringKind Kind = "StringKind" )
type Location ¶
type PrecAssocType ¶
type PrecAssocType int
type RightSymActType ¶
type RightSymActType int
type RightSymOrAction ¶
type RightSymOrAction struct { ElemType RightSymActType Element string }
type RootVistor ¶
type RootVistor struct { *RuleVistor CodeCpy string *lalr.LALR1 }
func (*RootVistor) GetCode ¶
func (v *RootVistor) GetCode() string
func (*RootVistor) GetCodeCopy ¶
func (v *RootVistor) GetCodeCopy() string
func (*RootVistor) GetIdsymtabl ¶
func (v *RootVistor) GetIdsymtabl() map[string]*Idendity
func (*RootVistor) GetRules ¶
func (v *RootVistor) GetRules(index int) *oneRule
func (*RootVistor) GetUion ¶
func (v *RootVistor) GetUion() string
func (*RootVistor) Process ¶
func (v *RootVistor) Process(node *Node)
type RuleDef ¶
type RuleDef struct { LineNo int LeftPart string RightPart []RightSymOrAction PrecSym string // which prec symbol }
Rules
type RuleVistor ¶
type RuleVistor struct {
// contains filtered or unexported fields
}
func (*RuleVistor) Process ¶
func (v *RuleVistor) Process(node *Node)
type Walker ¶
type Walker struct {
VistorNode Vistor
}
func ParseAndBuild ¶
func (*Walker) BuildLALR1 ¶
Click to show internal directories.
Click to hide internal directories.