Class GrammarObjectBuilder<T>

  • All Implemented Interfaces:
    ca.uqac.lif.bullwinkle.ParseNodeVisitor
    Direct Known Subclasses:
    GroupProcessorBuilder

    public class GrammarObjectBuilder<T>
    extends ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder<T>
    • Nested Class Summary

      • Nested classes/interfaces inherited from class ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder

        ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder.BuildException, ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder.MethodAnnotation
      • Nested classes/interfaces inherited from interface ca.uqac.lif.bullwinkle.ParseNodeVisitor

        ca.uqac.lif.bullwinkle.ParseNodeVisitor.VisitException
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ca.uqac.lif.bullwinkle.BnfParser m_parser
      The parser used to parse expressions
      • Fields inherited from class ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder

        m_builtObject, m_methods, m_stack
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T build​(java.lang.String expression)
      Builds an object from an expression
      GrammarObjectBuilder<T> setGrammar​(java.io.InputStream is)  
      GrammarObjectBuilder<T> setGrammar​(java.lang.String grammar)  
      • Methods inherited from class ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder

        build, fillMethods, getParents, handleNode, pop, postVisit, preVisit, visit
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_parser

        protected ca.uqac.lif.bullwinkle.BnfParser m_parser
        The parser used to parse expressions
    • Constructor Detail

      • GrammarObjectBuilder

        public GrammarObjectBuilder()
    • Method Detail

      • setGrammar

        public GrammarObjectBuilder<T> setGrammar​(java.io.InputStream is)
                                           throws ca.uqac.lif.bullwinkle.BnfParser.InvalidGrammarException
        Throws:
        ca.uqac.lif.bullwinkle.BnfParser.InvalidGrammarException
      • setGrammar

        public GrammarObjectBuilder<T> setGrammar​(java.lang.String grammar)
                                           throws ca.uqac.lif.bullwinkle.BnfParser.InvalidGrammarException
        Throws:
        ca.uqac.lif.bullwinkle.BnfParser.InvalidGrammarException
      • build

        public T build​(java.lang.String expression)
                throws ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder.BuildException
        Builds an object from an expression
        Parameters:
        expression - The expression to parse
        Returns:
        The returned object
        Throws:
        ca.uqac.lif.bullwinkle.ParseTreeObjectBuilder.BuildException - Thrown when no object could be built. This generally happens due to a parsing error.