📄 file.l
字号:
%{#include<stdio.h>%}%%auto |break |case |char |const |continue |default |do |double |else |enum |extern |float |for |goto |if |int |long |register |return |short |signed |sizeof |static |struct |switch |typedef |union |unsigned |void |volatile |while { printf("%s :keyword\n",yytext);}[0-9]+ {printf("%s: integer",yytext);}[0-9]*[.][0-9]+ { printf("%s : floating point number\n",yytext);}[0-9]*[.] { printf("%s: invalid input\n",yytext);}['][a-zA-Z0-9]['] { printf("%s : character constant\n",yytext);}["][a-zA-Z0-9 ,./?=+-]*["] { printf("%s : string\n",yytext);}[/][/][A-Za-z0-9;, *#$%&!@()]*[\n] { printf("%s : comment line\n",yytext);}[/][*][A-Za-z0-9;, *#$%&!@()\n]*[*][/] { printf("%s : comment line\n",yytext);}[#][A-Za-z0-9<. ]*[>] { printf("%s : Header file\n",yytext);}[=] |[+][+] |[-][-] |[=][=] |[/] |[+] |[-] |[*] |[?] |[%] |[!] |[!][=] |[<] |[>] |[<][=] |[>][=] |[&] |[&][&] |[|][|] { printf("%s : operator\n",yytext);}[a-zA-Z]+[0-9]* { printf("%s : identifier\n",yytext);}[(] { printf("%s : left parenthesis\n",yytext);}[)] { printf("%s : right parenthesis\n",yytext);}[{] { printf("%s : left brace\n",yytext);}[}] { printf("%s : right brace\n",yytext);}[;] { printf("%s : semi-colon\n",yytext);}[,] { printf("%s : comma\n",yytext);}[[] { printf("%s : left array index\n",yytext);}[]] { printf("%s : right array index\n",yytext);}%%main(){ yylex();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -