Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Dvorak committed Jan 2, 2014
1 parent a2ae97f commit 27f2680
Show file tree
Hide file tree
Showing 53 changed files with 13,948 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.1st
@@ -0,0 +1,31 @@


Obsah adresare:

/DOC
- dokumentace k programu v HTML - ctete prosim jako prvni.
Obsahuje technicke poznamky, uzivatelskou i programatorkou DOC.

/SOURCE
- zdrojaky

/MAIN
- main projektu

hilex.prj
- project file Borland C++ 3.1

/HLX
- zaloha HLX souboru

*.hlx
- HLX soubory ( viz. dokumentace )

/EXE
- prelozeny program - NEPOUZIVEJTE ( mel jsem ho pouze na transport )


Martin Dvorak
ultradvorka@post.cz


9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -2,3 +2,12 @@ hilex
=====

Source code syntax highlighting: C/C++/Prolog/... -- HLX --> HTML.


DESCRIPTION
===========

Hilex is an utility that converts a source code to HTML with syntax highlighting.
Hilex is configured using HLX files that are formed by a set of regular expression
based rules. These rules are used for matching and colorization of source code tokens.

167 changes: 167 additions & 0 deletions cpp.hlx
@@ -0,0 +1,167 @@
#---------------------------------------------------------------------------------
#
# Configuration file for HILEX
#
# Languague: C++
#
# by Dvorka
#
#---------------------------------------------------------------------------------

Setup( "TRANSLATION" )
{
Output ="HTML_PAGE"; # HTML_PAGE or NO_ENCAPS or HTML_TABLE

CRLF ="FALSE"; # add CRs to output ( Unix LF, Dos CRLF )
HtmlOutput="TRUE"; # convert < to &lt; ...
}

#---------------------------------------------------------------------------------

Setup( "ENCAPSULATION" )
{
Face_Font ="COURIER NEW";
Title ="HILEX translated source";
BaseColor ="#FFFF00";
BaseSize ="+1";
BgColor ="#000080";
Width ="555"; # used when HTML_TABLE in other cases is ignored
}

#---------------------------------------------------------------------------------

Element( "KEYWORDS" )
{
Descr="(asm)|(auto)|(break)|(case)|(cdecl)|(char)|(class)|(const)|";
Descr="(continue)|(_cs)|(default)|(delete)|(do)|(double)|(_ds)|(else)|";
Descr="(enum)|(_es)|(_export)|(extern)|(far)|(float)|(for)|(friend)|";
Descr="(goto)|(huge)|(if)|(inline)|(int)|(interrupt)|(_loadds)|(long)|";
Descr="(near)|(new)|(operator)|(pascal)|(private)|(protected)|(public)|";
Descr="(register)|(return)|(_saveregs)|(_seg)|(short)|(signed)|(sizeof)|";
Descr="(ss)|(static)|(struct)|(switch)|(template)|(this)|(typedef)|";
Descr="(union)|(unsigned)|(virtual)|(void)|(volatile)|(while)";

Color="#FFFFFF";
Bold="TRUE";

Action="ENCAPSULATE";
}

#---------------------------------------------------------------------------------

Element( "IDENTIFIER" )
{
Descr ="[A-Za-z_][A-Za-z_0-9]*";

Color="#FFFF00";

Action="ENCAPSULATE";
}

#---------------------------------------------------------------------------------

Element( "SYMBOL" )
{
Descr ="\.|;|,|:|-|=|^|&|\?|<|>|%|!|~|\+|/|\*|\[|\]|\{|\}|\||\(|\)";

Raw_beg="<FONT COLOR=\"#FFFFFF\">";
Raw_end="</FONT>";

Action="ENCAPSULATE";
}

#---------------------------------------------------------------------------------

Element( "PREPROCESOR" )
{
Descr="#([^\n]|(\\\n))*\n";

Color="#00FF00";

Action="ENCAPSULATE";
}

#---------------------------------------------------------------------------------

Element( "C COMMENTS" )
{
Descr="/\*((\*+[^/])|([^\*]))*\*+/";

Color="#C0C0C0";
Italic="TRUE";

Action="ENCAPSULATE";
}

#---------------------------------------------------------------------------------

Element( "C++ COMMENTS" )
{
Descr="//[^\n]*\n";

Color="#C0C0C0";
Italic="TRUE";

Action="ENCAPSULATE";
}

#---------------------------------------------------------------------------------

Element( "STRING" )
{
Descr="\"(([^\"])|(\\"))*\"";

Color="#00FFFF";

Action="ENCAPSULATE";
}

#---------------------------------------------------------------------------------

Element( "CHARACTER CONSTANT" )
{
Descr="'(.)|(\\.)'";

Color="#00FFFF";

Action="ENCAPSULATE";
}

#---------------------------------------------------------------------------------

