1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
#include <iostream>
#include <fstream>
#include <sstream>
#include <regex>
#include <random>
#include <string>
#include <vector>
using std:: cout;
using std:: cerr;
using std:: endl;
using std:: cin;
using std:: ifstream;
using std:: istringstream;
using std:: default_random_engine;
using std::uniform_int_distribution;
using std:: bind;
using std:: regex_match;
using std:: regex;
using std:: cmatch;
using std:: smatch;
using std:: string;
using std:: vector;
class Token
{
string Name, Type;
long Line, Column;
public:
Token(string name, string type, long line, long column)
: Name(name), Type(type), Line(line), Column(column) {}
void SetName (string name) { Name = name; }
void SetType (string type) { Type = type; }
void SetLine (long line) { Line = line; }
void SetColumn (long column) { Column = column; }
string GetName () { return Name; }
string GetType () { return Type; }
long GetLine () { return Line; }
long GetColumn () { return Column; }
};
constexpr unsigned int Str2Int(const char *Line, int CurrentPos = 0)
{
return !Line[CurrentPos] ? 5381 : (Str2Int(Line, CurrentPos + 1) * 33) ^ Line[CurrentPos];
}
void Log(int Line)
{
static int Current = 1;
cout<<"Log ("<< Current++ <<") @ Line: "<< Line << endl;
}
void Help ();
void Version ();
void About ();
void Lex (vector<vector<string>>, vector<Token>);
int main(int argc, char *argv[])
{
vector<string> Arguments(argv + 1, argv + argc);
vector<string> FileList;
for(auto &Counter : Arguments)
{
switch(Str2Int(Counter.c_str()))
{
case Str2Int("--help"):
Help();
break;
case Str2Int("--version"):
Version();
break;
case Str2Int("--about"):
About();
break;
default:
FileList.push_back(Counter);
}
}
ifstream File;
vector<vector<string>> FileContents(0);
for(int Counter(0); Counter < FileList.size(); Counter++)
{
File.open(FileList[Counter]);
FileContents.resize(FileContents.size() + 1);
string Line;
while(getline(File, Line))
FileContents[Counter].push_back(Line);
File.close();
}
vector<Token> TokenList;
Lex(FileContents, TokenList);
cout<< (char) 5381 << endl;
}
void Help()
{
}
void Version()
{
}
void About()
{
}
void Lex(vector<vector<string>> FileContents, vector<Token> TokenList)
{
}
|