1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21:
22:
23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33:
34: class Text_Highlighter_VBSCRIPT extends Text_Highlighter
35: {
36: var $_language = 'vbscript';
37:
38: 39: 40: 41: 42: 43:
44: function __construct($options=array())
45: {
46:
47: $this->_options = $options;
48: $this->_regs = array (
49: -1 => '/((?i)\\()|((?i)")|((?i)\'|[Rr][Ee][Mm]\\b)|((?i)\\d*\\.?\\d+)|((?i)&H[0-9a-fA-F]+)|((?i)[a-z_]\\w*)/',
50: 0 => '/((?i)\\()|((?i)")|((?i)\'|[Rr][Ee][Mm]\\b)|((?i)\\d*\\.?\\d+)|((?i)&H[0-9a-fA-F]+)|((?i)[a-z_]\\w*)/',
51: 1 => '//',
52: 2 => '/((?i)((https?|ftp):\\/\\/[\\w\\?\\.\\-\\&=\\/%+]+)|(^|[\\s,!?])www\\.\\w+\\.\\w+[\\w\\?\\.\\&=\\/%+]*)|((?i)\\w+[\\.\\w\\-]+@(\\w+[\\.\\w\\-])+)|((?i)\\b(note|fixme):)|((?i)\\$\\w+:.+\\$)/',
53: );
54: $this->_counts = array (
55: -1 =>
56: array (
57: 0 => 0,
58: 1 => 0,
59: 2 => 0,
60: 3 => 0,
61: 4 => 0,
62: 5 => 0,
63: ),
64: 0 =>
65: array (
66: 0 => 0,
67: 1 => 0,
68: 2 => 0,
69: 3 => 0,
70: 4 => 0,
71: 5 => 0,
72: ),
73: 1 =>
74: array (
75: ),
76: 2 =>
77: array (
78: 0 => 3,
79: 1 => 1,
80: 2 => 1,
81: 3 => 0,
82: ),
83: );
84: $this->_delim = array (
85: -1 =>
86: array (
87: 0 => 'brackets',
88: 1 => 'quotes',
89: 2 => 'comment',
90: 3 => '',
91: 4 => '',
92: 5 => '',
93: ),
94: 0 =>
95: array (
96: 0 => 'brackets',
97: 1 => 'quotes',
98: 2 => 'comment',
99: 3 => '',
100: 4 => '',
101: 5 => '',
102: ),
103: 1 =>
104: array (
105: ),
106: 2 =>
107: array (
108: 0 => '',
109: 1 => '',
110: 2 => '',
111: 3 => '',
112: ),
113: );
114: $this->_inner = array (
115: -1 =>
116: array (
117: 0 => 'code',
118: 1 => 'string',
119: 2 => 'comment',
120: 3 => 'number',
121: 4 => 'number',
122: 5 => 'identifier',
123: ),
124: 0 =>
125: array (
126: 0 => 'code',
127: 1 => 'string',
128: 2 => 'comment',
129: 3 => 'number',
130: 4 => 'number',
131: 5 => 'identifier',
132: ),
133: 1 =>
134: array (
135: ),
136: 2 =>
137: array (
138: 0 => 'url',
139: 1 => 'url',
140: 2 => 'inlinedoc',
141: 3 => 'inlinedoc',
142: ),
143: );
144: $this->_end = array (
145: 0 => '/(?i)\\)/',
146: 1 => '/(?i)"/',
147: 2 => '/(?mi)$/',
148: );
149: $this->_states = array (
150: -1 =>
151: array (
152: 0 => 0,
153: 1 => 1,
154: 2 => 2,
155: 3 => -1,
156: 4 => -1,
157: 5 => -1,
158: ),
159: 0 =>
160: array (
161: 0 => 0,
162: 1 => 1,
163: 2 => 2,
164: 3 => -1,
165: 4 => -1,
166: 5 => -1,
167: ),
168: 1 =>
169: array (
170: ),
171: 2 =>
172: array (
173: 0 => -1,
174: 1 => -1,
175: 2 => -1,
176: 3 => -1,
177: ),
178: );
179: $this->_keywords = array (
180: -1 =>
181: array (
182: 0 => -1,
183: 1 => -1,
184: 2 => -1,
185: 3 =>
186: array (
187: ),
188: 4 =>
189: array (
190: ),
191: 5 =>
192: array (
193: 'constants' => '/^((?i)vbblack|vbred|vbgreen|vbyellow|vbblue|vbmagenta|vbcyan|vbwhite|vbbinarycompare|vbtextcompare|vbsunday|vbmonday|vbtuesday|vbwednesday|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbokonly|vbokcancel|vbabortretryignore|vbyesnocancel|vbyesno|vbretrycancel|vbcritical|vbquestion|vbexclamation|vbinformation|vbdefaultbutton1|vbdefaultbutton2|vbdefaultbutton3|vbdefaultbutton4|vbapplicationmodal|vbsystemmodal|vbok|vbcancel|vbabort|vbretry|vbignore|vbyes|vbno|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|vbtab|vbverticaltab|vbusedefault|vbtrue|vbfalse|vbempty|vbnull|vbinteger|vblong|vbsingle|vbdouble|vbcurrency|vbdate|vbstring|vbobject|vberror|vbboolean|vbvariant|vbdataobject|vbdecimal|vbbyte|vbarray)$/',
194: 'functions' => '/^((?i)abs|array|asc|atn|cbool|cbyte|ccur|cdate|cdbl|chr|cint|clng|cos|createobject|csng|cstr|date|dateadd|datediff|datepart|dateserial|datevalue|day|escape|eval|exp|filter|formatcurrency|formatdatetime|formatnumber|formatpercent|getlocale|getobject|getref|hex|hour|inputbox|instr|instrrev|int|fix|isarray|isdate|isempty|isnull|isnumeric|isobject|join|lbound|lcase|left|len|loadpicture|log|ltrim|rtrim|trim|mid|minute|month|monthname|msgbox|now|oct|replace|rgb|right|rnd|round|scriptengine|scriptenginebuildversion|scriptenginemajorversion|scriptengineminorversion|second|setlocale|sgn|sin|space|split|sqr|strcomp|string|strreverse|tan|time|timer|timeserial|timevalue|typename|ubound|ucase|unescape|vartype|weekday|weekdayname|year)$/',
195: 'builtin' => '/^((?i)debug|err|match|regexp)$/',
196: 'reserved' => '/^((?i)empty|false|nothing|null|true|and|eqv|imp|is|mod|not|or|xor|call|class|end|const|public|private|dim|do|while|until|exit|loop|erase|execute|executeglobal|for|each|in|to|step|next|function|default|if|then|else|elseif|on|error|resume|goto|option|explicit|property|get|let|set|randomize|redim|preserve|select|case|stop|sub|wend|with)$/',
197: ),
198: ),
199: 0 =>
200: array (
201: 0 => -1,
202: 1 => -1,
203: 2 => -1,
204: 3 =>
205: array (
206: ),
207: 4 =>
208: array (
209: ),
210: 5 =>
211: array (
212: 'constants' => '/^((?i)vbblack|vbred|vbgreen|vbyellow|vbblue|vbmagenta|vbcyan|vbwhite|vbbinarycompare|vbtextcompare|vbsunday|vbmonday|vbtuesday|vbwednesday|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbokonly|vbokcancel|vbabortretryignore|vbyesnocancel|vbyesno|vbretrycancel|vbcritical|vbquestion|vbexclamation|vbinformation|vbdefaultbutton1|vbdefaultbutton2|vbdefaultbutton3|vbdefaultbutton4|vbapplicationmodal|vbsystemmodal|vbok|vbcancel|vbabort|vbretry|vbignore|vbyes|vbno|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|vbtab|vbverticaltab|vbusedefault|vbtrue|vbfalse|vbempty|vbnull|vbinteger|vblong|vbsingle|vbdouble|vbcurrency|vbdate|vbstring|vbobject|vberror|vbboolean|vbvariant|vbdataobject|vbdecimal|vbbyte|vbarray)$/',
213: 'functions' => '/^((?i)abs|array|asc|atn|cbool|cbyte|ccur|cdate|cdbl|chr|cint|clng|cos|createobject|csng|cstr|date|dateadd|datediff|datepart|dateserial|datevalue|day|escape|eval|exp|filter|formatcurrency|formatdatetime|formatnumber|formatpercent|getlocale|getobject|getref|hex|hour|inputbox|instr|instrrev|int|fix|isarray|isdate|isempty|isnull|isnumeric|isobject|join|lbound|lcase|left|len|loadpicture|log|ltrim|rtrim|trim|mid|minute|month|monthname|msgbox|now|oct|replace|rgb|right|rnd|round|scriptengine|scriptenginebuildversion|scriptenginemajorversion|scriptengineminorversion|second|setlocale|sgn|sin|space|split|sqr|strcomp|string|strreverse|tan|time|timer|timeserial|timevalue|typename|ubound|ucase|unescape|vartype|weekday|weekdayname|year)$/',
214: 'builtin' => '/^((?i)debug|err|match|regexp)$/',
215: 'reserved' => '/^((?i)empty|false|nothing|null|true|and|eqv|imp|is|mod|not|or|xor|call|class|end|const|public|private|dim|do|while|until|exit|loop|erase|execute|executeglobal|for|each|in|to|step|next|function|default|if|then|else|elseif|on|error|resume|goto|option|explicit|property|get|let|set|randomize|redim|preserve|select|case|stop|sub|wend|with)$/',
216: ),
217: ),
218: 1 =>
219: array (
220: ),
221: 2 =>
222: array (
223: 0 =>
224: array (
225: ),
226: 1 =>
227: array (
228: ),
229: 2 =>
230: array (
231: ),
232: 3 =>
233: array (
234: ),
235: ),
236: );
237: $this->_parts = array (
238: 0 =>
239: array (
240: 0 => NULL,
241: 1 => NULL,
242: 2 => NULL,
243: 3 => NULL,
244: 4 => NULL,
245: 5 => NULL,
246: ),
247: 1 =>
248: array (
249: ),
250: 2 =>
251: array (
252: 0 => NULL,
253: 1 => NULL,
254: 2 => NULL,
255: 3 => NULL,
256: ),
257: );
258: $this->_subst = array (
259: -1 =>
260: array (
261: 0 => false,
262: 1 => false,
263: 2 => false,
264: 3 => false,
265: 4 => false,
266: 5 => false,
267: ),
268: 0 =>
269: array (
270: 0 => false,
271: 1 => false,
272: 2 => false,
273: 3 => false,
274: 4 => false,
275: 5 => false,
276: ),
277: 1 =>
278: array (
279: ),
280: 2 =>
281: array (
282: 0 => false,
283: 1 => false,
284: 2 => false,
285: 3 => false,
286: ),
287: );
288: $this->_conditions = array (
289: );
290: $this->_kwmap = array (
291: 'constants' => 'builtin',
292: 'functions' => 'builtin',
293: 'builtin' => 'builtin',
294: 'reserved' => 'reserved',
295: );
296: $this->_defClass = 'code';
297: $this->_checkDefines();
298: }
299:
300: }