antlr-ng
Version:
Next generation ANTLR Tool
65 lines (64 loc) • 3.7 kB
TypeScript
import { IntervalSet } from "antlr4ng";
import type { IToolParameters } from "../tool-parameters.js";
import { Alternative } from "../tool/Alternative.js";
import type { Grammar } from "../tool/Grammar.js";
import { Rule } from "../tool/Rule.js";
import { ActionAST } from "../tool/ast/ActionAST.js";
import { BlockAST } from "../tool/ast/BlockAST.js";
import { GrammarAST } from "../tool/ast/GrammarAST.js";
import { CodeGenerator } from "./CodeGenerator.js";
import type { IOutputModelFactory } from "./IOutputModelFactory.js";
import type { OutputModelController } from "./OutputModelController.js";
import { AddToLabelList } from "./model/AddToLabelList.js";
import { Choice } from "./model/Choice.js";
import { CodeBlockForAlt } from "./model/CodeBlockForAlt.js";
import { ILabeledOp } from "./model/ILabeledOp.js";
import type { Lexer } from "./model/Lexer.js";
import type { LexerFile } from "./model/LexerFile.js";
import { Parser } from "./model/Parser.js";
import { ParserFile } from "./model/ParserFile.js";
import { RuleFunction } from "./model/RuleFunction.js";
import { SrcOp } from "./model/SrcOp.js";
import type { CodeBlock } from "./model/decl/CodeBlock.js";
import { Decl } from "./model/decl/Decl.js";
import { TokenListDecl } from "./model/decl/TokenListDecl.js";
export declare class ParserFactory implements IOutputModelFactory {
private forceAtn?;
readonly g: Grammar;
controller: OutputModelController;
private readonly gen;
constructor(gen: CodeGenerator, forceAtn?: boolean | undefined);
parserFile(fileName: string, toolParameters: IToolParameters): ParserFile;
parser(file: ParserFile): Parser;
lexerFile(fileName: string): LexerFile | undefined;
getGrammar(): Grammar | undefined;
lexer(file: LexerFile): Lexer | undefined;
rule(r: Rule): RuleFunction;
epsilon(alt: Alternative, outerMost: boolean): CodeBlockForAlt;
alternative(alt: Alternative, outerMost: boolean): CodeBlockForAlt;
finishAlternative(blk: CodeBlockForAlt, ops: SrcOp[] | undefined): CodeBlockForAlt;
stringRef(id: GrammarAST, label: GrammarAST | null): SrcOp[] | undefined;
action(ast: ActionAST): SrcOp[];
sempred(ast: ActionAST): SrcOp[];
ruleRef(id: GrammarAST, label: GrammarAST | null, args: GrammarAST): SrcOp[];
getCurrentRuleFunction(): RuleFunction | undefined;
tokenRef(id: GrammarAST, labelAST: GrammarAST | null, args: GrammarAST | null): SrcOp[];
getTokenLabelDecl(label: string): Decl;
getTokenListLabelDecl(label: string): TokenListDecl;
set(setAST: GrammarAST, labelAST: GrammarAST | null, invert: boolean): SrcOp[];
wildcard(ast: GrammarAST, labelAST: GrammarAST | null): SrcOp[];
getChoiceBlock(blkAST: BlockAST, alts: CodeBlockForAlt[], labelAST: GrammarAST | null): Choice;
getEBNFBlock(ebnfRoot: GrammarAST, alts: CodeBlockForAlt[]): Choice | undefined;
getLL1ChoiceBlock(blkAST: BlockAST, alts: CodeBlockForAlt[]): Choice;
getComplexChoiceBlock(blkAST: BlockAST, alts: CodeBlockForAlt[]): Choice;
getLL1EBNFBlock(ebnfRoot: GrammarAST, alts: CodeBlockForAlt[]): Choice | undefined;
getComplexEBNFBlock(ebnfRoot: GrammarAST, alts: CodeBlockForAlt[]): Choice | undefined;
getLL1Test(look: IntervalSet, blkAST: GrammarAST): SrcOp[];
getGenerator(): CodeGenerator;
getCurrentOuterMostAlt(): Alternative;
getCurrentBlock(): CodeBlock;
rulePostamble(ruleFunction: RuleFunction, r: Rule): SrcOp[] | undefined;
needsImplicitLabel(id: GrammarAST, op: ILabeledOp): boolean;
defineImplicitLabel(ast: GrammarAST, op: ILabeledOp): void;
getAddToListOpIfListLabelPresent(op: ILabeledOp, label: GrammarAST | null): AddToLabelList | null;
}