[Solved] Store function name with attributes in hash table


Looks like you are going to need to use structures or classes.

I’ll give you my take on a parameter and you can expand to a function.

A function parameter has a name and a type:

struct Function_Parameter
{
  std::string name;
  std::string type;
};

A function also has-a name and a return type:

struct Function_Token
{
  std::string name;
  std::string return_type;
};

A function can have zero or more parameters. Thus usually means a container of some sort. So, use a std::vector:

struct Function_Token
{
  std::string name;
  std::string return_type;
  std::vector<Function_Parameter> parameters;
};

Many compilers may convert names into numeric values (using some kind of hash function or table). This usually speeds up compilations because strings take a long time to compare.

solved Store function name with attributes in hash table