資源簡介
IF-ELSE條件語句的翻譯程序設計(簡單優先法、輸出四元式)
代碼片段和文件信息
#include?
#include?
#include?
#include
#include
#include
#include
#include
using?namespace?std;
#define?STACK_INIT_SIZE??50?
#define?STACKINCREMENT???30?
#define?OK?1?
#define?ERROR?-1?
#define?FAILURE?-1?
//////////////////////////////////////
/*
(1)S->if?E?then?B?else?B
(2)E->(A>A)
(3)E->(A(4)E->(A)
(5)A->d
(6)A->num
(7)B->{d=C}
(8)C->A+A
(9)C->A-A
(10)C->A*A
(11)C->A/A
(12)C->A
*////////////////////////////////////////
int?lineno?=?1;
char?ch?;?
int?anltable[22][22]={
/*S*/ {0000000000000000000002}
/*if*/ {0030001000000000000000}
/*E*/ {0003000000000000000000}
/*then*/{000030000000000100
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????539??2010-01-08?11:31??Compiler\Compiler.dsw
?????文件??????33792??2010-01-08?11:43??Compiler\Compiler.ncb
?????文件???????1262??2010-01-08?11:41??Compiler\Compiler.plg
?????文件??????????0??2010-01-08?11:31??Compiler\fsd
?????文件??????13094??2010-01-08?11:34??Compiler\main.cpp
?????文件??????53760??2010-01-08?11:43??Compiler\Compiler.opt
?????文件???????4304??2010-01-08?11:43??Compiler\Compiler.dsp
?????目錄??????????0??2010-01-09?02:15??Compiler
-----------?---------??----------?-----??----
???????????????106751????????????????????8
評論
共有 條評論