source: trunk/essentials/sys-devel/flex/examples/manual/replace.lex

Last change on this file was 3031, checked in by bird, 18 years ago

flex 2.5.33.

File size: 529 bytes
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
10char lower_replace[1024];
11char 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
23int 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.