Package org.xmlvm

Examples of org.xmlvm.IllegalXMLVMException


  private List<OutputFile> createBytecode(Document document, String path) throws IllegalXMLVMException, IOException
  {
    List<OutputFile> result= new ArrayList<OutputFile>();
    Element root= document.getRootElement();
    if (!root.getName().equals("xmlvm"))
      throw new IllegalXMLVMException("Root element needs to be <xmlvm>");
    @SuppressWarnings("unchecked")
    List<Element> clazzes= root.getChildren("class", nsXMLVM);

    for (Element clazz : clazzes)
    {
      if (clazz == null)
        throw new IllegalXMLVMException("XMLVM contains no class");
      createClass(clazz);
      for (Object o : clazz.getChildren())
      {
        Element decl= (Element) o;
        String tag= decl.getName();
        if (tag.equals("method"))
          createMethod(decl);
        else if (tag.equals("field"))
          createField(decl);
        else
          throw new IllegalXMLVMException("Unknown class declaration '" + tag + "'");
      }

      String packageName= clazz.getAttributeValue("package");

      // If there is a package name, then create necessary
View Full Code Here


        opcMeth= appClazz.getDeclaredMethod(opcMethodName, paramTypes);
        newInstr= opcMeth.invoke(this, params);
      }
      catch (NoSuchMethodException ex)
      {
        throw new IllegalXMLVMException("Illegal instruction 1, unable to find method " + opcMethodName + " for '" + name + "'");
      }
      catch (InvocationTargetException ex)
      {
        ex.printStackTrace();
        throw new IllegalXMLVMException("Illegal instruction 2 '" + name + "'");
      }
      catch (IllegalAccessException ex)
      {
        throw new IllegalXMLVMException("Illegal instruction 3 '" + name + "'");
      }
      if (newInstr != null)
      {
        InstructionHandle ih= null;
        if (newInstr instanceof BranchInstruction)
View Full Code Here

    else if (type == Type.DOUBLE)
      return new PUSH(constantPoolGen, Double.parseDouble(value));
    else if (type == Type.LONG)
      return new PUSH(constantPoolGen, Long.parseLong(value));
    else
      throw new IllegalXMLVMException(inst.getName() + " with bad type '" + t + "'");
  }
View Full Code Here

TOP

Related Classes of org.xmlvm.IllegalXMLVMException

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.