First try for AST structure. A lot of things to change
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / HTMLBlock.java
1 package net.sourceforge.phpdt.internal.compiler.ast;
2
3 /**
4  * @author Matthieu Casanova
5  */
6 public class HTMLBlock extends Statement {
7
8   public AstNode[] nodes;
9
10   public HTMLBlock(AstNode[] nodes) {
11     super(nodes[0].sourceStart, nodes[nodes.length-1].sourceEnd);
12     this.nodes = nodes;
13   }
14
15   /**
16    * Return the object into String.
17    * @param tab how many tabs (not used here
18    * @return a String
19    */
20   public String toString(int tab) {
21     final StringBuffer buff = new StringBuffer(tabString(tab));
22     buff.append("?>");
23     for (int i = 0; i < nodes.length; i++) {
24       AstNode node = nodes[i];
25       buff.append(node.toString(tab +1));
26     }
27     buff.append("<?php\n");
28     return buff.toString();
29   }
30 }