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.List;
import java.util.concurrent.CopyOnWriteArrayList;

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 CopyOnWriteArrayList();
   }

   @Override
   public void compileError(Exception cause, Trace trace) {
      VerifyError error = new VerifyError(cause, trace);
      errors.add(error);
   }

   @Override
   public void verify(){
      if(!errors.isEmpty()) {
         throw new VerifyException("Compilation errors found " + errors, errors);
      }
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy