Versions in this module Expand all Collapse all v1 v1.0.6 Apr 10, 2025 v1.0.5 Apr 10, 2025 v1.0.4 Apr 10, 2025 v1.0.3 Apr 10, 2025 v1.0.2 Apr 10, 2025 v1.0.1 Apr 10, 2025 v1.0.0 Apr 10, 2025 Changes in this version + var DepthLimit = 10000 + var GUIActive = false + var RuleMap map[string]*Rule + type AST struct + Src string + SrcReg lexer.Reg + Syms syms.SymStack + TokReg lexer.Reg + func NewAST(parent ...tree.Node) *AST + func (ast *AST) ChildAST(idx int) *AST + func (ast *AST) Destroy() + func (ast *AST) NextAST() *AST + func (ast *AST) NextSiblingAST() *AST + func (ast *AST) ParentAST() *AST + func (ast *AST) PrevAST() *AST + func (ast *AST) SetTokReg(reg lexer.Reg, src *lexer.File) + func (ast *AST) SetTokRegEnd(pos lexer.Pos, src *lexer.File) + func (ast *AST) WriteTree(out io.Writer, depth int) + type ASTActs int32 + const ASTActsN + const AddAST + const AnchorAST + const AnchorFirstAST + const NoAST + const SubAST + func ASTActsValues() []ASTActs + func (i *ASTActs) SetInt64(in int64) + func (i *ASTActs) SetString(s string) error + func (i *ASTActs) UnmarshalText(text []byte) error + func (i ASTActs) Desc() string + func (i ASTActs) Int64() int64 + func (i ASTActs) MarshalText() ([]byte, error) + func (i ASTActs) String() string + func (i ASTActs) Values() []enums.Enum + type Act struct + Act Actions + FromToken token.Tokens + Path string + RunIndex int + Token token.Tokens + func (ac *Act) ChangeToken(lx *lexer.Lex) + func (ac Act) String() string + type Actions int32 + const ActionsN + const AddDetail + const AddSymbol + const AddType + const ChangeToken + const PopScope + const PopScopeReg + const PopStack + const PushNewScope + const PushScope + const PushStack + func ActionsValues() []Actions + func (i *Actions) SetInt64(in int64) + func (i *Actions) SetString(s string) error + func (i *Actions) UnmarshalText(text []byte) error + func (i Actions) Desc() string + func (i Actions) Int64() int64 + func (i Actions) MarshalText() ([]byte, error) + func (i Actions) String() string + func (i Actions) Values() []enums.Enum + type Acts []Act + func (ac Acts) String() string + type MatchStack []MatchState + func (rs *MatchStack) Add(pr *Rule, scope lexer.Reg, regs Matches) + func (rs *MatchStack) Find(pr *Rule, scope lexer.Reg) (*MatchState, bool) + type MatchState struct + Regs Matches + Rule *Rule + Scope lexer.Reg + func (rs MatchState) String() string + type Matches []lexer.Reg + func (mm Matches) StartEnd() lexer.Reg + func (mm Matches) StartEndExcl(ps *State) lexer.Reg + type Rule struct + AST ASTActs + Acts Acts + Desc string + ExclFwd RuleList + ExclKeyIndex int + ExclRev RuleList + FiTokenElseIndex int + FiTokenMap map[string]*Rule + FirstTokenMap bool + Off bool + OptTokenMap bool + Order []int + Rule string + Rules RuleList + StackMatch string + func NewRule(parent ...tree.Node) *Rule + func (pr *Rule) Compile(ps *State) bool + func (pr *Rule) CompileAll(ps *State) bool + func (pr *Rule) CompileExcl(ps *State, rs []string, rist int) bool + func (pr *Rule) CompileTokMap(ps *State) bool + func (pr *Rule) DoAct(ps *State, act *Act, parent *Rule, ourAST, parAST *AST) bool + func (pr *Rule) DoActs(ps *State, ri int, parent *Rule, ourAST, parentAST *AST) bool + func (pr *Rule) DoRules(ps *State, parent *Rule, parentAST *AST, scope lexer.Reg, mpos Matches, ...) bool + func (pr *Rule) DoRulesRevBinExp(ps *State, parent *Rule, parentAST *AST, scope lexer.Reg, mpos Matches, ...) bool + func (pr *Rule) Find(find string) []*Rule + func (pr *Rule) IsGroup() bool + func (pr *Rule) Match(ps *State, parAST *AST, scope lexer.Reg, depth int, optMap lexer.TokenMap) (bool, lexer.Reg, Matches) + func (pr *Rule) MatchExclude(ps *State, scope lexer.Reg, ktpos lexer.Reg, depth int, optMap lexer.TokenMap) bool + func (pr *Rule) MatchGroup(ps *State, parAST *AST, scope lexer.Reg, depth int, optMap lexer.TokenMap) (bool, lexer.Reg, Matches) + func (pr *Rule) MatchMixed(ps *State, parAST *AST, scope lexer.Reg, depth int, optMap lexer.TokenMap) (bool, Matches) + func (pr *Rule) MatchNoToks(ps *State, parAST *AST, scope lexer.Reg, depth int, optMap lexer.TokenMap) (bool, Matches) + func (pr *Rule) MatchOnlyToks(ps *State, parAST *AST, scope lexer.Reg, depth int, optMap lexer.TokenMap) (bool, Matches) + func (pr *Rule) MatchToken(ps *State, rr *RuleEl, ri int, kt token.KeyToken, creg *lexer.Reg, ...) (bool, lexer.Pos) + func (pr *Rule) OptimizeOrder(ps *State) + func (pr *Rule) Parse(ps *State, parent *Rule, parAST *AST, scope lexer.Reg, optMap lexer.TokenMap, ...) *Rule + func (pr *Rule) ParseRules(ps *State, parent *Rule, parAST *AST, scope lexer.Reg, optMap lexer.TokenMap, ...) *Rule + func (pr *Rule) Scope(ps *State, parAST *AST, scope lexer.Reg) (lexer.Reg, bool) + func (pr *Rule) SetRuleMap(ps *State) + func (pr *Rule) StartParse(ps *State) *Rule + func (pr *Rule) Validate(ps *State) bool + func (pr *Rule) WriteGrammar(writer io.Writer, depth int) + func (t *Rule) SetAST(v ASTActs) *Rule + func (t *Rule) SetActs(v Acts) *Rule + func (t *Rule) SetDesc(v string) *Rule + func (t *Rule) SetFirstTokenMap(v bool) *Rule + func (t *Rule) SetOff(v bool) *Rule + func (t *Rule) SetOptTokenMap(v bool) *Rule + func (t *Rule) SetOrder(v ...int) *Rule + func (t *Rule) SetRule(v string) *Rule + func (t *Rule) SetRules(v RuleList) *Rule + func (t *Rule) SetStackMatch(v string) *Rule + type RuleEl struct + FromNext bool + Match bool + Opt bool + Rule *Rule + StInc int + Token token.KeyToken + func (re RuleEl) IsRule() bool + func (re RuleEl) IsToken() bool + type RuleList []RuleEl + func (rl RuleList) Last() *RuleEl + type ScopeRule struct + Rule *Rule + Scope lexer.Reg + type ScopeRuleSet map[ScopeRule]struct + func (rs ScopeRuleSet) Add(scope lexer.Reg, pr *Rule) + func (rs ScopeRuleSet) Has(scope lexer.Reg, pr *Rule) bool + type State struct + AST *AST + Errs lexer.ErrorList + Matches [][]MatchStack + NonMatches ScopeRuleSet + Pos lexer.Pos + Scopes syms.SymStack + Src *lexer.File + Stack lexer.Stack + Syms syms.SymMap + Trace TraceOptions + func (ps *State) AddAST(parAST *AST, rule string, reg lexer.Reg) *AST + func (ps *State) AddMatch(pr *Rule, scope lexer.Reg, regs Matches) + func (ps *State) AddNonMatch(scope lexer.Reg, pr *Rule) + func (ps *State) AllocRules() + func (ps *State) AtEof() bool + func (ps *State) AtEofNext() bool + func (ps *State) ClearAST() + func (ps *State) Destroy() + func (ps *State) Error(pos lexer.Pos, msg string, rule *Rule) + func (ps *State) FindNameScoped(nm string) (*syms.Symbol, bool) + func (ps *State) FindNameTopScope(nm string) (*syms.Symbol, bool) + func (ps *State) FindToken(tkey token.KeyToken, reg lexer.Reg) (lexer.Pos, bool) + func (ps *State) FindTokenReverse(tkey token.KeyToken, reg lexer.Reg) (lexer.Pos, bool) + func (ps *State) GotoEof() + func (ps *State) Init(src *lexer.File, ast *AST) + func (ps *State) IsMatch(pr *Rule, scope lexer.Reg) (*MatchState, bool) + func (ps *State) IsNonMatch(scope lexer.Reg, pr *Rule) bool + func (ps *State) MatchLex(lx *lexer.Lex, tkey token.KeyToken, isCat, isSubCat bool, cp lexer.Pos) bool + func (ps *State) MatchToken(tkey token.KeyToken, pos lexer.Pos) bool + func (ps *State) NextSrcLine() string + func (ps *State) ResetNonMatches() + func (ps *State) RuleString(full bool) string + type Steps int32 + const Match + const NoMatch + const Run + const RunAct + const StepsN + const SubMatch + func StepsValues() []Steps + func (i *Steps) SetInt64(in int64) + func (i *Steps) SetString(s string) error + func (i *Steps) UnmarshalText(text []byte) error + func (i Steps) Desc() string + func (i Steps) Int64() int64 + func (i Steps) MarshalText() ([]byte, error) + func (i Steps) String() string + func (i Steps) Values() []enums.Enum + type TraceOptions struct + FullStackOut bool + Match bool + NoMatch bool + On bool + OutRead *os.File + OutWrite *os.File + Rules string + RulesList []string + Run bool + RunAct bool + ScopeSrc bool + SubMatch bool + func (pt *TraceOptions) CheckRule(rule string) bool + func (pt *TraceOptions) CopyOpts(ot *TraceOptions) + func (pt *TraceOptions) FullOn() + func (pt *TraceOptions) Init() + func (pt *TraceOptions) Out(ps *State, pr *Rule, step Steps, pos lexer.Pos, scope lexer.Reg, ast *AST, ...) bool + func (pt *TraceOptions) PipeOut() + func (pt *TraceOptions) Stdout()