编译原理
文章平均质量分 69
dpfordor
这个作者很懒,什么都没留下…
展开
-
[VC MFC C++ flex bison] flex rules(规则)
`x match the character `x `. any character (byte) except newline `[xyz] a "character class"; in this case, the pattern matches either an `x, a `y, or a `z `[abj-oZ] a "character class" with a原创 2008-02-01 17:59:00 · 1122 阅读 · 0 评论 -
[VC MFC C++ flex bison] flex format
definitions%%rules%%user code name definitionThe "name" is a word beginning with a letter or an underscore (_) followed by zero or more letters, digits, _, or - (dash). The definition i原创 2008-02-01 18:01:00 · 956 阅读 · 0 评论 -
[VC Bison] 超强的多功能计算器
caculator.y%{#include #include #include #include "calc.h"void yyerror(char* s){ fprintf(stderr, "%s/n", s);}%}%union {double val;symrec* tptr;}%token NUM%token VAR FNCT%type exp%right原创 2008-01-31 23:32:00 · 1307 阅读 · 0 评论 -
[VC MFC C++ flex bison] flex 特别action
`ECHO copies yytext to the scanners output. BEGIN followed by the name of a start condition places the scanner in the corresponding start condition (see below). REJECT directs the原创 2008-02-01 18:07:00 · 1188 阅读 · 0 评论 -
[VC MFC C++ flex bison] flex example(Pascal-like language scanner)
//scanner.l%{/* need this for the call to atof() below */#include %}DIGIT [0-9]ID [a-z][a-z0-9]*%%{DIGIT}+ { printf( "An integer: %s (%d)/n", yytext, atoi(原创 2008-02-01 18:13:00 · 956 阅读 · 0 评论