Line | |
---|
1 | /*
|
---|
2 | * replace.lex : A simple filter for renaming
|
---|
3 | * parts of flex of bison generated
|
---|
4 | * scanners or parsers.
|
---|
5 | */
|
---|
6 |
|
---|
7 | %{
|
---|
8 | #include <stdio.h>
|
---|
9 |
|
---|
10 | char lower_replace[1024];
|
---|
11 | char upper_replace[1024];
|
---|
12 |
|
---|
13 | %}
|
---|
14 |
|
---|
15 | %%
|
---|
16 |
|
---|
17 | "yy" printf("%s",lower_replace);
|
---|
18 | "YY" printf("%s",upper_replace);
|
---|
19 | , ECHO;
|
---|
20 |
|
---|
21 | %%
|
---|
22 |
|
---|
23 | int main(int argc, char *argv[])
|
---|
24 | {
|
---|
25 | if(argc < 2){
|
---|
26 | printf("Usage %s lower UPPER\n",argv[0]);
|
---|
27 | exit(1);
|
---|
28 | }
|
---|
29 | strcpy(lower_replace,argv[1]);
|
---|
30 | strcpy(upper_replace,argv[2]);
|
---|
31 | yylex();
|
---|
32 | return(0);
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.