C/C++の宿題を片付けます 93代目 at TECH
[2ch|▼Menu]
886: ◆TDJK/P.926
07/07/25 18:20:42
>>885 続き

※lexファイル:ch3-05.l
%{
#include "y.tab.h"
#include "ch3-05.h"
#include <math.h>
%}
%%
([0-9]+|([0-9]*\.[0-9]+)([eE][-+]?[0-9]+)?) {
yylval.dval = atof(yytext);
return NUMBER; }
[ \t] ; /* ignore white space */
[A-Za-z][A-Za-z0-9]* { /* return symbol pointer */
struct symtab *sp = symlook(yytext);
yylval.symp = sp;
return NAME;
}
"$" { return 0; /* end of input */ }
\n |
. return yytext[0];
%%
yyerror(char *errmsg)
{
fprintf(stderr,"ERROR: %s at %s\n", errmsg, yytext);
}
yywrap(){}


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5377日前に更新/328 KB
担当:undef