ICPC 2024 / std.easygen.h

ru en cn

с начала прошло: 17:31
страница обновлена: 25.11.2024 07:00

std.easygen.h: easygen.h

#pragma once

#include 
#include 
#include 
#include 
#include 
#include 
#include 

using namespace std;

extern "C" {
   #include "parser.h"
}

class genError
{
   string err1;
public:
   genError(const string& s): err1(s) {}
   string err() {return err1;}
   static void processParseError();
};

class prxRecord
{
   friend class testInfo;
   friend class prxObject;
   recWithData a;
   prxRecord() {a.recPart = 0; a.pointerToData = 0;}
   prxRecord(const recWithData& b) : a(b) {};
public:
   prxObject operator [] (const string& name);
   void print();
   void autoGen();
};
            
class prxObject
{
   friend class prxRecord;
   objWithData a;
   prxObject(const objWithData& b) : a(b) {};
public:
   prxRecord operator [] (int index);
   INT64 operator = (const INT64& value);
   int operator = (const int& value);
   string operator = (const string& value);
   real operator = (const real& value);
   operator INT64();
   operator int();
   operator real();
   operator string();
   void print();
   void autoGen();
};

class testInfo
{
   map params;
   prxRecord desc;
   char* buf;
public:
   testInfo(int argc, char* argv[]);
   ~testInfo();
   char* loadFormatFile(const string& fileName);
   void paramsToVars();
   INT64 getIntParam(const string& name);
   real getFloatParam(const string& name);
   prxObject operator [](const string& name);
   void print();
   void autoGen();
};
Дальневосточный федеральный университет