Versions in this module Expand all Collapse all v1 v1.0.0 Jul 24, 2025 Changes in this version + var DepthLimit = 10000 + var GUIActive = false + var RuleMap map[string]*Rule + type AST struct + Src string + SrcReg textpos.Region + Syms syms.SymStack + TokReg textpos.Region + func NewAST(parent ...tree.Node) *AST + func (ast *AST) ChildAST(idx int) *AST + func (ast *AST) ChildASTTry(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 textpos.Region, src *lexer.File) + func (ast *AST) SetTokRegEnd(pos textpos.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 textpos.Region, regs Matches) + func (rs *MatchStack) Find(pr *Rule, scope textpos.Region) (*MatchState, bool) + type MatchState struct + Regs Matches + Rule *Rule + Scope textpos.Region + func (rs MatchState) String() string + type Matches []textpos.Region + func (mm Matches) StartEnd() textpos.Region + func (mm Matches) StartEndExcl(ps *State) textpos.Region + 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 textpos.Region, mpos Matches, ...) bool + func (pr *Rule) DoRulesRevBinExp(ps *State, parent *Rule, parentAST *AST, scope textpos.Region, mpos Matches, ...) bool + func (pr *Rule) Find(find string) []*Rule + func (pr *Rule) IsGroup() bool + func (pr *Rule) Match(ps *State, parAST *AST, scope textpos.Region, depth int, optMap lexer.TokenMap) (bool, textpos.Region, Matches) + func (pr *Rule) MatchExclude(ps *State, scope textpos.Region, ktpos textpos.Region, depth int, ...) bool + func (pr *Rule) MatchGroup(ps *State, parAST *AST, scope textpos.Region, depth int, optMap lexer.TokenMap) (bool, textpos.Region, Matches) + func (pr *Rule) MatchMixed(ps *State, parAST *AST, scope textpos.Region, depth int, optMap lexer.TokenMap) (bool, Matches) + func (pr *Rule) MatchNoToks(ps *State, parAST *AST, scope textpos.Region, depth int, optMap lexer.TokenMap) (bool, Matches) + func (pr *Rule) MatchOnlyToks(ps *State, parAST *AST, scope textpos.Region, depth int, optMap lexer.TokenMap) (bool, Matches) + func (pr *Rule) MatchToken(ps *State, rr *RuleEl, ri int, kt token.KeyToken, creg *textpos.Region, ...) (bool, textpos.Pos) + func (pr *Rule) OptimizeOrder(ps *State) + func (pr *Rule) Parse(ps *State, parent *Rule, parAST *AST, scope textpos.Region, ...) *Rule + func (pr *Rule) ParseRules(ps *State, parent *Rule, parAST *AST, scope textpos.Region, ...) *Rule + func (pr *Rule) Scope(ps *State, parAST *AST, scope textpos.Region) (textpos.Region, 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 textpos.Region + type ScopeRuleSet map[ScopeRule]struct + func (rs ScopeRuleSet) Add(scope textpos.Region, pr *Rule) + func (rs ScopeRuleSet) Has(scope textpos.Region, pr *Rule) bool + type State struct + AST *AST + Errs lexer.ErrorList + Matches [][]MatchStack + NonMatches ScopeRuleSet + Pos textpos.Pos + Scopes syms.SymStack + Src *lexer.File + Stack lexer.Stack + Syms syms.SymMap + Trace TraceOptions + func (ps *State) AddAST(parAST *AST, rule string, reg textpos.Region) *AST + func (ps *State) AddMatch(pr *Rule, scope textpos.Region, regs Matches) + func (ps *State) AddNonMatch(scope textpos.Region, 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 textpos.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 textpos.Region) (textpos.Pos, bool) + func (ps *State) FindTokenReverse(tkey token.KeyToken, reg textpos.Region) (textpos.Pos, bool) + func (ps *State) GotoEof() + func (ps *State) Init(src *lexer.File, ast *AST) + func (ps *State) IsMatch(pr *Rule, scope textpos.Region) (*MatchState, bool) + func (ps *State) IsNonMatch(scope textpos.Region, pr *Rule) bool + func (ps *State) MatchLex(lx *lexer.Lex, tkey token.KeyToken, isCat, isSubCat bool, cp textpos.Pos) bool + func (ps *State) MatchToken(tkey token.KeyToken, pos textpos.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 textpos.Pos, scope textpos.Region, ...) bool + func (pt *TraceOptions) PipeOut() + func (pt *TraceOptions) Stdout()