import { Token, Lexer } from 'antlr4';
import { ParserError, ErrorHandler } from './parserErrorListener';
/**
 * Custom Parser class, subclass needs extends it.
 */
export default abstract class BasicParser<C = any> {
    protected _parser: any;
    parse(input: string, errorListener?: ErrorHandler): any;
    validate(input: string): ParserError[];
    /**
     * Create antrl4 Lexer object
     * @param input source string
     */
    abstract createLexer(input: string): Lexer;
    /**
     * Create Parser by lexer
     * @param lexer Lexer
     */
    abstract createParserFromLexer(lexer: Lexer): any;
    /**
     * Visit parser tree
     * @param parserTree
     */
    /**
     * The source string
     * @param input string
     */
    getAllTokens(input: string): Token[];
    /**
     * Get Parser instance by input string
     * @param input
     */
    createParser(input: string): any;
    /**
     * It convert tree to string, it's convenient to use in unit test.
     * @param string input
     */
    parserTreeToString(input: string): string;
    /**
     * Get List-like style tree string
     * @param parserTree
     */
    toString(parserTree: any): string;
    /**
     * @param listener Listener instance extends ParserListener
     * @param parserTree parser Tree
     */
    listen(listener: any, parserTree: any): void;
}
