From 150ca63ccd1a62c1c86972dae166460684b0d842 Mon Sep 17 00:00:00 2001 From: kpouer Date: Mon, 7 Apr 2003 09:01:38 +0000 Subject: [PATCH 1/1] A Global declaration --- .../compiler/parser/PHPGlobalDeclaration.java | 48 ++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-) create mode 100644 net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/PHPGlobalDeclaration.java diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/PHPGlobalDeclaration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/PHPGlobalDeclaration.java new file mode 100644 index 0000000..1ad7870 --- /dev/null +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/PHPGlobalDeclaration.java @@ -0,0 +1,48 @@ +package net.sourceforge.phpdt.internal.compiler.parser; + +import net.sourceforge.phpdt.internal.ui.PHPUiImages; + +import org.eclipse.jface.resource.ImageDescriptor; + +/** + * A require, require_once, include or include_once declaration strongly inspired by the PHPFunctionDeclaration of Khartlage (:. + * @author khartlage, Matthieu Casanova + */ +public class PHPGlobalDeclaration extends PHPSegment { + + /** What is required/included. */ + private String value; + /** + * Create an include declaration. + * @param parent the parent object (it should be a php class or function) + * @param name it should be require, require_once, include or include_once + * @param index where the keyword is in the file + * @param value what is included + */ + public PHPGlobalDeclaration(Object parent, String name, int index, String value) { + super(parent, name, index); + this.value = value; + } + + /** + * Create an include declaration. + * @param parent the parent object (it should be a php class or function) + * @param name it should be require, require_once, include or include_once + * @param index where the keyword is in the file + */ + public PHPGlobalDeclaration(Object parent, String name, int index) { + this(parent, name, index,null); + } + + /** + * Get the image of a variable. + * @return the image that represents a php variable + */ + public ImageDescriptor getImage() { + return PHPUiImages.DESC_INC; + } + + public String toString() { + return name + " : " + value; + } +} -- 1.7.1