Documentation
¶
Index ¶
- Constants
- func ConvertStringActionToFlag(aa string) (rv int)
- func KeyIntMapStringSort(in map[int]string) []int
- func KeyIntSort(in []int) (rv []int)
- type DFA_PoolType
- func (dfa *DFA_PoolType) AddEdge(fr, to int, on string)
- func (dfa *DFA_PoolType) ConvNDA_to_DFA(nn *nfa.NFA_PoolType)
- func (dfa *DFA_PoolType) ConvertToTable() (rv dfaTable)
- func (dfa *DFA_PoolType) DiscardPool()
- func (dfa *DFA_PoolType) DumpPool(all bool)
- func (dfa *DFA_PoolType) DumpPoolJSON(fo io.Writer, td string, tn int)
- func (dfa *DFA_PoolType) DumpPoolOneState(ii int) string
- func (dfa *DFA_PoolType) DumpTokenBuffer()
- func (dfa *DFA_PoolType) EdgeExists(fr, to int, on string) bool
- func (dfa *DFA_PoolType) FindNotVisited() int
- func (dfa *DFA_PoolType) FinializeDFA()
- func (dfa *DFA_PoolType) FreeDFA(ii int)
- func (dfa *DFA_PoolType) GenerateGVFile(fo io.Writer, td string, tn int)
- func (dfa *DFA_PoolType) GetDFA() int
- func (dfa *DFA_PoolType) GetDFAName(StateSet []int) int
- func (dfa *DFA_PoolType) HaveStateAlready(inputSet []int) (loc int)
- func (dfa *DFA_PoolType) NoneVisited()
- func (dfa *DFA_PoolType) NumberOfStates() (N_States int)
- func (dfa *DFA_PoolType) OutputInFormat(fo io.Writer, format string)
- func (dfa *DFA_PoolType) Pos0Start() int
- func (dfa *DFA_PoolType) VerifyMachine()
- type DFA_Type
- type Lexie
- func (lex *Lexie) DumpTokenBuffer(fo io.Writer)
- func (lex *Lexie) DumpTokenBuffer2(fo io.Writer)
- func (lex *Lexie) FinializeMachines()
- func (lex *Lexie) GetToken() (AToken tok.Token)
- func (lex *Lexie) InitGetToken(rrr *pbread.PBReadType, sm string) (AToken tok.Token)
- func (lex *Lexie) MatcherLexieTable(rrr *pbread.PBReadType, s_init string)
- func (lex *Lexie) NewReadFile(path string)
- func (lex *Lexie) OutputActionFlags(dfa *DFA_PoolType)
- func (lex *Lexie) SetChanelOnOff(flag bool)
- type LexieChanelType
- type LexieStackType
- type MachineStatesType
- type MatchContextType
Constants ¶
const InitDFASize = 3
Variables ¶
This section is empty.
Functions ¶
func KeyIntMapStringSort ¶
func KeyIntSort ¶
Types ¶
type DFA_PoolType ¶
type DFA_PoolType struct { Pool []DFA_Type // Cur int // Top int // NextFree int // InitState int // Sigma string // MTab *dfaTable // TokList *tok.TokenList // ATokBuffer TokenBuffer // Output Token Stuff MachineId int }
func NewDFA_Pool ¶
func NewDFA_Pool() *DFA_PoolType
----------------------------------------------------------------------------------------------------------------------------------------------- Create a new DFA pool
func (*DFA_PoolType) AddEdge ¶
func (dfa *DFA_PoolType) AddEdge(fr, to int, on string)
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) ConvNDA_to_DFA ¶
func (dfa *DFA_PoolType) ConvNDA_to_DFA(nn *nfa.NFA_PoolType)
func (*DFA_PoolType) ConvertToTable ¶
func (dfa *DFA_PoolType) ConvertToTable() (rv dfaTable)
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) DiscardPool ¶
func (dfa *DFA_PoolType) DiscardPool()
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) DumpPool ¶
func (dfa *DFA_PoolType) DumpPool(all bool)
func (*DFA_PoolType) DumpPoolJSON ¶
func (dfa *DFA_PoolType) DumpPoolJSON(fo io.Writer, td string, tn int)
func (*DFA_PoolType) DumpPoolOneState ¶
func (dfa *DFA_PoolType) DumpPoolOneState(ii int) string
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) DumpTokenBuffer ¶
func (dfa *DFA_PoolType) DumpTokenBuffer()
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) EdgeExists ¶
func (dfa *DFA_PoolType) EdgeExists(fr, to int, on string) bool
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) FindNotVisited ¶
func (dfa *DFA_PoolType) FindNotVisited() int
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) FinializeDFA ¶
func (dfa *DFA_PoolType) FinializeDFA()
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) FreeDFA ¶
func (dfa *DFA_PoolType) FreeDFA(ii int)
----------------------------------------------------------------------------------------------------------------------------------------------- Free an DFA tree node
func (*DFA_PoolType) GenerateGVFile ¶
func (dfa *DFA_PoolType) GenerateGVFile(fo io.Writer, td string, tn int)
func (*DFA_PoolType) GetDFA ¶
func (dfa *DFA_PoolType) GetDFA() int
----------------------------------------------------------------------------------------------------------------------------------------------- Allocate an DFA tree node
func (*DFA_PoolType) GetDFAName ¶
func (dfa *DFA_PoolType) GetDFAName(StateSet []int) int
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) HaveStateAlready ¶
func (dfa *DFA_PoolType) HaveStateAlready(inputSet []int) (loc int)
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) NoneVisited ¶
func (dfa *DFA_PoolType) NoneVisited()
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) NumberOfStates ¶
func (dfa *DFA_PoolType) NumberOfStates() (N_States int)
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) OutputInFormat ¶
func (dfa *DFA_PoolType) OutputInFormat(fo io.Writer, format string)
-----------------------------------------------------------------------------------------------------------------------------------------------
func (*DFA_PoolType) Pos0Start ¶
func (dfa *DFA_PoolType) Pos0Start() int
----------------------------------------------------------------------------------------------------------------------------------------------- Return the start state number
func (*DFA_PoolType) VerifyMachine ¶
func (dfa *DFA_PoolType) VerifyMachine()
---------------------------------------------------------------------------------------------------------------------------------------------------------------
- Input Parsing Issues/Errors/Warnings
- Can not have A_Pop and A_Push at same time - Check for this.
- A_Pop must be a hard match -
- A_Pop must be a terminal! - Return() must have a Rv()
- A_Push, A_Pop, A_Reset can not be ambiguous tokens, can not {% POP and {%= Return a value, won't work ( At least not yet )
type DFA_Type ¶
type DFA_Type struct { Next2 []nfa.TransitionType // Rv int // 0 indicates not assigned, non-terminal Is0Ch bool // Tau Info nfa.InfoType // TRuleMatch int // may be a non-terminal that you want to know matched. -- A set of these is returned on matches or can be retrieved on fails too. NextFree int // For free list IsUsed bool // For Free list A_IAm int // Debug Usage LineNo string // LineNo where added StateName string // Used in NFA -> DFA StateSet []int // Visited bool // }
type Lexie ¶
type Lexie struct { IsCompiled bool // Is it currently compiled into a DFA NFA []*nfa.NFA_PoolType DFA []*DFA_PoolType Machines []int NFA_Machine []*nfa.NFA_PoolType DFA_Machine []*DFA_PoolType TokList *tok.TokenList // ATokBuffer TokenBuffer // Output Token Stuff Im *in.ImType InputReader *pbread.PBReadType StartMachine string // Channel to return data on SendOnChanel bool Message chan LexieChanelType }
func NewLexie ¶
func NewLexie() *Lexie
---------------------------------------------------------------------------------------------------------------------------------------------------------------
func (*Lexie) DumpTokenBuffer ¶
lex .DumpTokenBuffer()
func (*Lexie) DumpTokenBuffer2 ¶
func (*Lexie) FinializeMachines ¶
func (lex *Lexie) FinializeMachines()
---------------------------------------------------------------------------------------------------------------------------------------------------------------
func (*Lexie) GetToken ¶
---------------------------------------------------------------------------------------------------------------------------------------------------------------
func (*Lexie) InitGetToken ¶
---------------------------------------------------------------------------------------------------------------------------------------------------------------
func (*Lexie) MatcherLexieTable ¶
func (lex *Lexie) MatcherLexieTable(rrr *pbread.PBReadType, s_init string)
func (*Lexie) NewReadFile ¶
func (*Lexie) OutputActionFlags ¶
func (lex *Lexie) OutputActionFlags(dfa *DFA_PoolType)
func (*Lexie) SetChanelOnOff ¶
---------------------------------------------------------------------------------------------------------------------------------------------------------------
type LexieChanelType ¶
type LexieStackType ¶
type LexieStackType struct {
St int // Current State in
}
type MachineStatesType ¶
type MatchContextType ¶
type MatchContextType struct { St int Dfa *DFA_PoolType }
---------------------------------------------------------------------------------------------------------------------------------------------------------------
func NewContext ¶
func NewContext(InitState int, dfa *DFA_PoolType) (rv *MatchContextType)