From 98c1efa8b5035ce75f1e685e92fcb995e6848aa2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 21 Nov 2005 16:41:07 +0000 Subject: rename even more dashed to undersocres git-svn-id: file:///home/lennart/svn/public/sse/trunk@13 5fbabb74-0606-0410-a5e4-b5cc6a42724e --- feed/Makefile | 8 ++-- feed/sse-lex-c.l | 109 ------------------------------------------------------- feed/sse_lex_c.l | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 113 deletions(-) delete mode 100644 feed/sse-lex-c.l create mode 100644 feed/sse_lex_c.l (limited to 'feed') diff --git a/feed/Makefile b/feed/Makefile index adeeaaf..b3f237e 100644 --- a/feed/Makefile +++ b/feed/Makefile @@ -1,15 +1,15 @@ CLAGS=-Wextra -g -O2 -pipe LIBS=-lfl -all: sse-lex-c +all: sse_lex_c -sse-lex-c.yy.c: sse-lex-c.l +sse_lex_c.yy.c: sse_lex-c.l flex -o $@ $^ -sse-lex-c: sse-lex-c.yy.o +sse_lex_c: sse_lex_c.yy.o $(CC) -o $@ $^ $(LIBS) clean: - rm -f *.o sse-lex-c.yy.c sse-lex-c + rm -f *.o sse_lex_c.yy.c sse_lex_c .PHONY: all clean diff --git a/feed/sse-lex-c.l b/feed/sse-lex-c.l deleted file mode 100644 index 52f46a7..0000000 --- a/feed/sse-lex-c.l +++ /dev/null @@ -1,109 +0,0 @@ -/* --*-c-*-- $Id$ */ - -%{ - -#include - - -%} - -%Start DEF CCOMMENT CPPCOMMENT STRING STRINGESC CHAR CHARESC PREPROC - -IDCHAR [_a-zA-Z0-9] -NIDCHAR [^_a-zA-Z0-9] - -%% - - BEGIN DEF; - -^#ifn?def | -^#if | -^#define | -^#undef ; - -^#. { BEGIN CPPCOMMENT; } - -"/*" { BEGIN CCOMMENT; } -"*/" { BEGIN DEF; } -\n | -. ; - -"//" { BEGIN CPPCOMMENT; } -\n { BEGIN DEF; } -. ; - -"\"" { BEGIN STRING; } -"\\" { BEGIN STRINGESC; } -"\"" { BEGIN DEF; } -. | -\n ; -. { BEGIN STRING; } - -"'" { BEGIN CHAR; } -"\\" { BEGIN CHARESC; } -"'" { BEGIN DEF; } -\n | -. ; -. { BEGIN CHAR; } - -auto{NIDCHAR} | -break{NIDCHAR} | -case{NIDCHAR} | -char{NIDCHAR} | -const{NIDCHAR} | -continue{NIDCHAR} | -default{NIDCHAR} | -do{NIDCHAR} | -double{NIDCHAR} | -else{NIDCHAR} | -enum{NIDCHAR} | -extern{NIDCHAR} | -float{NIDCHAR} | -for{NIDCHAR} | -goto{NIDCHAR} | -if{NIDCHAR} | -int{NIDCHAR} | -long{NIDCHAR} | -register{NIDCHAR} | -return{NIDCHAR} | -short{NIDCHAR} | -signed{NIDCHAR} | -sizeof{NIDCHAR} | -static{NIDCHAR} | -struct{NIDCHAR} | -switch{NIDCHAR} | -typedef{NIDCHAR} | -union{NIDCHAR} | -unsigned{NIDCHAR} | -void{NIDCHAR} | -volatile{NIDCHAR} | -while{NIDCHAR} { yyless(yyleng-1); } - -[a-zA-Z_][a-zA-Z_0-9]{3,} { printf("%s\n", yytext); } - -[0-9]+ ; -0x[0-9a-fA-F]+ ; - -"\n" | -. ; - -%% - -int main(int argc, char *argv[]) { - - if (argc <= 1) - yylex(); - else { - int i; - - for (i = 1; i < argc; i++) { - if (!(freopen(argv[i], "r", stdin))) { - fprintf(stderr, "Failed to open file: %s\n", strerror(errno)); - return 1; - } - yylex(); - } - } - - return 0; -} diff --git a/feed/sse_lex_c.l b/feed/sse_lex_c.l new file mode 100644 index 0000000..52f46a7 --- /dev/null +++ b/feed/sse_lex_c.l @@ -0,0 +1,109 @@ +/* --*-c-*-- $Id$ */ + +%{ + +#include + + +%} + +%Start DEF CCOMMENT CPPCOMMENT STRING STRINGESC CHAR CHARESC PREPROC + +IDCHAR [_a-zA-Z0-9] +NIDCHAR [^_a-zA-Z0-9] + +%% + + BEGIN DEF; + +^#ifn?def | +^#if | +^#define | +^#undef ; + +^#. { BEGIN CPPCOMMENT; } + +"/*" { BEGIN CCOMMENT; } +"*/" { BEGIN DEF; } +\n | +. ; + +"//" { BEGIN CPPCOMMENT; } +\n { BEGIN DEF; } +. ; + +"\"" { BEGIN STRING; } +"\\" { BEGIN STRINGESC; } +"\"" { BEGIN DEF; } +. | +\n ; +. { BEGIN STRING; } + +"'" { BEGIN CHAR; } +"\\" { BEGIN CHARESC; } +"'" { BEGIN DEF; } +\n | +. ; +. { BEGIN CHAR; } + +auto{NIDCHAR} | +break{NIDCHAR} | +case{NIDCHAR} | +char{NIDCHAR} | +const{NIDCHAR} | +continue{NIDCHAR} | +default{NIDCHAR} | +do{NIDCHAR} | +double{NIDCHAR} | +else{NIDCHAR} | +enum{NIDCHAR} | +extern{NIDCHAR} | +float{NIDCHAR} | +for{NIDCHAR} | +goto{NIDCHAR} | +if{NIDCHAR} | +int{NIDCHAR} | +long{NIDCHAR} | +register{NIDCHAR} | +return{NIDCHAR} | +short{NIDCHAR} | +signed{NIDCHAR} | +sizeof{NIDCHAR} | +static{NIDCHAR} | +struct{NIDCHAR} | +switch{NIDCHAR} | +typedef{NIDCHAR} | +union{NIDCHAR} | +unsigned{NIDCHAR} | +void{NIDCHAR} | +volatile{NIDCHAR} | +while{NIDCHAR} { yyless(yyleng-1); } + +[a-zA-Z_][a-zA-Z_0-9]{3,} { printf("%s\n", yytext); } + +[0-9]+ ; +0x[0-9a-fA-F]+ ; + +"\n" | +. ; + +%% + +int main(int argc, char *argv[]) { + + if (argc <= 1) + yylex(); + else { + int i; + + for (i = 1; i < argc; i++) { + if (!(freopen(argv[i], "r", stdin))) { + fprintf(stderr, "Failed to open file: %s\n", strerror(errno)); + return 1; + } + yylex(); + } + } + + return 0; +} -- cgit