1 # Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved.
2 # This program is free software; you can redistribute it and/or
3 # modify it under the same terms as Perl itself.
5 # This file was generated from the 'nasm.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Nicola Gigante (nicola.gigante@gmail.com)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Intel_x86_NASM;
15 our $VERSION = '0.06';
19 use base('Syntax::Highlight::Engine::Kate::Template');
23 my $class = ref($proto) || $proto;
24 my $self = $class->SUPER::new(@_);
28 'Comment' => 'Comment',
31 'Instructions' => 'Keyword',
32 'Label' => 'Function',
33 'NASM Keywords' => 'Keyword',
34 'Normal Text' => 'Normal',
36 'Preprocessor' => 'Others',
37 'Registers' => 'Keyword',
40 $self->listAdd('Data',
61 $self->listAdd('NASM Keywords',
67 '__NASM_VERSION_ID__',
69 '___NASM_PATCHLEVEL__',
92 $self->listAdd('instructions',
1200 $self->listAdd('registers',
1256 $self->contextdata({
1258 callback => \&parseComment,
1259 attribute => 'Comment',
1260 lineending => '#pop',
1263 callback => \&parseNormal,
1264 attribute => 'Normal Text',
1267 callback => \&parsePreprocessor,
1268 attribute => 'Preprocessor',
1269 lineending => '#pop',
1272 callback => \&parseString,
1273 attribute => 'String',
1274 lineending => '#pop',
1277 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
1278 $self->basecontext('Normal');
1279 $self->keywordscase(0);
1281 bless ($self, $class);
1286 return 'Intel x86 (NASM)';
1290 my ($self, $text) = @_;
1295 my ($self, $text) = @_;
1296 # String => 'registers'
1297 # attribute => 'Registers'
1298 # context => '#stay'
1300 if ($self->testKeyword($text, 'registers', 0, undef, 0, '#stay', 'Registers')) {
1304 # attribute => 'Data'
1305 # context => '#stay'
1307 if ($self->testKeyword($text, 'Data', 0, undef, 0, '#stay', 'Data')) {
1310 # String => 'instructions'
1311 # attribute => 'Instructions'
1312 # context => '#stay'
1314 if ($self->testKeyword($text, 'instructions', 0, undef, 0, '#stay', 'Instructions')) {
1317 # String => 'NASM Keywords'
1318 # attribute => 'NASM Keywords'
1319 # context => '#stay'
1321 if ($self->testKeyword($text, 'NASM Keywords', 0, undef, 0, '#stay', 'NASM Keywords')) {
1324 # attribute => 'Comment'
1326 # context => 'Comment'
1327 # type => 'DetectChar'
1328 if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
1331 # attribute => 'Preprocessor'
1333 # context => 'Preprocessor'
1334 # type => 'DetectChar'
1335 if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) {
1339 # attribute => 'String'
1340 # context => 'String'
1342 if ($self->testAnyChar($text, '"\'', 0, 0, undef, 0, 'String', 'String')) {
1345 # String => '^\s*[A-Za-z0-9_.$]+:'
1346 # attribute => 'Label'
1347 # context => '#stay'
1349 if ($self->testRegExpr($text, '^\\s*[A-Za-z0-9_.$]+:', 0, 0, 0, undef, 0, '#stay', 'Label')) {
1352 # String => '(cmov|fcmov|j|loop|set)(a|ae|b|be|c|e|g|ge|l|le|na|nae|nb|nbe|nc|ne|ng|nge|nl|nle|no|np|ns|nz|o|p|pe|po|s|z)'
1353 # attribute => 'Instructions'
1354 # context => '#stay'
1356 if ($self->testRegExpr($text, '(cmov|fcmov|j|loop|set)(a|ae|b|be|c|e|g|ge|l|le|na|nae|nb|nbe|nc|ne|ng|nge|nl|nle|no|np|ns|nz|o|p|pe|po|s|z)', 0, 0, 0, undef, 0, '#stay', 'Instructions')) {
1359 # String => 'cpu (pentium|ppro|p2|p3|katmai|p4|willamette|prescott|ia64)*'
1360 # attribute => 'NASM Keywords'
1361 # context => '#stay'
1363 if ($self->testRegExpr($text, 'cpu (pentium|ppro|p2|p3|katmai|p4|willamette|prescott|ia64)*', 0, 0, 0, undef, 0, '#stay', 'NASM Keywords')) {
1366 # String => '(\$[0-9]+[a-f0-9]*|[a-f0-9]+h)'
1367 # attribute => 'BaseN'
1368 # context => '#stay'
1369 # insensitive => 'TRUE'
1371 if ($self->testRegExpr($text, '(\\$[0-9]+[a-f0-9]*|[a-f0-9]+h)', 1, 0, 0, undef, 0, '#stay', 'BaseN')) {
1374 # String => '([0-7]+(q|o)|[01]+b)'
1375 # attribute => 'BaseN'
1376 # context => '#stay'
1377 # insensitive => 'TRUE'
1379 if ($self->testRegExpr($text, '([0-7]+(q|o)|[01]+b)', 1, 0, 0, undef, 0, '#stay', 'BaseN')) {
1382 # attribute => 'Number'
1384 # context => '#stay'
1385 # type => 'DetectChar'
1386 if ($self->testDetectChar($text, '$', 0, 0, 0, undef, 0, '#stay', 'Number')) {
1389 # attribute => 'BaseN'
1390 # context => '#stay'
1392 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'BaseN')) {
1395 # attribute => 'BaseN'
1396 # context => '#stay'
1398 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'BaseN')) {
1401 # attribute => 'Float'
1402 # context => '#stay'
1404 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
1407 # attribute => 'Number'
1408 # context => '#stay'
1410 if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) {
1413 # attribute => 'Char'
1414 # context => '#stay'
1416 if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) {
1422 sub parsePreprocessor {
1423 my ($self, $text) = @_;
1428 my ($self, $text) = @_;
1430 # attribute => 'String'
1433 if ($self->testAnyChar($text, '"\'', 0, 0, undef, 0, '#pop', 'String')) {
1446 Syntax::Highlight::Engine::Kate::Intel_x86_NASM - a Plugin for Intel x86 (NASM) syntax highlighting
1450 require Syntax::Highlight::Engine::Kate::Intel_x86_NASM;
1451 my $sh = new Syntax::Highlight::Engine::Kate::Intel_x86_NASM([
1456 Syntax::Highlight::Engine::Kate::Intel_x86_NASM is a plugin module that provides syntax highlighting
1457 for Intel x86 (NASM) to the Syntax::Haghlight::Engine::Kate highlighting engine.
1459 This code is generated from the syntax definition files used
1460 by the Kate project.
1461 It works quite fine, but can use refinement and optimization.
1463 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
1469 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
1475 Unknown. If you find any, please contact the author