资源简介

PL0符号表输出及分析,几乎每行带注释,下载之后即可看见.h和.c文件,可直接编译运行(如dev-c++、vs)

资源截图

代码片段和文件信息

/*
 * PL/0 complier program for win32 platform (implemented in C)
 *
 * The program has been test on Visual C++ 6.0 Visual C++.NET and
 * Visual C++.NET 2003 on Win98 WinNT Win2000 WinXP and Win2003
 *
 * 使用方法:
 * 运行后输入PL/0源程序文件?
 */

#include 
#include 
#include “pl0_Nametable.h“
#include “string.h“

// 分割符,0表示0个‘--‘,1表示1个,以此类推
int Tree_level[500];
// 存单词
char* Tree[500]; 
// 数单个个数
int word_num = 0;

void Gen_grammerTree(){
int i=0; 
printf(“\nGrammer Tree\n“);
    for(i=0 ; i        switch (Tree_level[i])
    {
    case 0:
     printf(“%s\n“Tree[i]);
        break;
    case 1:
     printf(“--%s\n“Tree[i]);
        break;
    case 2:
        printf(“----%s\n“Tree[i]);
        break;
    case 3:
        printf(“------%s\n“Tree[i]);
        break;
    case 4:
        printf(“--------%s\n“Tree[i]);
        break;
    case 5:
        printf(“----------%s\n“Tree[i]);
        break;
    case 6:
        printf(“------------%s\n“Tree[i]);
        break;
    case 7:
        printf(“--------------%s\n“Tree[i]);
        break;
    case 8:
        printf(“----------------%s\n“Tree[i]);
        break;
    case 9:
        printf(“------------------%s\n“Tree[i]);
        break;
    case 10:
        printf(“--------------------%s\n“Tree[i]);
        break;
    case 11:
        printf(“----------------------%s\n“Tree[i]);
        break;
    case 12:
        printf(“------------------------%s\n“Tree[i]);
        break;
    case 13:
        printf(“--------------------------%s\n“Tree[i]);
        break;
    case 14:
        printf(“----------------------------%s\n“Tree[i]);
        break;
    case 15:
        printf(“------------------------------%s\n“Tree[i]);
        break;
    case 16:
        printf(“--------------------------------%s\n“Tree[i]);
        break;
            case 17:
                printf(“----------------------------------%s\n“Tree[i]);
                break;
            case 18:
                printf(“------------------------------------%s\n“Tree[i]);
                break;
            case 19:
                printf(“--------------------------------------%s\n“Tree[i]);
                break;
            case 20:
                printf(“----------------------------------------%s\n“Tree[i]);
                break;
            case 21:
                printf(“------------------------------------------%s\n“Tree[i]);
                break;
            case 22:
                printf(“--------------------------------------------%s\n“Tree[i]);
                break;
            case 23:
                printf(“----------------------------------------------%s\n“Tree[i]);
                break;
            case 24:
                printf(“--------------------------------------------

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件       50323  2020-04-12 16:25  pl0_Nametable_ANSI.c
     文件        6352  2020-04-05 23:03  pl0_Nametable.h

评论

共有 条评论