/* Fastest version of wc: add rules to pick up newlines, too */ ws [ \t] nonws [^ \t\n] word {ws}*{nonws}+ words {word}{…
Kinetis+L系列 源代码
汇集 Kinetis+L系列 相关的电路原理图、PCB工程文件、单片机/FPGA源代码、数据手册与应用设计方案。
/* First cut at a flex-based "wc" tool. */ ws [ \t] nonws [^ \t\n] %% int cc = 0, wc = 0, lc = 0; {nonws}+ cc += yy…
/* Somewhat faster "wc" tool: match more text with each rule */ ws [ \t] nonws [^ \t\n] word {ws}*{nonws}+ %% int cc…
/* Somewhat faster still: potentially match a lot of text with each rule */ ws [ \t] nonws [^ \t\n] word {ws}*{nonws}+ w…
%{ {* 下面的例子改编自lex和yacc第二版 对单词计数,并可以统计多个文件 编译:lex wordcount2 wordcnt2.dpr 用法: wordcnt2 或者 wordcnt2 wordcount.l wor…
%{ program CommandLine2.dpr; {$APPTYPE CONSOLE}//注意别忘了指定控制台模式 uses //CommandLex单元是改写后的LexLib,重定义了get_char, unget_char和put_char…
%{ (* 演示状态的用法,这个示例故意做成不能运行 *) program Magic2; {$APPTYPE CONSOLE} uses SysUtils, LexLib; %} %s MAGIC %% magic Start(MAGIC)…
%{ {* 下面的例子改编自lex和yacc第二版 识别简单算术表达式的lex 用法:Lex Expression3 ExpressionL3 *} unit ExpressionL3; interface uses S…
%{ {* 下面的例子改编自lex和yacc第二版 识别简单算术表达式的lex 用法:Lex Expression ExpressionL.dpr *} unit ExpressionL2; interface uses …