|
» Adiciona Favoritos
|
|
12/05/2000 |
1.1 |
ASP |
34501 |
4 |
|
HiLiteR is a new approach to the "view source" utilities by adding extensible syntax highlighting feature. |
Human eye distinguishes the objects by their size, position and color, the last of which is the primary subject of HiLiteR.
Developers usually works with high level IDE's because they ease the programming tasks by providing intellisense, realtime code check and syntax highlighting.
Although HiLiteR is not an IDE, it gives you the ability to highlight your code for publication. The parsing and hiliting engine might be used for different languages with some changes.
Currently, HiLiteR only supports ASP, either with VBSctipt or JScript.
My first lame attempt for hiliting was using a similar approach to Replace function. Of course, it worked, for every single word. No matter it is in an ASP block or comment or even HTML. So, I needed a way to determine if the word is in asp, comment or html. I've added conditions and flags to state if the processor is in an asp block, or string etc.
Finally, what we got is a char-by-char processing engine which scans the file and finds functions, objects, properties, comments and strings, then assigns colors to them. (You may edit the css file to define colors for different language elements.)
Performance? It really sucks! It takes up to 10 seconds for an 10K 'heavily coded' page. So I recommend you to use it offline. Execute it once and copy the generated html output between 'HiLiteR Code Block' comments. This is what I do.
I'm not coming from a C/C++ background, neither I have experience on compiler design, so the code is not fully optimized.
Download the code, check it out, report the bugs you've found, recommend a feature or extension for it, anything... Do you think it is not the way for parsing and coloring, let me know your way then :)
For the sake of the project being a source code viewer, here are your links for the files included in the releases. (As my recommendation, I used HiLiteR to generate the html output).
» src.asp Parsing and Highlighting Engine.
» syntaxdef.asp Syntax Definitions.
I've also made a fancy black-background style sheet for HiLiteR. Check out the src.asp on black, you may download the css file as well.
|
|
Frase |
O maior elogio que ouvi em toda a minha vida de inventor foi:
"Nunca vai funcionar". |
Thomas Edison |
|
|