Syntax Highlighting for Greater Golf! Golfers.

Together, we have banded together to produce code that is concise, is functionally beautiful and is uglier then the Phantom of the Opera from the original novel.

The time has come for us to bring beauty back to the world of programming. With color. In a way that is concise, functionally beautiful is uglier then the Phantom of the Opera from the original novel.

We're gonna be coding a colorful syntax highlighter. In the shortest amount of code possible.

You will receive via an input file or Stdin a valid C file. The C file will use the line convention of your choice, and will only contain ASCII characters 32-126. You have to turn it into a HTML file that displays correctly at least in Chrome, that shows the source code  with syntax highlighting. The output may be in a file or to Stdout.

You must highlight:


All strings and characters (including the quote characters) in Green (#00FF00). The strings may contain escaped characters. 
All C reserved words in Blue (#0000FF).
All comments in Yellow (#FFFF00).
All C preprocessor directives in Pink (#FF00FF).


The output when displayed in Chrome must:


Be in a fixed-width font
Display new lines wherever they appeared in the original source 
Accurately reproduce whitespace. A tab character should be taken as being 4 spaces.


Bonuses


x 0.9 if you include line numbers. Line numbers must be able to reach at least 99999. All source must still be aligned - so, source code with smaller line numbers should still start at the same position as source code with higher line numbers
x 0.8 if background of each line is alternated between light gray (#C0C0C0) and white (#FFFFFF)
x 0.9 if your source code is written in C, and can correctly format itself.


Scoring

This is code golf. Your score is the amount of bytes of your source code multiplied by any bonuses. The winner is the golfer with the lowest score.
Perl 769 chars * 0.9 * 0.8 = 554

Probably still some improvements to be made on some of the regexes, but it's slowly getting there!

$_=join"",&lt;&gt;;$s="&lt;tt class";$c="&lt;/tt&gt;";$d=counter;$e=color;s/\t/    /g;s!&lt;!&amp;lt;!g;s!&gt;!&amp;gt;!g;s!^#.+(?=$|
)!$s=d&gt;$&amp;$c!gm;s!//.+!$s=c&gt;$&amp;$c!g;s|(['"]).*?(?&lt;!\\)(\\\\)*\1|($h=$&amp;)=~s!/!&amp;#47;!g;"$s=s&gt;$h$c"|smeg;s!/\*.*?\*/!$s=c&gt;$&amp;$c!smg;s!\b(_Packed|(au|go)to|break|c(ase|har|onst|ontinue)|d(efault|o|ouble)|e(lse|num|xtern)|f(loat|or)|if|int|long|re(gister|turn)|short|(un)?signed|s(izeof|tatic|truct|witch)|typedef|union|vo(id|latile)|while)\b!$s=r&gt;$&amp;$c!g;s!=(\w)&gt;.+?$c!join"$c
$s=$1&gt;",split$/,$&amp;!smeg;s!
!&lt;tr&gt;&lt;td&gt;!g;print"&lt;style&gt;body{font:10px monospace;$d-reset:n}td{white-space:pre}tr:nth-child(even){background:#c0c0c0}tr:before{$d-increment:n;content:$d(n)}.d{$e:#f0f}.r{$e:#00f}.c{$e:#ff0}.s{$e:#0f0}tt tt{$e:inherit!important}&lt;/style&gt;&lt;table cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;$_"


Slightly less obfuscated version with comments:

$_=join"",&lt;&gt;; # slurp file
$s="&lt;tt class"; # used later - use &lt;tt/&gt; instead of &lt;span/&gt;, fewer chars!
$c="&lt;/tt&gt;";
$d=counter;
$e=color;
s/\t/    /g; # convert tabs to spaces
s!&lt;!&amp;lt;!g; # htmlentity &lt; and &gt;
s!&gt;!&amp;gt;!g;
s!^#.+(?=$|\n)!$s=d&gt;$&amp;$c!gm; # directives
s!//.+!$s=c&gt;$&amp;$c!g; # inline comments
s|(['"]).*?(?&lt;!\\)(\\\\)*\1|($h=$&amp;)=~s!/!&amp;#47;!g;"$s=s&gt;$h$c"|smeg; # strings, might have 0 length - thanks @Einacio; work-around string that contain /* by converting them to HTML entities
s!/\*.*?\*/!$s=c&gt;$&amp;$c!smg; # multi-line comments
s!\b(_Packed|(au|go)to|break|c(ase|har|onst|ontinue)|d(efault|o|ouble)|e(lse|num|xtern)|f(loat|or)|if|int|long|re(gister|turn)|short|(un)?signed|s(izeof|tatic|truct|witch)|typedef|union|vo(id|latile)|while)\b!$s=r&gt;$&amp;$c!g; # reserved words, don't optimise this too much! - thanks @bwoebi
s!=(\w)&gt;.+?$c!join"$c
$s=$1&gt;",split$/,$&amp;!smeg; # any multi-line string/comment, ensure &lt;span/&gt;s are repeated
s!\n!&lt;tr&gt;&lt;td&gt;!g; # strip newlines, replace with &lt;tr&gt;&lt;td&gt;, don't need &lt;/td&gt; _or_ &lt;/tr&gt; - thanks @xfix!
print"&lt;style&gt;
body{font:10px monospace;$d-reset:n} /* init counter */
td{white-space:pre} /* preserve whitespace */
tr:nth-child(odd){background:#c0c0c0} /* alternating rows */
tr:before{$d-increment:n;content:$d(n)} /* place counter */
.d{$e:#f0f} /* highlights */
.r{$e:#00f}
.c{$e:#ff0}
.s{$e:#0f0}
tt tt{$e:inherit!important} /* ignore reserved words/comments in strings */
&lt;/style&gt;&lt;table cellspacing=0&gt;&lt;tr&gt;&lt;td&gt;$_"


Now successfully highlights @xfix's entry.

Borrowed the idea to drop &lt;/tr&gt; from @xfix's entry, thank you!

Example of output for @xfix's solution.