Class AbstractGssParser

java.lang.Object
com.google.common.css.compiler.ast.AbstractGssParser
Direct Known Subclasses:
GssParser

public abstract class AbstractGssParser extends 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:
  • Field Details

  • Constructor Details

    • AbstractGssParser

      public AbstractGssParser()
  • Method Details

    • parseInternal

      protected final AbstractGssParser.ParseResult parseInternal(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.