main.cc

来自「编译原理课程设计之pp2语法分析程序」· CC 代码 · 共 37 行

CC
37
字号
/* File: main.cc * ------------- * This file defines the main() routine for the program and not much else. * You should not need to modify this file. */ #include <string.h>#include <stdio.h>#include "utility.h"#include "parser.h"extern Program *program;/* * Function: main() * ---------------- * Entry point to the entire program.  We parse the command line and turn * on any debugging flags requested by the user when invoking the program. * InitScanner() is used to set up the scanner. * InitParser() is used to set up the parser. The call to yyparse() will * attempt to parse a complete program from the input.  */int main(int argc, char *argv[]){    ParseCommandLine(argc, argv);//定义在utility.cc      InitScanner();//scanner.l    InitParser(); //parse.y    if (yyparse() == 0) /* parsing worked */    {	    program->PrintChildren(0);	    return 0;    }    else return -1;    return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?