summaryrefslogtreecommitdiff
path: root/examples/manual/user_act.lex
blob: 156d5f91a5745302680e56543e21a127c9889ff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
%{

#include <ctype.h>

void user_action(void);

#define YY_USER_ACTION user_action();

%}

%%

.*         ECHO;
\n         ECHO;

%%

void user_action(void)
{
  int loop;
  
  for(loop=0; loop<yyleng; loop++){
    if(islower(yytext[loop])){
       yytext[loop] = toupper(yytext[loop]);
    }
  }
}