Package org.jboss.forge.shell.plugins

Examples of org.jboss.forge.shell.plugins.PipeOut


   public void run(final Node startNode, final PipeOut forwardPipe)
   {
      AutoReducingQueue arQueue;
      Node n = startNode;
      PipeOut lastPipe = null;

      do
      {
         if (n instanceof LogicalStatement)
         {
            arQueue = new AutoReducingQueue(((LogicalStatement) n).getNest(), this);
         }
         else if (n instanceof PipeNode)
         {
            if (lastPipe == null)
            {
               throw new RuntimeException("broken pipe");
            }

            run(((PipeNode) n).getNest(), lastPipe);
            continue;
         }
         else
         {
            throw new RuntimeException("badly formed stack:" + n);
         }

         Queue<String> outQueue = new LinkedList<String>();
         for (String s : arQueue)
         {
            if (s == null || s.equals(""))
            {
               continue;
            }
            outQueue.add(s);
         }

         if (!outQueue.isEmpty())
         {
            PipeOut pipeOut = new PipeOutImpl(shell);

            if (n.next != null && n.next instanceof PipeNode)
            {
               pipeOut.setPiped(true);
               lastPipe = pipeOut;
            }

            Node x = n;
            while (x instanceof LogicalStatement && (x = ((LogicalStatement) x).nest) != null)
View Full Code Here


   public void run(final Node startNode, final PipeOut forwardPipe)
   {
      AutoReducingQueue arQueue;
      Node n = startNode;
      PipeOut lastPipe = null;

      do
      {
         if (n instanceof LogicalStatement)
         {
            arQueue = new AutoReducingQueue(((LogicalStatement) n).getNest(), this);
         }
         else if (n instanceof PipeNode)
         {
            if (lastPipe == null)
            {
               throw new RuntimeException("broken pipe");
            }

            run(((PipeNode) n).getNest(), lastPipe);
            continue;
         }
         else
         {
            throw new RuntimeException("badly formed stack:" + n);
         }

         Queue<String> outQueue = new LinkedList<String>();
         for (String s : arQueue)
         {
            if (s == null || s.equals(""))
            {
               continue;
            }
            outQueue.add(s);
         }

         if (!outQueue.isEmpty())
         {
            PipeOut pipeOut = new PipeOutImpl(shell);

            if (n.next != null && n.next instanceof PipeNode)
            {
               pipeOut.setPiped(true);
               lastPipe = pipeOut;
            }

            Node x = n;
            while (x instanceof LogicalStatement && (x = ((LogicalStatement) x).nest) != null)
View Full Code Here

TOP

Related Classes of org.jboss.forge.shell.plugins.PipeOut

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.