1 package net.sourceforge.phpdt.internal.compiler.ast;
4 * It will be the mother of our own ast tree for php just like the ast tree of Eclipse.
5 * @author Matthieu Casanova
7 public abstract class AstNode {
9 /** Starting and ending position of the node in the sources. */
10 public int sourceStart, sourceEnd;
13 * Create a node giving starting and ending offset
14 * @param sourceStart starting offset
15 * @param sourceEnd ending offset
17 public AstNode(int sourceStart, int sourceEnd) {
18 this.sourceStart = sourceStart;
19 this.sourceEnd = sourceEnd;
23 * Add some tabulations.
24 * @param tab the number of tabulations
25 * @return a String containing some spaces
27 public static String tabString(int tab) {
28 StringBuffer s = new StringBuffer();
29 for (int i = tab; i > 0; i--)
30 s.append(" "); //$NON-NLS-1$
35 * Return the object into String.
36 * It should be overriden
39 public String toString() {
40 return "****" + super.toString() + "****"; //$NON-NLS-2$ //$NON-NLS-1$
44 * Return the object into String.
45 * @param tab how many tabs (not used here
48 public abstract String toString(int tab);