Element( "DECIMAL CONSTANT" )
{
Descr="[0-9]+[Uu]?[Ll]?";

Color="#00FFFF";

Action="ENCAPSULATE";
}

#---------------------------------------------------------------------------------

Element( "HEXA CONSTANT" )
{
Descr="0[xX][0-9A-Fa-f]+[Uu]?[Ll]?";

Color="#00FFFF";

Action="ENCAPSULATE";
}

#---------------------------------------------------------------------------------

Element( "FLOAT CONSTANT" )
{
Descr="([0-9]+\.[0-9]*[fF]?[Ll]?)|([0-9]+[fF]?[Ll]?)|";
Descr="([0-9]+\.[0-9]*[Ee]-?\+?[0-9]+[fF]?[Ll]?)";

Color="#00FFFF";

Action="ENCAPSULATE";
}

#---------------------------------------------------------------------------------



149 changes: 149 additions & 0 deletions ctounix.hlx
@@ -0,0 +1,149 @@
#---------------------------------------------------------------------------------
#
# Configuration file for HILEX
#
# Usage: File for porting CPP files from DOS to UNIX
#
# by Dvorka
#
#---------------------------------------------------------------------------------

Setup( "TRANSLATION" )
{
Output ="NO_ENCAPS"; # HTML_PAGE or NO_ENCAPS or HTML_TABLE

CRLF ="FALSE"; # add CRs to output ( Unix LF, Dos CRLF )
HtmlOutput="FALSE"; # convert < to &lt; ...
}

#---------------------------------------------------------------------------------

Element( "farmalloc -> malloc" )
{
Descr="farmalloc";

Action="REPLACE";

Raw="malloc";
}

#---------------------------------------------------------------------------------

Element( "FAR away" )
{
Descr="far";

Action="REMOVE";
}

#---------------------------------------------------------------------------------

Element( "KEYWORDS" )
{
Descr="(asm)|(auto)|(break)|(case)|(cdecl)|(char)|(class)|(const)|";
Descr="(continue)|(_cs)|(default)|(delete)|(do)|(double)|(_ds)|(else)|";
Descr="(enum)|(_es)|(_export)|(extern)|(far)|(float)|(for)|(friend)|";
Descr="(goto)|(huge)|(if)|(inline)|(int)|(interrupt)|(_loadds)|(long)|";
Descr="(near)|(new)|(operator)|(pascal)|(private)|(protected)|(public)|";
Descr="(register)|(return)|(_saveregs)|(_seg)|(short)|(signed)|(sizeof)|";
Descr="(ss)|(static)|(struct)|(switch)|(template)|(this)|(typedef)|";
Descr="(union)|(unsigned)|(virtual)|(void)|(volatile)|(while)";

Action="NO";
}

#---------------------------------------------------------------------------------

Element( "IDENTIFIER" )
{
Descr ="[A-Za-z_][A-Za-z_0-9]*";

Action="NO";
}

#---------------------------------------------------------------------------------

Element( "SYMBOL" )
{
Descr ="\.|;|,|:|-|=|^|&|\?|<|>|%|!|~|\+|/|\*|\[|\]|\{|\}|\||\(|\)";

Action="NO";
}

#---------------------------------------------------------------------------------

Element( "PREPROCESOR" )
{
Descr="#([^\n]|(\\\n))*\n";

Action="NO";
}

#---------------------------------------------------------------------------------

Element( "C COMMENTS" )
{
Descr="/\*((\*+[^/])|([^\*]))*\*+/";

Action="NO";
}

#---------------------------------------------------------------------------------

Element( "C++ COMMENTS" )
{
Descr="//[^\n]*\n";

Action="NO";
}

#---------------------------------------------------------------------------------

Element( "STRING" )
{
Descr="\"(([^\"])|(\\"))*\"";

Action="NO";
}

#---------------------------------------------------------------------------------

Element( "CHARACTER CONSTANT" )
{
Descr="'(.)|(\\.)'";

Action="NO";
}

#---------------------------------------------------------------------------------

Element( "DECIMAL CONSTANT" )
{
Descr="[0-9]+[Uu]?[Ll]?";

Action="NO";
}

#---------------------------------------------------------------------------------

Element( "HEXA CONSTANT" )
{
Descr="0[xX][0-9A-Fa-f]+[Uu]?[Ll]?";

Action="NO";
}

#---------------------------------------------------------------------------------

Element( "FLOAT CONSTANT" )
{
Descr="([0-9]+\.[0-9]*[fF]?[Ll]?)|([0-9]+[fF]?[Ll]?)|";
Descr="([0-9]+\.[0-9]*[Ee]-?\+?[0-9]+[fF]?[Ll]?)";

Action="NO";
}

#---------------------------------------------------------------------------------



0 comments on commit 27f2680

Please sign in to comment.