- 作者:xiaoxiao
- 发表时间:2020-12-23 10:59
- 来源:未知
<script type=text/javascript> versionOK = false </script> <script type="text/javascript; version=1.5"> versionOK = true </script> <script type=text/jscript> if (parseFloat(ScriptEngineMajorVersion() + "." + ScriptEngineMinorVersion()) >= 5.5) versionOK = true </script> <script type=text/javascript> if (versionOK) { // edit lines below to change the output style comment = {color:"#999999", bold:false, italic:true, name:"comment"} // comment blocks and lines precompiler = {color:"#000099", bold:false, italic:false, name:"pre"} // precompiler lines operator = {color:"#663300", bold:true, italic:false, name:"operator"} // operator and punctuator symbols stringLiteral = {color:"#009900", bold:false, italic:false, name:"string"} // string and wide char string literals charLiteral = {color:"#009900", bold:false, italic:false, name:"char"} // char and wchar_t literals intLiteral = {color:"#999900", bold:false, italic:false, name:"int"} // integer literals floatLiteral = {color:"#996600", bold:false, italic:false, name:"float"} // floating point literals boolLiteral = {color:"#000000", bold:true, italic:false, name:"bool"} // boolean literals types = {color:"#FF6633", bold:false, italic:false, name:"type"} // built-in type names flowControl = {color:"#FF0000", bold:false, italic:false, name:"flow"} // program flow control keywords keyword = {color:"#990000", bold:false, italic:false, name:"keyword"} // other keywords } </script> <script type=text/javascript> // This JavaScript program is copyright by Jasper Bedaux (C) 2003. // This script can be freely used and distributed as long as this // copyright notice is preserved. If you use and or modify the script // you have to mention the author in a reasonable visible way. // THIS SCRIPT COMES WITHOUT ANY WARRANTY OF ANY KIND. // SELLING OF THIS SCRIPT IS NOT ALLOWED. // // A link to http://www.bedaux.net/cpp2html/ will be appreciated. if (versionOK) { keys = new Array() // containing C++ language elements keys.push({style:comment, start://s*///*[/s/S]*?/*///mg}) keys.push({style:comment, start://s*/mg, end://n/mg, neglect:///|/?/?///mg}) keys.push({style:precompiler, start://s*?^/s*(?:#|/?/?=|%:)/mg, end://n/m, neglect:///[/s/S]|/?/?//[/s/S]/m}) keys.push({style:stringLiteral, start://s*(?:/bL)?"/mg, end:/"/m, neglect:///[/s/S]|/?/?//[/s/S]/m}) keys.push({style:charLiteral, start://s*(?:/bL)?'/mg, end:/'/m, neglect:///[/s/S]|/?/?//[/s/S]/m}) keys.push({style:floatLiteral, start://s*(?:(?:/b/d+/./d*|/./d+)(?:E[/+/-]?/d+)?|/b/d+E[/+/-]?/d+)[FL]?/b|/s*/b/d+/./mgi}) keys.push({style:intLiteral, start://s*/b(?:0[0-7]*|[1-9]/d*|0x[/dA-F]+)(?:UL?|LU?)?/b/mgi}) keys.push({style:boolLiteral, start://s*/b(?:true|false)/b/mg}) keys.push({style:types, start://s*/b(?:bool|char|double|float|int|long|short|signed|unsigned|void|wchar_t)/b/mg}) keys.push({style:flowControl, start://s*/b(?:break|case|catch|continue|default|do|else|for|goto|if|return|switch|throw|try|while)/b/mg}) keys.push({style:keyword, start://s*/b(?:asm|auto|class|const_cast|const|delete|dynamic_cast|enum|explicit|export|extern|friend|inline|main|mutable|namespace|new|operator|private|protected|public|register|reinterpret_cast|sizeof|static_cast|static|struct|template|this|typedef|typeid|typename|union|using|virtual|volatile|and_eq|and|bitand|bitor|compl|not_eq|not|or_eq|or|xor_eq|xor)/b/mg}) keys.push({style:operator, start://s*[/{/}/[/]/(/)<>%:;/./?/*/+/-/^&/|~!=,//]+|/s*///mg}) function setOptions(useXhtml) { windowSettings = "menubar,scrollbars,status,resizable" if (!useXhtml) { /* outputStart = "/n/n /n C++ code colored by C++2HTML/n" + " /n" + " C++ code colored by C++2HTML/n" + " /n" for (var i = 1; i != keys.length; ++i) { outputStart += "." + keys[i].style.name + " { color: " + keys[i].style.color + "; " if (keys[i].style.bold) outputStart += "font-weight: bold; " if (keys[i].style.italic) outputStart += "font-style: italic; " outputStart += "}/n" } outputStart += "/n/n/n " outputEnd = "/n/n/n" */ outputStart = " /n"; for (var i = 1; i != keys.length; ++i) { outputStart += "." + keys[i].style.name + " { color: " + keys[i].style.color + "; " if (keys[i].style.bold) outputStart += "font-weight: bold; " if (keys[i].style.italic) outputStart += "font-style: italic; " outputStart += "}/n" } outputStart += "/n "; outputEnd = "" for (var i = 0; i != keys.length; ++i) { // set xhtml tags keys[i].before = "