Class RewriteRuleNodeStream


  • public class RewriteRuleNodeStream
    extends RewriteRuleElementStream
    Queues up nodes matched on left side of -> in a tree parser. This is the analog of RewriteRuleTokenStream for normal parsers.
    • Constructor Detail

      • RewriteRuleNodeStream

        public RewriteRuleNodeStream​(TreeAdaptor adaptor,
                                     String elementDescription)
      • RewriteRuleNodeStream

        public RewriteRuleNodeStream​(TreeAdaptor adaptor,
                                     String elementDescription,
                                     Object oneElement)
        Create a stream with one element
      • RewriteRuleNodeStream

        public RewriteRuleNodeStream​(TreeAdaptor adaptor,
                                     String elementDescription,
                                     List<Object> elements)
        Create a stream, but feed off an existing list
    • Method Detail

      • nextNode

        public Object nextNode()
      • dup

        protected Object dup​(Object el)
        Description copied from class: RewriteRuleElementStream
        When constructing trees, sometimes we need to dup a token or AST subtree. Dup'ing a token means just creating another AST node around it. For trees, you must call the adaptor.dupTree() unless the element is for a tree root; then it must be a node dup.
        Specified by:
        dup in class RewriteRuleElementStream