summaryrefslogtreecommitdiff
path: root/examples/manual/user_act.lex
diff options
context:
space:
mode:
Diffstat (limited to 'examples/manual/user_act.lex')
-rw-r--r--examples/manual/user_act.lex31
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/manual/user_act.lex b/examples/manual/user_act.lex
new file mode 100644
index 0000000..156d5f9
--- /dev/null
+++ b/examples/manual/user_act.lex
@@ -0,0 +1,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]);
+ }
+ }
+}
+
+
+
+