package
1.0.28
Repository: https://github.com/goki/pi.git
Documentation: pkg.go.dev

# Constants

The parsing acts.
AddAst means create an Ast node for this rule, adding it to the current anchor Ast.
AddDetail adds src at given path as detail info for the last-added symbol if there is already something there, a space is added for this new addition.
AddSymbol means add name as a symbol, using current scoping and token type or the token specified in the Act action if != None.
AddType Adds a type with the given name -- sets the Ast node for this rule and actual type is resolved later in a second language-specific pass.
AnchorAst means create an Ast node and set it as the anchor that subsequent sub-nodes are added into.
AnchorFirstAst means create an Ast node and set it as the anchor that subsequent sub-nodes are added into, *only* if this is the first time that this rule has matched within the current sequence (i.e., if the parent of this rule is the same rule then don't add a new Ast node).
The Ast actions.
ChgToken changes the token to the Tok specified in the Act action.
Match happens when a rule matches.
MatchEOS means that the rule ends with a *matched* EOS with StInc = 1.
MultiEOS means that the rule has multiple EOS tokens within it -- changes some of the logic.
NoAst means don't create an Ast node for this rule.
NoMatch is when the rule fails to match (recorded at first non-match, which terminates matching process.
NoToks means that this rule doesn't have any explicit tokens -- only refers to other rules.
OnlyToks means that this rule only has explicit tokens for matching -- can be optimized.
PopScope means remove the most recently-added scope item.
PopScopeReg means remove the most recently-added scope item, and also updates the source region for that item based on final SrcReg from corresponding Ast node -- for "definitional" scope.
PopStack pops the stack.
PushNewScope means add a new symbol to the list and also push onto scope stack, using given token type or the token specified in the Act action if != None.
PushScope means look for an existing symbol of given name to push onto current scope -- adding a new one if not found -- does not add new item to overall symbol list.
PushStack adds name to stack -- provides context-sensitivity option for optimizing and ambiguity resolution.
Reverse means that this rule runs in reverse (starts with - sign) -- for arithmetic binary expressions only: this is needed to produce proper associativity result for mathematical expressions in the recursive descent parser.
Run is when the rule is running and iterating through its sub-rules.
RunAct is when the rule is running and performing actions.
SetsScope means that this rule sets its own scope, because it ends with EOS.
The parsing steps.
SubAst means create an Ast node and add all the elements of *this rule* as children of this new node (including sub-rules), *except* for the very last rule which is assumed to be a recursive rule -- that one goes back up to the parent node.
SubMatch is when a sub-rule within a rule matches.
TokMatchGroup is a group node that also has a single token match, so it can be used in a FirstTokMap to optimize lookup of rules.

# Variables

No description provided by the author
DepthLimit is the infinite recursion prevention cutoff.
Set GuiActive to true if the gui (piview) is active -- ensures that the Ast tree is updated when nodes are swapped in reverse mode, and maybe other things.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RuleMap is a map of all the rule names, for quick lookup.
No description provided by the author

# Structs

Act is one action to perform, operating on the Ast output.
Ast is a node in the abstract syntax tree generated by the parsing step the name of the node (from ki.Node) is the type of the element (e.g., expr, stmt, etc) These nodes are generated by the parse.Rule's by matching tokens.
MatchState holds state info for rules that matched, recorded at starting position of match.
The first step is matching which searches in order for matches within the children of parent nodes, and for explicit rule nodes, it looks first through all the explicit tokens in the rule.
RuleEl is an element of a parsing rule -- either a pointer to another rule or a token.
ScopeRule is a scope and a rule, for storing matches / nonmatch.
parse.State is the state maintained for parsing.
TraceOpts provides options for debugging / monitoring the rule matching and execution process.

# Interfaces

Parser is the interface type for parsers -- likely not necessary except is essential for defining the BaseIface for gui in making new nodes.

# Type aliases

Actions are parsing actions to perform.
Acts are multiple actions.
AstActs are actions to perform on the Ast nodes.
Matches encodes the regions of each match, Err for no match.
MatchStack is the stack of rules that matched or ran for each token point.
RuleFlags define bitflags for rule options compiled from rule syntax.
RuleList is a list (slice) of rule elements.
ScopeRuleSet is a map by scope of RuleSets, for non-matching rules.
Steps are the different steps of the parsing processing.