antlr-ng
Version:
Next generation ANTLR Tool
118 lines (117 loc) • 5.66 kB
TypeScript
import { CommonTreeNodeStream } from "../CommonTreeNodeStream.js";
import { TreeParser } from "../TreeParser.js";
import type { ActionAST } from "../../tool/ast/ActionAST.js";
import type { AltAST } from "../../tool/ast/AltAST.js";
import type { GrammarAST } from "../../tool/ast/GrammarAST.js";
import type { GrammarASTWithOptions } from "../../tool/ast/GrammarASTWithOptions.js";
import type { GrammarRootAST } from "../../tool/ast/GrammarRootAST.js";
import type { PredAST } from "../../tool/ast/PredAST.js";
import type { RuleAST } from "../../tool/ast/RuleAST.js";
import type { TerminalAST } from "../../tool/ast/TerminalAST.js";
import type { ErrorManager } from "../../tool/ErrorManager.js";
/** The tree grammar visitor to walk the AST created from a parsed grammar. */
export declare class GrammarTreeVisitor extends TreeParser {
protected currentRuleName?: string;
protected currentOuterAltNumber: number;
protected currentModeName: string;
constructor(errorManager: ErrorManager, input?: CommonTreeNodeStream);
visitGrammar(t: GrammarRootAST): void;
visit(t: GrammarAST, ruleIndex: number): void;
outerAlternative(): void;
protected discoverGrammar(root: GrammarRootAST, id: GrammarAST | null): void;
protected finishPrequels(firstPrequel: GrammarAST | null): void;
protected finishGrammar(root: GrammarRootAST, id: GrammarAST | null): void;
protected grammarOption(id: GrammarAST | null, valueAST: GrammarAST | null): void;
protected ruleOption(id: GrammarAST | null, valueAST: GrammarAST | null): void;
protected blockOption(id: GrammarAST | null, valueAST: GrammarAST | null): void;
protected defineToken(id: GrammarAST): void;
protected defineChannel(id: GrammarAST): void;
protected globalNamedAction(scope: GrammarAST | null, id: GrammarAST, action: ActionAST): void;
protected importGrammar(label: GrammarAST | null, id: GrammarAST): void;
protected modeDef(m: GrammarAST | null, id: GrammarAST | null): void;
protected discoverRules(rules: GrammarAST): void;
protected discoverRule(rule: RuleAST | undefined, id: GrammarAST | undefined, modifiers: Array<GrammarAST | null>, arg: ActionAST | undefined, returns: ActionAST | undefined, throws: GrammarAST | undefined, options: GrammarAST | undefined, locals: ActionAST | undefined, actions: Array<GrammarAST | null>, block: GrammarAST | null): void;
protected finishRule(rule: RuleAST | null, id: GrammarAST | null, block: GrammarAST | null): void;
protected discoverLexerRule(rule: RuleAST | null, id: GrammarAST | null, modifiers: GrammarAST[], options: GrammarAST | null, block: GrammarAST): void;
protected ruleCatch(arg: GrammarAST, action: ActionAST): void;
protected finallyAction(action: ActionAST): void;
protected discoverOuterAlt(alt: AltAST): void;
protected ruleRef(ref: GrammarAST, arg: ActionAST): void;
protected tokenRef(ref: TerminalAST): void;
protected elementOption(t: GrammarASTWithOptions, id: GrammarAST, valueAST: GrammarAST | null): void;
protected stringRef(ref: TerminalAST): void;
protected actionInAlt(action: ActionAST): void;
protected sempredInAlt(pred: PredAST): void;
protected label(op: GrammarAST | null, id: GrammarAST | null, element: GrammarAST): void;
protected lexerCommand(outerAltNumber: number, id: GrammarAST): void;
protected enterChannelsSpec(tree: GrammarAST): void;
protected enterMode(tree: GrammarAST): void;
protected exitMode(tree: GrammarAST): void;
protected enterLexerRule(tree: GrammarAST): void;
protected exitLexerRule(tree: GrammarAST): void;
protected enterLexerAlternative(tree: GrammarAST): void;
protected exitLexerAlternative(tree: GrammarAST): void;
protected enterLexerElement(tree: GrammarAST): void;
protected exitLexerElement(tree: GrammarAST): void;
protected enterAlternative(tree: AltAST): void;
protected exitAlternative(tree: AltAST): void;
protected enterLexerCommand(tree: GrammarAST): void;
protected enterElement(tree: GrammarAST): void;
protected exitElement(tree: GrammarAST): void;
protected exitSubrule(tree: GrammarAST): void;
protected exitLexerSubrule(tree: GrammarAST): void;
protected enterBlockSet(tree: GrammarAST): void;
protected exitBlockSet(tree: GrammarAST): void;
protected enterTerminal(tree: GrammarAST): void;
private grammarSpec;
private prequelConstructs;
private prequelConstruct;
private optionsSpec;
private option;
private optionValue;
private delegateGrammars;
private delegateGrammar;
private tokensSpec;
private tokenSpec;
private channelsSpec;
private channelSpec;
private action;
private rules;
private mode;
private lexerRule;
private ruleSpec;
private exceptionGroup;
private exceptionHandler;
private finallyClause;
private locals;
private ruleReturns;
private throwsSpec;
private ruleAction;
private ruleModifier;
private lexerRuleBlock;
private ruleBlock;
private lexerOuterAlternative;
private lexerAlternative;
private lexerElements;
private lexerElement;
private lexerBlock;
private lexerAtom;
private alternative;
private lexerCommandExpr;
private element;
private labeledElement;
private subrule;
private lexerSubrule;
private blockSuffix;
private ebnfSuffix;
private atom;
private blockSet;
private setElement;
private block;
private ruleref;
private range;
private terminal;
private elementOptions;
private handleLexerCommand;
private handleElementOption;
}