• 大小: 8KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-01-05
  • 语言: 其他
  • 标签: IF-ELSE  

资源简介

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


评论

共有 条评论