All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.snapscript.compile.verify.ExecutableVerifier Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version
package org.snapscript.compile.verify;
import java.util.ArrayList;
import java.util.List;

import org.snapscript.core.trace.Trace;
import org.snapscript.core.trace.TraceErrorCollector;

public class ExecutableVerifier extends TraceErrorCollector implements Verifier {
   
   private final List errors;
   
   public ExecutableVerifier() {
      this.errors = new ArrayList();
   }

   @Override
   public void compileError(Exception cause, Trace trace) {
      VerifyError error = new VerifyError(cause, trace);
      errors.add(error);
   }
   
   public void verify(){
      if(!errors.isEmpty()) {
         throw new VerifyException("Compilation errors found " + errors, errors);
      }
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy