summaryrefslogtreecommitdiff
path: root/examples/manual/user_act.lex
diff options
context:
space:
mode:
authorSehong Na <sehong.na@samsung.com>2014-05-31 12:40:18 +0900
committerSehong Na <sehong.na@samsung.com>2014-05-31 12:40:18 +0900
commitf26ae5dce708cf4896a13cd65307c905f8365546 (patch)
treeb0e1a9836782fbe6133836f1e687d10c165f55f5 /examples/manual/user_act.lex
downloadflex-f26ae5dce708cf4896a13cd65307c905f8365546.tar.gz
flex-f26ae5dce708cf4896a13cd65307c905f8365546.tar.bz2
flex-f26ae5dce708cf4896a13cd65307c905f8365546.zip
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]);
+ }
+ }
+}
+
+
+
+