Interface ProgramValidationLogic

  • All Known Implementing Classes:
    BaseValidationLogic

    public interface ProgramValidationLogic
    A logic for validating Programs. Depending on the language, different requirements on inheritance hierarchies or code members' signatures can be required: those are to be implemented inside the validateAndFinalize(Program) method, that should throw a ProgramValidationException whenever such requirements are not met.
    • Method Detail

      • validateAndFinalize

        void validateAndFinalize​(Program program)
                          throws ProgramValidationException
        Validates the given Program, ensuring its consistency. This identifies erroneous situations (e.g., code members with the same signature) that can crash the analysis. During validation, the program is also finalized by populating additional data structures (e.g., computing the instances of all CompilationUnits defined in the program).
        Parameters:
        program - the program to validate
        Throws:
        ProgramValidationException - if the program has an invalid structure