Documentation
¶
Index ¶
- Constants
- func DumpInfo(info InfoType) string
- func IsInArray(n int, arr []int) bool
- type InfoType
- type NFA_PoolType
- func (nn *NFA_PoolType) AddEdge(fr, to int, on string)
- func (nn *NFA_PoolType) AddLambda(fr, to int)
- func (nn *NFA_PoolType) AddLambdaSpecial(fr, to int)
- func (nn *NFA_PoolType) AddReInfo(Re string, reFlags string, tRuleMatchId int, tRv int, info InfoType) int
- func (nn *NFA_PoolType) ChangeRe(oldRe string, newRe string)
- func (nn *NFA_PoolType) ConvParsedReToNFA(depth int, lr *re.LexReType, CurIn int, Children []re.ReTreeNodeType) (int, int)
- func (nn *NFA_PoolType) DeleteRe(oldRe string)
- func (nn *NFA_PoolType) DiscardPool()
- func (nn *NFA_PoolType) DumpPool(all bool)
- func (nn *NFA_PoolType) DumpPoolJSON(fo io.Writer, td string, tn int)
- func (nn *NFA_PoolType) EdgeExists(fr, to int, on string, lambda bool) bool
- func (nn *NFA_PoolType) FinializeNFA()
- func (nn *NFA_PoolType) FreeNFA(ii int)
- func (nn *NFA_PoolType) GenerateGVFile(fo io.Writer, td string, tn int)
- func (nn *NFA_PoolType) GenerateSigma() (s string)
- func (nn *NFA_PoolType) GetNFA() int
- func (nn *NFA_PoolType) HasTauEdge(StateSet []int) (Is0Ch bool)
- func (nn *NFA_PoolType) IsNonTerminalPushPopState(StateSet []int) (rv int, is bool, info InfoType, Is0Ch bool)
- func (nn *NFA_PoolType) IsTerminalState(StateSet []int) (rv int, is bool, info InfoType, Is0Ch bool)
- func (nn *NFA_PoolType) LambdaClosure(startState []int) (setLambda []int)
- func (nn *NFA_PoolType) LambdaClosureSet(startState []int, S string) (setLambda []int)
- func (nn *NFA_PoolType) Mark(cur int, t re.LR_TokType)
- func (nn *NFA_PoolType) NoneVisited()
- func (nn *NFA_PoolType) Pos0Start() int
- func (nn *NFA_PoolType) SetReservedWord(Cur int)
- func (nn *NFA_PoolType) UnDeleteRe(oldRe string)
- func (nn *NFA_PoolType) UniqSigma() (rv string)
- type NFA_Type
- type NNPairType
- type ReSetType
- type TransitionType
Constants ¶
const InitNFASize = 3
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NFA_PoolType ¶
type NFA_PoolType struct { Pool []NFA_Type Cur int Top int NextFree int InitState int Sigma string // ReSet []*ReSetType IsDirty bool }
func (*NFA_PoolType) AddEdge ¶
func (nn *NFA_PoolType) AddEdge(fr, to int, on string)
func (*NFA_PoolType) AddLambda ¶
func (nn *NFA_PoolType) AddLambda(fr, to int)
func (*NFA_PoolType) AddLambdaSpecial ¶
func (nn *NFA_PoolType) AddLambdaSpecial(fr, to int)
func (*NFA_PoolType) ChangeRe ¶
func (nn *NFA_PoolType) ChangeRe(oldRe string, newRe string)
func (*NFA_PoolType) ConvParsedReToNFA ¶
func (nn *NFA_PoolType) ConvParsedReToNFA(depth int, lr *re.LexReType, CurIn int, Children []re.ReTreeNodeType) (int, int)
func (*NFA_PoolType) DeleteRe ¶
func (nn *NFA_PoolType) DeleteRe(oldRe string)
func (*NFA_PoolType) DiscardPool ¶
func (nn *NFA_PoolType) DiscardPool()
func (*NFA_PoolType) DumpPool ¶
func (nn *NFA_PoolType) DumpPool(all bool)
func (*NFA_PoolType) DumpPoolJSON ¶
func (nn *NFA_PoolType) DumpPoolJSON(fo io.Writer, td string, tn int)
func (*NFA_PoolType) EdgeExists ¶
func (nn *NFA_PoolType) EdgeExists(fr, to int, on string, lambda bool) bool
func (*NFA_PoolType) FinializeNFA ¶
func (nn *NFA_PoolType) FinializeNFA()
func (*NFA_PoolType) GenerateGVFile ¶
func (nn *NFA_PoolType) GenerateGVFile(fo io.Writer, td string, tn int)
func (*NFA_PoolType) GenerateSigma ¶
func (nn *NFA_PoolType) GenerateSigma() (s string)
Set of possible input tokens Walk the NFA and collect all unique tokens that are not lambda and have a transition
func (*NFA_PoolType) HasTauEdge ¶
func (nn *NFA_PoolType) HasTauEdge(StateSet []int) (Is0Ch bool)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
func (*NFA_PoolType) IsNonTerminalPushPopState ¶
func (nn *NFA_PoolType) IsNonTerminalPushPopState(StateSet []int) (rv int, is bool, info InfoType, Is0Ch bool)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
func (*NFA_PoolType) IsTerminalState ¶
func (*NFA_PoolType) LambdaClosure ¶
func (nn *NFA_PoolType) LambdaClosure(startState []int) (setLambda []int)
Given an initial set of startState, calculate the set of states that can be reached via a lambda (empty string).
func (*NFA_PoolType) LambdaClosureSet ¶
func (nn *NFA_PoolType) LambdaClosureSet(startState []int, S string) (setLambda []int)
t1 := nn.LambdaClosureSet ( dfa_set, string(S) )
func (*NFA_PoolType) Mark ¶
func (nn *NFA_PoolType) Mark(cur int, t re.LR_TokType)
func (*NFA_PoolType) NoneVisited ¶
func (nn *NFA_PoolType) NoneVisited()
func (*NFA_PoolType) Pos0Start ¶
func (nn *NFA_PoolType) Pos0Start() int
Return the start state number
func (*NFA_PoolType) SetReservedWord ¶
func (nn *NFA_PoolType) SetReservedWord(Cur int)
func (*NFA_PoolType) UnDeleteRe ¶
func (nn *NFA_PoolType) UnDeleteRe(oldRe string)
func (*NFA_PoolType) UniqSigma ¶
func (nn *NFA_PoolType) UniqSigma() (rv string)
type NFA_Type ¶
type NFA_Type struct { Next2 []TransitionType // Rv int // 0 indicates not assigned, non-terminal Info InfoType // TRuleMatch int // Order that stuff was creaed in NextFree int // For free list IsUsed bool // For Free list A_IAm int // Debug Usage LineNo string // LineNo where added Visited bool // Visited Marker TokType re.LR_TokType // Type of token, marked for LR_STAR, LR_PLUS, LR_QUEST, LR_OP_BR etc. }
type NNPairType ¶
type ReSetType ¶
type ReSetType struct { Re string // String this RE is from Rv int // Terminal value to return if it matches TRuleMatch int // Order that stuff was created in IsDirty bool // Indicates "Re" has been chagned without rebuilding ParsedRe HasDot bool // Indicates that completed ParsedRe has a DOT in it HasNCCL bool // Indicates that completed ParsedRe has a NCCL in it Deleted bool // Inidiates that this item has been deleted ParsedRe *re.LexReType // Parsed Tree Info InfoType // }