title: How to Display ANTLR Tree GUI
body: <p>How do you display the AST GUI if you have code like this, both of console or swing?
  My ANTLR is version 3.</p>
  
  <pre><code>CharStream stream = new ANTLRStringStream("program XLSample1 =\n" + 
              "constant one : Integer := 1;\n" + 
              "constant two : Integer := 2;\n" + 
              "var a, b,c : Integer := 42;\n" + 
              "begin\n" + 
              " x:= (12 + 6) - (7 * 41) - x mod y;\n" + 
              " y := 21;\n" + 
              "\n" + 
              "if x &lt; 10 then\n" + 
              "  y :=2;\n" + 
              "  elseif x &lt; 20 then\n" + 
              "  y := 20;\n" + 
              "  else\n" + 
              "  y := 30;\n" + 
              "end if; \n" + 
              "end XLSample1.");
      SampleLexer lexer  = new SampleLexer(stream);   
      TokenStream tokenStream = new CommonTokenStream(lexer);
      SampleParser parser = new SampleParser(tokenStream);
      parser.program();       
      System.out.println("OK");       
  }
  </code></pre>