?? ll.h
字號:
#include "stdio.h"
#define SIZE 20
#define EMPTY 14
#define TABLE_SIZE 5
typedef struct table
...{
char head;
char pre[8][4];
}table;
char ExpressionStr[SIZE]; //Inputed Analysed Expression
char AnalysisStack[SIZE]; //Analysis Stack
unsigned char analysis_Index; //
unsigned char analy_Index; //Current TOP_Index of Expression
unsigned char exp_Index; //Current Bottom_Index of Expression
unsigned char step;
table tb[TABLE_SIZE]; //forcast table---------------
/** *//***************************************
@name: InitTable
@Describe: Initlize the forcast table
@Param: void
@Return: void
*****************************************/
void InitTable()
...{
// table E
tb[0].head = 'E';
strcpy(tb[0].pre[0], "GT");
strcpy(tb[0].pre[5], "GT");
//table G
tb[1].head = 'G';
strcpy(tb[1].pre[1], "GT+");
strcpy(tb[1].pre[2], "GT-");
strcpy(tb[1].pre[6], "~");
strcpy(tb[1].pre[7], "~");
//table T
tb[2].head = 'T';
strcpy(tb[2].pre[0], "SF");
strcpy(tb[2].pre[5], "SF");
//table S
tb[3].head = 'S';
strcpy(tb[3].pre[1], "~");
strcpy(tb[3].pre[2], "~");
strcpy(tb[3].pre[3], "SF*");
strcpy(tb[3].pre[4], "SF/");
strcpy(tb[3].pre[6], "~");
strcpy(tb[3].pre[7], "~");
//table F
tb[4].head = 'F';
strcpy(tb[4].pre[0], "i");
strcpy(tb[4].pre[5], ")E(");
}
/** *//***************************************
@name: PrintGenerate
@Describe: Printing Generate expression
@Param: void
@Return: void
*****************************************/
void PrintGenerate(char *ch)
...{
int i = 0;
for(i = strlen(ch) - 1; i >= 0; i--)
...{
printf("%c",ch[i]);
}
printf(" ");
}
/** *//*******************************************
*@name: Trace
*@Description: Format output
*@Param: void
*@Return: void
********************************************/
void Trace()
...{
int i = 0;
int j = 0;
printf(" ");
printf("%d ",step++);
while(AnalysisStack[i] != '
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -