📄 mylexer.l
字号:
%{
/****************************************************************************
mylexer.l
ParserWizard generated Lex file.
Date: 2007年12月5日
****************************************************************************/
#include "string.h"
#include "myparser.h"
#include "ctype.h"
#include "mylexer.h"
extern int yylval;
%}
/////////////////////////////////////////////////////////////////////////////
// declarations section
// place any declarations here
%%
/////////////////////////////////////////////////////////////////////////////
// rules section
[0-9]+ { int i = 0;yylval = 0; while (yytext[i]) {yylval = yylval * 10 + yytext[i] - '0'; i++; } return(NUMBER);}
"+" {return PLUS;}
"-" { return MINUS; }
"*" { return TIMES; }
"(" { return LEFT; }
")" { return RIGHT; }
"." {return 0;}
// place your Lex rules here
%%
/////////////////////////////////////////////////////////////////////////////
// programs section
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -