Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2893_BNLR/HeuristicLab.ExtLibs/HeuristicLab.AvalonEdit/5.0.1/AvalonEdit-5.0.1/Highlighting/Resources/PHP-Mode.xshd

Last change on this file was 11700, checked in by jkarder, 10 years ago

#2077: created branch and added first version

File size: 4.5 KB
Line 
1<?xml version="1.0"?>
2<!-- syntaxdefinition for PHP 2001 by Chad Smith & Mike Krueger -->
3<!-- converted to AvalonEdit format by Siegfried Pammer in 2010 -->
4<SyntaxDefinition name ="PHP" extensions = ".php" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
5  <Color name="Comment" foreground="Green" exampleText="// comment" />
6  <Color name="String" foreground="Blue" exampleText="$text = &quot;Hello, World!&quot;" />
7  <Color name="NumberLiteral" foreground="DarkBlue" exampleText="3.1415" />
8  <Color name="Punctuation" foreground="DarkGreen" exampleText="a(b + c)" />
9  <Color name="FunctionCall" foreground="MidnightBlue" fontWeight="bold" exampleText="abs(num);"/>
10  <Color name="AccessKeywords" foreground="Black" fontWeight="bold" exampleText="global $database;" />
11  <Color name="OperatorKeywords" foreground="DarkCyan" fontWeight="bold" exampleText="if (x === false and y === false) { }" />
12  <Color name="SelectionStatements" foreground="Blue" fontWeight="bold" exampleText="if (true) { } else { }" />
13  <Color name="IterationStatements" foreground="Blue" fontWeight="bold" exampleText="while (true) { }" />
14  <Color name="JumpStatements" foreground="Navy" fontWeight="bold" exampleText="if (x == 5) continue;" />
15  <Color name="ControlStatements" foreground="Teal" fontWeight="bold" exampleText="include(&quot;test.php&quot;);" />
16  <Color name="ValueTypes" foreground="Red" fontWeight="bold" exampleText="int test = 5;" />
17  <Color name="OtherTypes" foreground="Red" exampleText="object test = null;" />
18  <Color name="AccessModifiers" foreground="Blue" fontWeight="bold" exampleText="public function test() {}" />
19  <RuleSet>
20    <Span color="Comment">
21      <Begin>\#</Begin>
22    </Span>
23   
24    <Span color="Comment">
25      <Begin>//</Begin>
26    </Span>
27   
28    <Span color="Comment" multiline="true">
29      <Begin>/\*</Begin>
30      <End>\*/</End>
31    </Span>
32   
33    <!-- Digits -->
34    <Rule color="NumberLiteral">
35      \b0[xX][0-9a-fA-F]+  # hex number
36    |
37      \b0[0-9]+ # octal number
38    |
39      ( \b\d+(\.[0-9]+)?   #number with optional floating point
40      | \.[0-9]+           #or just starting with floating point
41      )
42      ([eE][+-]?[0-9]+)? # optional exponent
43    </Rule>
44   
45    <Rule color="Punctuation">
46      [?,.:;()\[\]{}+\-/%*&lt;&gt;&amp;^!|~@]+
47    </Rule>
48   
49    <!-- Mark previous rule-->
50    <Rule color="FunctionCall">
51    \b
52    [\d\w_]+  # an identifier
53    (?=\s*\() # followed by (
54    </Rule>
55   
56    <Span color="String" multiline="true">
57      <Begin>'</Begin>
58      <End>'</End>
59      <RuleSet>
60        <!-- span for escape sequences -->
61        <Span begin="\\" end="."/>
62      </RuleSet>
63    </Span>
64   
65    <Span color="String" multiline="true">
66      <Begin>"</Begin>
67      <End>"</End>
68      <RuleSet>
69        <!-- span for escape sequences -->
70        <Span begin="\\" end="."/>
71      </RuleSet>
72    </Span>
73   
74    <!-- heredoc syntax -->
75    <Span color="String" multiline="true">
76      <Begin>&lt;&lt;&lt;\"?[\d\w_]+\"?$</Begin>
77      <End>^[\d\w_]+;</End>
78    </Span>
79 
80    <!-- nowdoc syntax -->
81    <Span color="String" multiline="true">
82      <Begin>&lt;&lt;&lt;\'[\d\w_]+\'$</Begin>
83      <End>^[\d\w_]+;</End>
84    </Span>
85 
86    <Keywords color="AccessKeywords">
87      <Word>global</Word>
88      <Word>my</Word>
89      <Word>var</Word>
90    </Keywords>
91   
92    <Keywords color="OperatorKeywords">
93      <Word>and</Word>
94      <Word>or</Word>
95      <Word>new</Word>
96      <Word>clone</Word>
97      <Word>instanceof</Word>
98      <Word>xor</Word>
99      <Word>true</Word>
100      <Word>false</Word>
101    </Keywords>
102 
103    <Keywords color="SelectionStatements">
104      <Word>else</Word>
105      <Word>else</Word>
106      <Word>switch</Word>
107      <Word>case</Word>
108      <Word>endif</Word>
109      <Word>elseif</Word>
110    </Keywords>
111 
112    <Keywords color="IterationStatements">
113      <Word>do</Word>
114      <Word>for</Word>
115      <Word>foreach</Word>
116      <Word>while</Word>
117      <Word>endwhile</Word>
118      <Word>exit</Word>
119    </Keywords>
120 
121    <Keywords color="JumpStatements">
122      <Word>break</Word>
123      <Word>continue</Word>
124      <Word>default</Word>
125      <Word>goto</Word>
126      <Word>return</Word>
127    </Keywords>
128 
129    <Keywords color="ControlStatements">
130      <Word>require</Word>
131      <Word>include</Word>
132      <Word>require</Word>
133      <Word>include</Word>
134      <Word>function</Word>
135    </Keywords>
136 
137    <Keywords color="ValueTypes">
138      <Word>int</Word>
139      <Word>integer</Word>
140      <Word>real</Word>
141      <Word>double</Word>
142      <Word>float</Word>
143      <Word>string</Word>
144      <Word>array</Word>
145      <Word>object</Word>
146    </Keywords>
147 
148    <Keywords color="OtherTypes">
149      <Word>class</Word>
150      <Word>void</Word>
151    </Keywords>
152 
153    <Keywords color="AccessModifiers">
154      <Word>public</Word>
155      <Word>private</Word>
156    </Keywords>
157  </RuleSet>
158</SyntaxDefinition>
Note: See TracBrowser for help on using the repository browser.