Define a class Variables. It should contain the variable name, its type, the index in the symbol table, and constructors and destructors. Inherit that into SystemVariable and UserVariable. SystemVariable indicates the system process that has generated that variable. UserVariable indicates the user id that initiated that variable. Defi ne CompilerVariable as multiple inherited from SystemVariable and UserVariable. Defi ne a pointer to Variable class and use dynamic_cast to downcast it to a variable of type SystemVariable. Provide error messages if dynamic_cast fails. (It fails when the pointer is not actually pointing to SystemVariable class.)
#Sales Offer!| Get upto 25% Off: