validates class and function declarations