1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpeclipse.internal.compiler.ast;
13 import net.sourceforge.phpdt.internal.compiler.IAbstractSyntaxTreeVisitor;
14 import net.sourceforge.phpdt.internal.compiler.lookup.CompilationUnitScope;
16 public class ImportReference extends ASTNode {
18 // public char[][] tokens;
19 // public long[] sourcePositions; //each entry is using the code : (start<<32) + end
20 public boolean onDemand = true; //most of the time
21 public final char[] includeSource;
22 public int declarationEnd;// doesn't include an potential trailing comment
23 public int declarationSourceStart;
24 public int declarationSourceEnd;
27 public ImportReference(char[] sourceString, int start, int end, boolean d) { // char[][] sources , long[] poss , boolean d) {
29 // sourcePositions = poss ;
30 includeSource = sourceString;
32 sourceEnd = end;//(int)(sourcePositions[sourcePositions.length-1] & 0x00000000FFFFFFFF);
33 sourceStart = start;//(int)(sourcePositions[0]>>>32) ;
38 //public char[][] getImportName() {
42 public char[] getIncludeName() {
45 public String toString(int tab ){
47 return toString(tab,true);
49 public String toString(int tab, boolean withOnDemand) {
50 /* when withOnDemand is false, only the name is printed */
51 // StringBuffer buffer = new StringBuffer();
52 // for (int i = 0; i < tokens.length; i++) {
53 // buffer.append(tokens[i]);
54 // if (i < (tokens.length - 1)) {
55 // buffer.append("."); //$NON-NLS-1$
58 // if (withOnDemand && onDemand) {
59 // buffer.append(".*"); //$NON-NLS-1$
61 // return buffer.toString();
62 return new String(includeSource);
64 public void traverse(IAbstractSyntaxTreeVisitor visitor, CompilationUnitScope scope) {
65 visitor.visit(this, scope);
66 visitor.endVisit(this, scope);