--- /dev/null
+/*
+ * Created on 28.04.2003
+ *
+ */
+package net.sourceforge.phpeclipse.phpeditor.php;
+
+import org.eclipse.jface.text.*;
+
+/**
+ * @author slanger
+ * @version $Revision: 1.1 $
+ */
+public class PHPPartition extends Partition
+{
+ private boolean fShortTagsEnabled = true;
+
+ /**
+ * @param document
+ * @param delim
+ * @param contentType
+ * @param parentPartition
+ */
+ public PHPPartition(IDocument document, String parentPartition)
+ {
+ super(
+ document,
+ new char[] { '<', '>' },
+ IPHPPartitionScannerConstants.PHP,
+ parentPartition);
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see net.sourceforge.phpeclipse.phpeditor.php.Partition#allowedPartition(java.lang.String)
+ */
+ protected boolean allowedPartition(String type)
+ {
+ if(type.equals(IPHPPartitionScannerConstants.PHP_MULTILINE_COMMENT))
+ return true;
+
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see net.sourceforge.phpeclipse.phpeditor.php.Partition#scan()
+ */
+ protected boolean scan()
+ {
+ int ch;
+ if(fShortTagsEnabled && checkPattern("<?", true))
+ {
+ scanToEnd();
+ }
+ else if(checkPattern("<?php", false))
+ {
+ scanToEnd();
+ }
+ else
+ return false;
+
+ return true;
+ }
+
+ private void scanToEnd()
+ {
+ if(isEnd())
+ return;
+
+ while(!checkPattern("?>", true))
+ {
+ int offset = getOffset();
+ if(checkPattern("/*", true))
+ {
+ unread(2);
+ return;
+ }
+ }
+ }
+}