Class AntlrBaseParser<N extends AntlrNode<N>,​R extends BaseAntlrInnerNode<N> & RootNode>

  • Type Parameters:
    N - Supertype of all nodes for the language, eg SwiftNode
    R - Type of the root node
    All Implemented Interfaces:
    Parser

    public abstract class AntlrBaseParser<N extends AntlrNode<N>,​R extends BaseAntlrInnerNode<N> & RootNode>
    extends Object
    implements Parser
    Generic Antlr parser adapter for all Antlr parsers. This wraps a parser generated by antlr, soo AntlrGeneratedParserBase.
    • Constructor Detail

      • AntlrBaseParser

        public AntlrBaseParser()
    • Method Detail

      • parse

        public R parse​(Parser.ParserTask task)
                throws ParseException
        Description copied from interface: Parser
        Parses an entire tree for this language. This may perform some semantic analysis, like name resolution.
        Specified by:
        parse in interface Parser
        Parameters:
        task - Description of the parsing task
        Returns:
        The root of the tree corresponding to the source code.
        Throws:
        ParseException
      • parse

        protected abstract R parse​(org.antlr.v4.runtime.Lexer parser,
                                   Parser.ParserTask task)
      • getLexer

        protected abstract org.antlr.v4.runtime.Lexer getLexer​(org.antlr.v4.runtime.CharStream source)