Currently I need to create a collection of classes representing nodes (fragments) of the AST (abstract abstract tree) of an interpreter. Now, for example, I'll give an overview of C ++ templates and try to declare two members ( left
and right
) for a ASSIGNOP
class, which would be both nodes.
#ifndef AST_H
#define AST_H
struct ast
{
template<typename T>
class ASSIGNOP
{
public:
T *left;
T *right;
}
} Ast;
#endif
I did not test this code because I have to learn how to use make yet ...
So, the problem is that ASSIGNOP
members are not considered nodes (I still do not know much about templates). I need to make them forced to be one of the classes within Ast
. How could I do that?