#ifndef DPUSER2C_TOOLS_H
#define DPUSER2C_TOOLS_H

#include "utils.h"
#include "dpstring.h"
#include "dpuserType.h"
#include <vector>

//using namespace std;
extern std::vector<std::string> output;
extern std::vector<std::string> tools_variables;      // in parser/y.tab.cpp exists also a conValue named variables
extern std::vector<std::string> constants_variables;
extern std::vector<std::string> arguments;
extern int bracketcounter;
extern bool idlcode;
extern char ___tmpcounter;
extern std::string tmpvar;
extern std::string preline;
//extern FILE* cppFileHandler;
//extern FILE* cppFileHandlerIdl;

void eatCcomment(char *src);
void eatCCcomment(char *src);
void eatIDLComment(char *src);
void IDLtoDPUSERcommands(dpString &src);
std::string extractVariable(const char *str);
void addLineToOutput(const std::string &what);
//void flushOutput(FILE* ofd);
void flushOutput(dpString name, dpString cCode = "");
char *tweakInput(char *buf);
bool isVariable(const char *src);
//dpStringList splitIntoLines(const char sep, dpString source);
std::string extractsetvar(const char *str);
std::string createRangeArguments(const char *str);
std::string createRange(const char *str);
std::string CREATErange(const char *str);
std::string extractRangeArguments(const char *str);
std::string extractWhereArguments(const char *str);
std::string insertTabs();
std::string renameFunction(const char *str);
std::string renameProcedure(const char *str);
std::string createTName(void);
std::string ExtractRangeArgs(char *str);
std::string CreateRangeArgs(char *str);
int nrCommas(dpString str);

void createInfo(const funcorproc_ID type, const int nargs, const std::string name, const std::string displaySyntax);

void compileCcode(char *fname);

#endif /* DPUSER2C_TOOLS_H */
