UNPKG

antlr-ng

Version:

Next generation ANTLR Tool

26 lines (25 loc) 1.08 kB
import { type Token } from "antlr4ng"; import type { IActionSplitterListener } from "../parse/IActionSplitterListener.js"; import { Alternative } from "../tool/Alternative.js"; import { ActionAST } from "../tool/ast/ActionAST.js"; import { Grammar } from "../tool/Grammar.js"; import { Rule } from "../tool/Rule.js"; /** Find token and rule refs plus refs to them in actions; side-effect: update Alternatives. */ export declare class ActionSniffer implements IActionSplitterListener { g: Grammar; r: Rule; alt: Alternative; node: ActionAST; /** Token within action. */ actionToken: Token; constructor(g: Grammar, r: Rule, alt: Alternative, node: ActionAST, actionToken: Token); examineAction(): void; processNested(actionToken: string): void; attr(expr: string, x: Token): void; qualifiedAttr(expr: string, x: Token, y: Token): void; setAttr(expr: string, x: Token, rhs: Token): void; setNonLocalAttr(expr: string, x: Token, y: Token, rhs: string): void; nonLocalAttr(): void; text(): void; trackRef(x: string): void; }