⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scc.cpp

📁 这是一些于C++做的经典例子
💻 CPP
字号:
#include <stdio.h>

#include "SCC.H"


// Flex reads the 'yyin' file handle for input.  'yyin' will be defined in
// the generated scc-lexer.cpp file, so we'll need to extern the variable.
extern FILE *yyin;


int main( int argc, char **argv )
{
  // The usage for this program is pretty simple.  If no arguments are given
  // to the program, then it will expect input on stdin (this is the default
  // value of 'yyin').  If there was an argument specified, then this will
  // specify the source file name to read from.
  if ( argc == 2 ) {
    // Open the given file name for reading.
    yyin = fopen( argv[1], "r" );

    // If the file could not be opened, then inform the user and terminate the
    // program.
    if ( yyin == NULL ) {
      perror( argv[1] );
      return 1;
    }
  }

  // Call into Bison to tell it to parse the input file.
  yyparse();

  return 0;
}

⌨️ 快捷键说明

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