Skip to content

Instantly share code, notes, and snippets.

@lengyijun
Created October 24, 2017 15:25
Show Gist options
  • Save lengyijun/668e2e74fbe4aaf2b73bbf8ad95b87cc to your computer and use it in GitHub Desktop.
Save lengyijun/668e2e74fbe4aaf2b73bbf8ad95b87cc to your computer and use it in GitHub Desktop.
flex get start!!
%{
#include<stdio.h>
#include<ctype.h>
#ifndef FALSE
#define FALSE
#endif
#ifndef TRUE
#define TRUE
#endif
%}
%%
[A-Z] {putchar(tolower(yytext[0]));}
%%
void main(void){yylex();}
@lengyijun
Copy link
Author

flex a.l
gcc lex.yy.c -lfl
cat a.log | ./a.out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment