From psheer@icon.co.za Fri Jun 18 16:15:38 2004 Date: Thu, 27 Jun 2002 16:16:53 Africa/Johannesburg From: psheer@icon.co.za To: tobin@splorg.org Cc: psheer@icon.co.za Subject: PrettyC some bug fixes %{ /* Copyright (c) 2000 by Tobin Fricke */ #include "prettyc.h" %} %x comment %x string %x preprocessor delim [ \t\n] ws {delim}+ symbol [\!\^\&\*\-\+\;\,\.\~\=\?\:] bracket [\{\(\[\]\)\}] letter [A-Za-z_] digit [0-9] alnum [0-9A-Za-z_] number {digit}+ identifier {letter}{alnum}* cnumber (0x)?{number}U?L? charconst \'\\?.\' linecomment ^\/\/.*\n keyword auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|void|volatile|while %% {keyword} return TOK_KEYWORD; {linecomment} return TOK_COMMENT; {identifier} return TOK_IDENTIFIER; {cnumber} return TOK_NUMBER; {symbol} return TOK_SYMBOL; {bracket} return TOK_BRACKET; {ws} return TOK_WHITESPACE; \" BEGIN(string); yymore(); \\. yymore(); [^\"] yymore(); \n yymore(); \" BEGIN(INITIAL); return TOK_STRING; ^[ ]*\# BEGIN(preprocessor); yymore(); \\\n yymore(); [^\n] yymore(); \n BEGIN(INITIAL); return TOK_PREPROCESS; \/\* BEGIN(comment); yymore(); [^*]* yymore(); \*+[^*/] yymore(); \*+\/ BEGIN(INITIAL); return TOK_COMMENT; %% --------------------------------------------- This message was sent using World Mail. http://www.worldonline.co.za