-
-
Save lengyijun/668e2e74fbe4aaf2b73bbf8ad95b87cc to your computer and use it in GitHub Desktop.
flex get start!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%{ | |
#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();} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
flex a.l
gcc lex.yy.c -lfl
cat a.log | ./a.out