Implementation of enum handling

This implementation handles enum declaration made before any use inside any following interface declaration.
This should be improved so that it is not required to declare the enum before.