C_Tools.cpp
// C_Tools.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <fstream> #include <string> #include "lex.h" using namespace std; #define MAX_NO_OF_SCANNERS 255 class Lexer { int line_no; int token; int keyword; } L[MAX_NO_OF_SCANNERS]; /******** File reading API for testing framework *****/ int file_read(string input_file, string *str_line) { string line; unsigned int count_lines = 0; std::ifstream file(input_file.c_str()); // string str_line[100000]; if (file.is_open()) { while (getline(file, line)) { // str_line[count_lines] = new char[line.length()]; // memcpy(str_line[count_lines], line.c_str(), line.length()); str_line[count_lines] = line; #ifdef DEBUG cout << count_lines << str_line[count_lines] << endl; #endif count_lines++; } file.close(); } ...