Package sg.edu.nus.comp.simTL.engine.exceptions

Examples of sg.edu.nus.comp.simTL.engine.exceptions.InterpreterException


    name2inputModelMap = new HashMap<String, IModel>();
   
    //#template.templateHeader
    EObject templateHeader = loadReferencedEObject(REFERENCE_templateHeader);
    if(templateHeader == null) {
      throw new InterpreterException("No TemplateHeader object in template");
    }
   
    //#template.templateHeader.modelImports
    loadModelImports(loadReferencedList(templateHeader, REFERENCE_modelImports));
   
View Full Code Here


    if(!(o instanceof EObject)){
      throw new ValidationException("No such element in " + method + "(might also be a list of instead of one model element)");
    }
    //Type check
    if(!methodCall.eClass().getName().matches(CLASS_TMETHODCALL)){
      throw new InterpreterException("EObject is no methodCall, but "+methodCall.eClass().getName()+" (evaluatePlaceHolderVariableCall)!");
    }
   
    EObject eo = (EObject)o;
    //#methodCall.methodName
    String methodName = loadAttribute(methodCall, REF_METHODNAME);
View Full Code Here

   * @return
   */
  private PlaceHolderReturnContainer evaluatePlaceHolderModelCall(IModel inputModel, EObject methodCall) throws SimTLException{
    //Type check
    if(!methodCall.eClass().getName().matches(CLASS_TMETHODCALL)){
      throw new InterpreterException("EObject is no methodCall, but "+methodCall.eClass().getName()+" (evaluatePlaceHolderModelCall)!");
    }
    //#methodCall.methodName
    String methodName = loadAttribute(methodCall, REF_METHODNAME);
    for(EObject eo : inputModel.getModelResource().getContents()){
      //lowerCase first letter
View Full Code Here

    }
    //find respective language class in this package
    //and instantiate it as EObject
    EObject iObject = EObjectCopier.instantiate(tObject.eClass(), iRootPackage);
    if(iObject==null){
      throw new InterpreterException("Didn't find respective template instance class for template class " + tObject.eClass().getName());
    }
   
    iObjectProxy.set(iObject);
    interpretedX2IMap.put(tObject,iObject);
   
View Full Code Here

    this.leftSideTraceLinkNode = leftSideTraceLinkNode;
    this.rightSideTraceLinkNode = rightSideTraceLinkNode;
    this.staticContext = staticContext;
   
    //Validate
    if(leftSideTraceLinkNode==null) throw new InterpreterException("leftSideTraceLinkNode is null. TraceLink pointing to nowhere.");
    if(rightSideTraceLinkNode==null) throw new InterpreterException("rightSideTraceLinkNode is null. TraceLink pointing to nowhere.");
   
    leftSideTraceLinkNode.setPartOfTraceLink(this);
    rightSideTraceLinkNode.setPartOfTraceLink(this);
  }
View Full Code Here

  public SimTLModel(ModelType modelType, String modelName, Resource model) throws SimTLException{
    this.modelType = modelType;
    this.model = model;
    listeners = new Vector<IModelChangedListener>();
    if(modelType == null){
      throw new InterpreterException("No modelType given");
    } else if(modelType == ModelType.INPUT_MODEL && modelName == null){
      throw new SimTLException("No name given for imported model");
    } else if(modelType == ModelType.TEMPLATE_MODEL
        && !(this instanceof ITemplate)){
      throw new InterpreterException("TEMPLATE_MODEL can only be built by an ITemplate instance");
    }
       
   
    //modelName
    if(modelType == ModelType.TEMPLATE_INSTANCE_MODEL && modelName == null) this.modelName = TEMPLATE_INSTANCE_MODEL_ID;
View Full Code Here

    if(varStack == null){
      log.error("No such variable on stack: "+name);
      return null;
    }
    if(varStack.isEmpty()){
      throw new InterpreterException("BUG: varStack is empty. Should not happen");
    }
    return varStack.lastElement();
  }
View Full Code Here

   * @throws SimTLException
   */
  public Template(Resource model) throws SimTLException {
    super(ModelType.TEMPLATE_MODEL,null);
    if(model == null){
      throw new InterpreterException("Template resource is null");
    } else if(model.getContents().size()==0){
      throw new InterpreterException("Template resource is empty");
    }
   
    //#template
    templateElement = new TTemplate(model.getContents().get(0));
   
View Full Code Here

TOP

Related Classes of sg.edu.nus.comp.simTL.engine.exceptions.InterpreterException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.