3 class VbLanguage extends HyperLanguage {
4 public function __construct() {
7 parent::VERSION => '1.4',
8 parent::AUTHOR => array(
9 parent::NAME => 'Konrad Rudolph',
10 parent::WEBSITE => 'madrat.net',
11 parent::EMAIL => 'konrad_rudolph@madrat.net'
15 $this->setExtensions(array('vb'));
17 $this->setCaseInsensitive(true);
19 $this->addStates(array(
23 'comment' => array('', 'doc'),
24 'keyword' => array('', 'type', 'literal', 'operator', 'preprocessor'),
30 'string' => 'escaped',
31 'comment doc' => 'doc',
34 $this->addRules(array(
35 'whitespace' => Rule::ALL_WHITESPACE,
36 'operator' => '/[-+*\/\\\\^&.=,()<>{}]/',
37 'string' => new Rule('/"/', '/"c?/i'),
38 'number' => '/(?: # Integer followed by optional fractional part.
39 (?:&(?:H[0-9a-f]+|O[0-7]+)|\d+)
45 (?: # Just the fractional part.
54 'addhandler', 'addressof', 'alias', 'as', 'byref', 'byval',
55 'call', 'case', 'catch', 'cbool', 'cbyte', 'cchar',
56 'cdate', 'cdec', 'cdbl', 'cint', 'class', 'clng', 'cobj',
57 'const', 'continue', 'csbyte', 'cshort', 'csng', 'cstr',
58 'ctype', 'cuint', 'culng', 'cushort', 'declare', 'default',
59 'delegate', 'dim', 'directcast', 'do', 'each', 'else',
60 'elseif', 'end', 'endif', 'enum', 'erase', 'error',
61 'event', 'exit', 'finally', 'for', 'friend', 'function',
62 'get', 'gettype', 'getxmlnamespace', 'global', 'gosub',
63 'goto', 'handles', 'if', 'implements', 'imports', 'in',
64 'inherits', 'interface', 'let', 'lib', 'loop', 'module',
65 'mustinherit', 'mustoverride', 'namespace', 'narrowing',
66 'next', 'notinheritable', 'notoverridable', 'of', 'on',
67 'operator', 'option', 'optional', 'overloads',
68 'overridable', 'overrides', 'paramarray', 'partial',
69 'private', 'property', 'protected', 'public', 'raiseevent',
70 'readonly', 'redim', 'removehandler', 'resume', 'return',
71 'select', 'set', 'shadows', 'shared', 'static', 'step',
72 'stop', 'structure', 'sub', 'synclock', 'then', 'throw',
73 'to', 'try', 'trycast', 'wend', 'using', 'when', 'while',
74 'widening', 'with', 'withevents', 'writeonly'
77 'boolean', 'byte', 'char', 'date', 'decimal', 'double',
78 'long', 'integer', 'object', 'sbyte', 'short', 'single',
79 'string', 'variant', 'uinteger', 'ulong', 'ushort'
82 'false', 'me', 'mybase', 'myclass', 'nothing', 'true'
85 'and', 'andalso', 'is', 'isnot', 'like', 'mod', 'new',
86 'not', 'or', 'orelse', 'typeof', 'xor'
88 'preprocessor' => '/#(?:const|else|elseif|end if|end region|if|region)/i'
91 "/(?:'{1,2}[^']|rem\s).*/i",
92 'doc' => new Rule("/'''/", '/$/m')
95 'identifier' => '/[a-z_][a-z_0-9]*|\[.+?\]/i',
96 'doc' => '/<(?:".*?"|\'.*?\'|[^>])*>/',
99 $this->addMappings(array(