1 Star 0 Fork 68

codeblack/compiler-homework6

forked from zren/compiler-homework6 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
calc.l 342 Bytes
Copy Edit Raw Blame History
codeblack authored 2016-06-16 20:00 . git commit
%option noyywrap
%{
#include <stdio.h>
#include <stdlib.h>
#define YY_DECL int yylex()
#include "calc.tab.h"
%}
%%
[ \t] ; // ignore all whitespace
[0-9]+ {yylval.ival = atoi(yytext); return T_INT;}
"+" {return T_PLUS;}
"(" {return T_LEFT;}
")" {return T_RIGHT;}
"#" {return T_END;}
"*" {return T_MULT;}
"-" {return T_MINUS;}
%%
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/blackland/compiler-homework6.git
git@gitee.com:blackland/compiler-homework6.git
blackland
compiler-homework6
compiler-homework6
master

Search