<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language _name="PHP" version="1.0" _section="Scripts" mimetypes="application/x-php">

<!--  FIXME: keywords before a '(' is hightlined as a function call instead of a keyword -->

	<escape-char>\</escape-char>

	<!-- // C++ Line Comment -->
	<line-comment _name = "C++ Line Comment" style= "Comment">
		<start-regex>//</start-regex>
	</line-comment>
	
	<!-- # Bourne Shell Line Comment  -->
	<line-comment _name = "Bash Line Comment" style= "Comment">
		<start-regex>#</start-regex>
	</line-comment>
	
	<!-- /* C Block Comment */ -->
	<block-comment _name = "C Block Comment" style = "Comment">
		<start-regex>/\*</start-regex>
        	<end-regex>\*/</end-regex>
	</block-comment>

	<!-- <? ?> <HTML> inside PHP <? -->
	<pattern-item _name = "First Open PHP Tag" style = "Others">
		<regex>&lt;(%|[?](php)?)</regex>	
	</pattern-item>
	<block-comment _name = "HTML Block" style = "Others">	
		<start-regex>[%?]&gt;</start-regex>
        	<end-regex>&lt;(%|[?](php)?)</end-regex>
	</block-comment>

	<!-- "duble-quoted strings" -->
	<string _name = "Double Quoted String" style = "String" end-at-line-end = "FALSE">
		<start-regex>&quot;</start-regex>
		<end-regex>&quot;</end-regex>
	</string>

	<!-- 'single-quoted strings' -->
	<string _name = "Single Quoted String" style = "String" end-at-line-end = "FALSE">
		<start-regex>&apos;</start-regex>
		<end-regex>&apos;</end-regex>
	</string>

	<!-- `backticks-quoted strings` -->
	<string _name = "Backtick String" style = "String" end-at-line-end = "FALSE">
		<start-regex>`</start-regex>
		<end-regex>`</end-regex>
	</string>

	<!-- $variable, $$dynamic-variable and even $$$more -->
	<pattern-item _name = "Variable" style = "Data Type">
		<regex>[$]+[a-zA-Z_][a-zA-Z0-9_]*</regex>
	</pattern-item>
	<pattern-item _name = "Array Operators" style ="Data Type">
		<regex>(\[|\])</regex>
	</pattern-item>
	
        <!-- function (Call|Definition) ($whatever::$whatelse) even call::objects -->
	<!--
	<pattern-item name = "Open Function" style = "Function">
		<regex>([a-zA-Z0-9_]+::)?[a-zA-Z0-9_]*[ ]*[({]+</regex>
	</pattern-item>
	<pattern-item name = "Close Function" style = "Function">
		<regex>[)}]+</regex>
	</pattern-item>
	-->

 	<!-- This are keywords, the are recognised by php -->
	<keyword-list _name = "Case Sensitive Keyword" style = "Keyword" case-sensitive="TRUE">
		<keyword>abstract</keyword>
		<keyword>and</keyword>
		<keyword>as</keyword>
		<keyword>break</keyword>
		<keyword>case</keyword>
		<keyword>catch</keyword>
		<keyword>class</keyword>
		<keyword>const</keyword>
		<keyword>continue</keyword>
		<keyword>default</keyword>
		<keyword>die</keyword>
		<keyword>do</keyword>
		<keyword>doubleval</keyword>
		<keyword>echo</keyword>
		<keyword>else</keyword>
		<keyword>elseif</keyword>
		<keyword>empty</keyword>
		<keyword>endfor</keyword>
		<keyword>endforeach</keyword>
		<keyword>endswitch</keyword>
		<keyword>endwhile</keyword>
		<keyword>extends</keyword>
		<keyword>implements</keyword>
		<keyword>final</keyword>
		<keyword>floatval</keyword>
		<keyword>for</keyword>
		<keyword>gettype</keyword>
		<keyword>global</keyword>
		<keyword>function</keyword>
		<keyword>foreach</keyword>
		<keyword>if</keyword>
		<keyword>import</keyword>
		<keyword>include</keyword>
		<keyword>include_once</keyword>
		<keyword>instanceof</keyword>		
		<keyword>interface</keyword>
		<keyword>intval</keyword>
		<keyword>isset</keyword>
		<keyword>list</keyword>
		<keyword>namespace</keyword>
		<keyword>new</keyword>
		<keyword>or</keyword>
		<keyword>print</keyword>
		<keyword>print_r</keyword>
		<keyword>private</keyword>
		<keyword>protected</keyword>
		<keyword>public</keyword>
		<keyword>require</keyword>
		<keyword>require_once</keyword>
		<keyword>return</keyword>
		<keyword>serialize</keyword>
		<keyword>settype</keyword>
		<keyword>static</keyword>
		<keyword>strval</keyword>
		<keyword>switch</keyword>
		<keyword>throw</keyword>
		<keyword>try</keyword>
		<keyword>unserialize</keyword>
		<keyword>unset</keyword>
		<keyword>var</keyword>
		<keyword>var_dump</keyword>
		<keyword>var_export</keyword>
		<keyword>while</keyword>
		<keyword>xor</keyword>
	</keyword-list>
	<keyword-list _name = "Case Insensitive Keyword" style = "Keyword" case-sensitive="FALSE">
		<keyword>true</keyword>	
		<keyword>false</keyword>
		<keyword>null</keyword>
	</keyword-list>
	<pattern-item _name = "Operators" style = "Keyword">
		<regex>[-.~^@;:/%|\=\+\*\!\?&amp;&lt;&gt;]</regex>
	</pattern-item>
	
	<!-- $this = (datatype) -->
	<keyword-list _name= "Data Type" style = "Data Type">
		<keyword>array</keyword>
		<keyword>bool</keyword>
		<keyword>boolean</keyword>
		<keyword>double</keyword>
		<keyword>float</keyword>
		<keyword>int</keyword>
		<keyword>integer</keyword>
		<keyword>object</keyword>
		<keyword>real</keyword>
		<keyword>string</keyword>
		<keyword>unset</keyword>
	</keyword-list>

</language>
