Debian Referenz v2.124von FleX erzeugt wird. Here is an example to create a simple terminal calculator program. Let’s create example.y: /* calculator source for bison */ %{ #includeextern int yylex(void); extern int yyerror(char *s) { fprintf(stderr, ”error: ’%s’\n”, s); } Let’s create, example.l: /* calculator source for flex */ %{ #include ”example.tab.h” %} %% [0-9]+ { printf(”L: NUMBER = %s\n”, yytext); 0 码力 | 289 页 | 1.44 MB | 1 年前3
共 1 条
- 1













