xml_with_scripts.xs.svn-base

来自「支持自定义语法高亮显示的编辑器控件」· SVN-BASE 代码 · 共 357 行

SVN-BASE
357
字号
//Language: PHP, VB, Java Scripts in XML
//Copyright (c) 1992-2002 Altium Limited             
//All rights reserved.                               
//http://www.dream-com.com                           
//contact@dream-com.com                              

// states
State=snormal
State=sstring1
State=sstring2
State=sstring3
State=sstring4
State=sstring5
State=sstring6
State=sstring7
State=scomment1
State=scomment2
State=scomment3
State=scomment4
State=scomment5
State=scomment6
State=scomment7
State=scomment8
State=sXMLtag
State=sXMLphp
State=sXMLvbs
State=sXMLjs
State=sXMLcdata

// tokens
Token=tnone
Token=tstring
Token=tcomment
Token=tident
Token=tinteger
Token=tfloat
Token=tresword
Token=tassembler
Token=turl
Token=twhitespace
Token=tresword1
//delims
Delimiters=;.,:'"{}[]()?!@#$%^&*-+=|\/

// This is the tag
//------------------------------------------------------------------------------

//Common
snormal <             sXMLtag  tresword
sXMLtag [^\>^\"^#32]* sXMLtag  tresword
sXMLtag >             snormal   tresword

// numbers
sXMLtag [0-9][0-9]*                            sXMLtag  tinteger
sXMLtag [1-9][0-9]*\.[0-9]*                    sXMLtag  tfloat
sXMLtag [1-9][0-9]*{\.[0-9]+}|e{[\+\-]}|[0-9]+ sXMLtag  tfloat


//snormal     <                         sXMLtag      tresword
//sXMLtag     [a-z_A-Z][a-z_A-Z0-9]*    sXMLtag      tident
//sXMLtag     >                         snormal      tresword


// reswords
sXMLtag 'ee'     sXMLtag tresword
sXMLtag 'xsl'    sXMLtag tresword
sXMLtag 'xwl'    sXMLtag tresword

sXMLtag 'source' sXMLtag tresword1
sXMLtag 'target' sXMLtag tresword1



//white space
sXMLtag #32*                         sXMLtag   twhitespace

//strings
sXMLtag    \"                     sstring1   tstring
sstring1   [^\"]*                 sstring1   tstring
sstring1   \"                     sXMLtag    tstring
sstring1   \"\"                   sstring1   tstring
sstring1   $                      sXMLtag    tstring

//comments
sXMLtag    <\!--                    scomment1 tcomment
scomment1  [^\-]*                   scomment1 tcomment
scomment1  -->                      sXMLtag   tcomment

//------------------------------------------------------------------------------
// This is the PHP

// reswords
sXMLphp 'break'        sXMLphp tresword
sXMLphp 'case'         sXMLphp tresword
sXMLphp 'class'        sXMLphp tresword
sXMLphp 'continue'     sXMLphp tresword
sXMLphp 'default'      sXMLphp tresword
sXMLphp 'do'           sXMLphp tresword
sXMLphp 'else'         sXMLphp tresword
sXMLphp 'elseif'       sXMLphp tresword
sXMLphp 'endfor'       sXMLphp tresword
sXMLphp 'endif'        sXMLphp tresword
sXMLphp 'endswitch'    sXMLphp tresword
sXMLphp 'endwhile'     sXMLphp tresword
sXMLphp 'extends'      sXMLphp tresword
sXMLphp 'for'          sXMLphp tresword
sXMLphp 'function'     sXMLphp tresword
sXMLphp 'global'       sXMLphp tresword
sXMLphp 'if'           sXMLphp tresword
sXMLphp 'int'          sXMLphp tresword
sXMLphp 'old_function' sXMLphp tresword
sXMLphp 'pval'         sXMLphp tresword
sXMLphp 'return'       sXMLphp tresword
sXMLphp 'static'       sXMLphp tresword
sXMLphp 'string'       sXMLphp tresword
sXMLphp 'switch'       sXMLphp tresword
sXMLphp 'var'          sXMLphp tresword
sXMLphp 'void'         sXMLphp tresword
sXMLphp 'while'        sXMLphp tresword

// numbers
sXMLphp [0-9][0-9]*                            sXMLphp  tinteger
sXMLphp 0x[0-9A-F]+                            sXMLphp  tinteger
sXMLphp [1-9][0-9]*\.[0-9]*                    sXMLphp  tfloat
sXMLphp [1-9][0-9]*{\.[0-9]+}|e{[\+\-]}|[0-9]+ sXMLphp  tfloat

//idents
sXMLphp   [a-z_A-Z][a-z_A-Z0-9]*  sXMLphp   tresword

//strings
sXMLphp    \"                     sstring2   tstring
sstring2   [^\"]*                 sstring2   tstring
sstring2   \"                     sXMLphp    tstring
sstring2   \"\"                   sstring2   tstring
sstring2   \\                     sstring2   tstring
sstring2   \\\"                   sstring2   tstring
sstring2   $                      sXMLphp    tstring

sXMLphp    \'                     sstring3   tstring
sstring3   [^\']*                 sstring3   tstring
sstring3   \'                     sXMLphp    tstring
sstring3   \'\'                   sstring3   tstring
sstring3   \\                     sstring3   tstring
sstring3   \\\'                   sstring3   tstring
sstring3   $                      sXMLphp    tstring

sXMLphp    \`                     sstring4   tstring
sstring4   [^\`]*                 sstring4   tstring
sstring4   \`                     sXMLphp    tstring
sstring4   \`\`                   sstring4   tstring
sstring4   \\                     sstring4   tstring
sstring4   \\\`                   sstring4   tstring
sstring4   $                      sXMLphp    tstring

//comments
sXMLphp     //                      scomment2  tcomment
scomment2  [#1-#255]*               sXMLphp    tcomment
scomment2 $                         sXMLphp    tcomment

sXMLphp    \#                      scomment3  tcomment
scomment3  [#1-#255]*              sXMLphp    tcomment
scomment3 $                        sXMLphp    tcomment

sXMLphp    /\*                     scomment4 tcomment
scomment4  [^\*]*                  scomment4 tcomment
scomment4  \*[^/]                  scomment4 tcomment
scomment4  [\*]*/                  sXMLphp   tcomment

snormal        <?php              sXMLphp  tresword
sXMLphp        ?>                 snormal  tresword

snormal        <script#32language="php">   sXMLphp  tresword
sXMLphp        </script>                   snormal  tresword
//------------------------------------------------------------------------------
// This is the VBS

// reswords
sXMLvbs 'And'        sXMLvbs tresword
sXMLvbs 'As'         sXMLvbs tresword
sXMLvbs 'Attribute'  sXMLvbs tresword
sXMLvbs 'Base'       sXMLvbs tresword
sXMLvbs 'ByVal'      sXMLvbs tresword
sXMLvbs 'Call'       sXMLvbs tresword
sXMLvbs 'Case'       sXMLvbs tresword
sXMLvbs 'Compare'    sXMLvbs tresword
sXMLvbs 'Const'      sXMLvbs tresword
sXMLvbs 'Date'       sXMLvbs tresword
sXMLvbs 'Declare'    sXMLvbs tresword
sXMLvbs 'Dim'        sXMLvbs tresword
sXMLvbs 'Do'         sXMLvbs tresword
sXMLvbs 'Each'       sXMLvbs tresword
sXMLvbs 'Else'       sXMLvbs tresword
sXMLvbs 'Elseif'     sXMLvbs tresword
sXMLvbs 'Empty'      sXMLvbs tresword
sXMLvbs 'end'        sXMLvbs tresword
sXMLvbs 'Error'      sXMLvbs tresword
sXMLvbs 'Exit'       sXMLvbs tresword
sXMLvbs 'Explicit'   sXMLvbs tresword
sXMLvbs 'False'      sXMLvbs tresword
sXMLvbs 'For'        sXMLvbs tresword
sXMLvbs 'friend'     sXMLvbs tresword
sXMLvbs 'Function'   sXMLvbs tresword
sXMLvbs 'get'        sXMLvbs tresword
sXMLvbs 'If'         sXMLvbs tresword
sXMLvbs 'Is'         sXMLvbs tresword
sXMLvbs 'let'        sXMLvbs tresword
sXMLvbs 'Loop'       sXMLvbs tresword
sXMLvbs 'Mod'        sXMLvbs tresword
sXMLvbs 'Next'       sXMLvbs tresword
sXMLvbs 'Not'        sXMLvbs tresword
sXMLvbs 'Nothing'    sXMLvbs tresword
sXMLvbs 'Null'       sXMLvbs tresword
sXMLvbs 'On'         sXMLvbs tresword
sXMLvbs 'Option'     sXMLvbs tresword
sXMLvbs 'Or'         sXMLvbs tresword
sXMLvbs 'Private'    sXMLvbs tresword
sXMLvbs 'property'   sXMLvbs tresword
sXMLvbs 'Public'     sXMLvbs tresword
sXMLvbs 'ReDim'      sXMLvbs tresword
//sXMLvbs 'Rem'        sXMLvbs tresword
sXMLvbs 'Select'     sXMLvbs tresword
sXMLvbs 'Set'        sXMLvbs tresword
sXMLvbs 'String'     sXMLvbs tresword
sXMLvbs 'Sub'        sXMLvbs tresword
sXMLvbs 'Then'       sXMLvbs tresword
sXMLvbs 'To'         sXMLvbs tresword
sXMLvbs 'True'       sXMLvbs tresword
sXMLvbs 'Type'       sXMLvbs tresword
sXMLvbs 'Wend'       sXMLvbs tresword
sXMLvbs 'While'      sXMLvbs tresword
sXMLvbs 'With'       sXMLvbs tresword
sXMLvbs 'Xor'        sXMLvbs tresword

//idents
sXMLvbs   [a-z_A-Z][a-z_A-Z0-9]*  sXMLvbs   tident

// numbers
sXMLvbs [0-9][0-9]*                            sXMLvbs  tinteger
sXMLvbs [1-9][0-9]*\.[0-9]*                    sXMLvbs  tfloat
sXMLvbs [1-9][0-9]*{\.[0-9]+}|e{[\+\-]}|[0-9]+ sXMLvbs   tfloat

//strings
sXMLvbs   \"                     sstring5   tstring
sstring5  [^\"]*                 sstring5   tstring
sstring5  \"                     sXMLvbs    tstring
sstring5  \"\"                   sstring5   tstring
sstring5  $                      sXMLvbs    tstring

//comments
sXMLvbs    \'                      scomment5  tcomment
scomment5  [#1-#255]*              sXMLvbs   tcomment
scomment5 $                        sXMLvbs   tcomment

sXMLvbs    rem[^#33-#255]          scomment6 tcomment
scomment6  [#1-#255]*              sXMLvbs   tcomment
scomment6  $                       sXMLvbs   tcomment

//VBS
snormal     <script#32language="vbscript">   sXMLvbs  tresword
sXMLvbs     </script>                        snormal  tresword

snormal     <%                         sXMLvbs  tresword
sXMLvbs     %>                         snormal  tresword
//------------------------------------------------------------------------------
// This is the JS

// reswords
sXMLjs 'break'     sXMLjs tresword
sXMLjs 'case'      sXMLjs tresword
sXMLjs 'catch'     sXMLjs tresword
sXMLjs 'class'     sXMLjs tresword
sXMLjs 'const'     sXMLjs tresword
sXMLjs 'continue'  sXMLjs tresword
sXMLjs 'debugger'  sXMLjs tresword
sXMLjs 'default'   sXMLjs tresword
sXMLjs 'delete'    sXMLjs tresword
sXMLjs 'do'        sXMLjs tresword
sXMLjs 'else'      sXMLjs tresword
sXMLjs 'enum'      sXMLjs tresword
sXMLjs 'export'    sXMLjs tresword
sXMLjs 'extends'   sXMLjs tresword
sXMLjs 'false'     sXMLjs tresword
sXMLjs 'finally'   sXMLjs tresword
sXMLjs 'for'       sXMLjs tresword
sXMLjs 'function'  sXMLjs tresword
sXMLjs 'if'        sXMLjs tresword
sXMLjs 'import'    sXMLjs tresword
sXMLjs 'in'        sXMLjs tresword
sXMLjs 'new'       sXMLjs tresword
sXMLjs 'null'      sXMLjs tresword
sXMLjs 'return'    sXMLjs tresword
sXMLjs 'super'     sXMLjs tresword
sXMLjs 'switch'    sXMLjs tresword
sXMLjs 'this'      sXMLjs tresword
sXMLjs 'throw'     sXMLjs tresword
sXMLjs 'true'      sXMLjs tresword
sXMLjs 'try'       sXMLjs tresword
sXMLjs 'typeof'    sXMLjs tresword
sXMLjs 'var'       sXMLjs tresword
sXMLjs 'void'      sXMLjs tresword
sXMLjs 'while'     sXMLjs tresword
sXMLjs 'with'      sXMLjs tresword

//idents
sXMLjs   [a-z_A-Z][a-z_A-Z0-9]*  sXMLjs   tident

// numbers
sXMLjs [0-9][0-9]*                            sXMLjs  tinteger
sXMLjs 0x[0-9A-F]+                            sXMLjs  tinteger
sXMLjs 0X[0-9A-F]+                            sXMLjs  tinteger
sXMLjs [1-9][0-9]*\.[0-9]*                    sXMLjs  tfloat
sXMLjs [1-9][0-9]*{\.[0-9]+}|e{[\+\-]}|[0-9]+ sXMLjs   tfloat

//strings
sXMLjs    \"                     sstring6   tstring
sstring6  [^\"]*                 sstring6   tstring
sstring6  \"                     sXMLjs     tstring
sstring6  \"\"                   sstring6   tstring
sstring6   \\                    sstring6   tstring
sstring6   \\\"                  sstring6   tstring
sstring6  $                      sXMLjs     tstring

sXMLjs    \'                     sstring7   tstring
sstring7  [^\']*                 sstring7   tstring
sstring7  \'                     sXMLjs     tstring
sstring7  \'\'                   sstring7   tstring
sstring7   \\                    sstring7   tstring
sstring7   \\\'                  sstring7   tstring
sstring7  $                      sXMLjs     tstring

//comments
sXMLjs     //                      scomment7  tcomment
scomment7  [#1-#255]*             sXMLjs     tcomment
scomment7 $                       sXMLjs     tcomment

sXMLjs    /\*                     scomment8  tcomment
scomment8 [^\*]*                  scomment8  tcomment
scomment8 \*[^/]                  scomment8  tcomment
scomment8 [\*]*/                  sXMLjs     tcomment

//JS
snormal     <script#32language="jscript">    sXMLjs   tresword
sXMLjs      </script>                        snormal  tresword

snormal     <script#32language="javascript"> sXMLjs   tresword
sXMLjs      </script>                        snormal  tresword
//------------------------------------------------------------------------------
// This is the CDATA

//idents
sXMLcdata   [a-z_A-Z][a-z_A-Z0-9]*  sXMLcdata   tident

//CDATA
snormal        <\!\[CDATA\[                  sXMLcdata   tresword
sXMLcdata      \]\]>                         snormal     tresword
//------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?