Class AbstractGssParser

  • Direct Known Subclasses:
    GssParser

    public abstract class AbstractGssParser
    extends java.lang.Object
    Base parser implementation that delegates management of the underlying JavaCC parser to the subclass. This class does not expose any public methods; subclasses should expose an appropriate interface.
    See Also:
    GssParser
    • Field Detail

    • Constructor Detail

      • AbstractGssParser

        public AbstractGssParser()
    • Method Detail

      • parseInternal

        protected final AbstractGssParser.ParseResult parseInternal​(java.util.List<SourceCode> sources,
                                                                    boolean errorHandling)
                                                             throws GssParserException
        Parses a list of GSS sources. Subclasses should use this method to do the actual parsing of SourceCode objects. It will in turn call the subclass's implementation of getParser() as necessary.
        Parameters:
        sources - a list of GSS SourceCode objects to parse
        errorHandling - if error handling should be enabled. If this is false, no GssParserExceptions will be returned in the result.
        Returns:
        ParseResult the result containing the CssTree and parsing errors
        Throws:
        GssParserException
      • getParser

        protected abstract GssParserCC getParser()
        Implementations must return an empty GssParserCC object. Whether this object is actually new or not isn't important which allows pooling.