Package AGEval

Examples of AGEval.InvalidGrammarException


      }

      ALEParser.ExtendedVertex ev = Generator.lookupAttributeExtended(arg, assign._class, ast);

      if (ev != null && ev.isMaybeType) {
        throw new InvalidGrammarException(
            "'maybe' types not currently implemented in OpenCL backend. Yell at Matt.");
      } else {
        params.append(OpenCLFieldsHelper.typeStringToOclType(Generator.extendedGet(ast, assign._class,
            arg).strType));
      }
View Full Code Here


  }

  @Override
  public String childrenRecur(Class cls, String childName, int visitNum, ALEParser ast)
      throws InvalidGrammarException {
    throw new InvalidGrammarException("Recursion not supported in OpenCL backend");
  }
View Full Code Here

    throw new InvalidGrammarException("Recursion not supported in OpenCL backend");
  }

  @Override
  public String childRecur(Class cls, String childName, int visitNum) throws InvalidGrammarException {
    throw new InvalidGrammarException("Recursion not supported in OpenCL backend");
  }
View Full Code Here

      Vector<HashSet<AGEval.Class>> buSubInorderBus) throws InvalidGrammarException {
    // OpenCL does not (yet) do suborder traversals
    if (buSubInorderBuIns != null && buSubInorderBuIns.size() > 0) {
      for (HashSet<AGEval.Class> suborder : buSubInorderBuIns) {
        if (suborder != null) {
          throw new InvalidGrammarException("SubOrder traversals not supported in OpenCL");
        }
      }
    }
    if (buSubInorderBus != null && buSubInorderBus.size() > 0) {
      for (HashSet<AGEval.Class> suborder : buSubInorderBus) {
        if (suborder != null) {
          throw new InvalidGrammarException("SubOrder traversals not supported in OpenCL");
        }
      }
    }

    StringBuilder contents = new StringBuilder();
View Full Code Here

      if (stencil.equals("td")) {
        contents.append("\tTraverseTopDown(" + visit_name + ");\n");
      } else if (stencil.equals("bu")) {
        contents.append("\tTraverseBottomUp(" + visit_name + ");\n");
      } else {
        throw new InvalidGrammarException("Unsupported traversal order: " + stencil);
      }

      contents.append("}\n\n\n");
    }

    // Now write the render traversal
    contents.append("void CLRunner::RunPass" + (visits.length - 1) + "(cl::Buffer& render_buffer) {\n");

    String visit_name = "visit_" + (visits.length - 1);

    contents.append("\t// Get references to our kernels we have compiled previously\n");
    contents.append("\tcl::Kernel " + visit_name + " = cl::Kernel(_program, \"" + visit_name + "\");\n\n");
    contents.append("\tSetKernelArguments(" + visit_name + ");\n");

    // Set the render buffer, which will be the (num buffers) + 1 arguments,
    // since tree_size is the first.
    contents.append("\t" + visit_name + ".setArg(" + (fields.getBuffers().size() + 2)
        + ", render_buffer);   // __global VertexAndColor* glBuffer\n\n");

    // TODO: Rewrite in-order traversal to top-down/bottom-up?
    String stencil = visits[visits.length - 1].arg(2).arg(1).toString();
    if (stencil.equals("td")) {
      contents.append("\tTraverseTopDown(" + visit_name + ");\n");
    } else if (stencil.equals("bu")) {
      contents.append("\tTraverseBottomUp(" + visit_name + ");\n");
    } else {
      throw new InvalidGrammarException("Unsupported traversal order: " + stencil);
    }

    contents.append("}\n\n\n");

    return contents.toString();
View Full Code Here

 
 
  //stripFloats: if true, 0.0f => 0.0
  public AleFrontend (String aleGrammar, boolean runStaticChecks, boolean stripFloats) throws IOException, RecognitionException, InvalidGrammarException {
    if (aleGrammar.contains("USCORE"))
            throw new InvalidGrammarException("USCORE token is reserved for advanced underscore handling!");
   
   
    if (runStaticChecks) {
      FrontendBeta.checkGrammar(aleGrammar);
      System.out.println("  (checks pass)");
View Full Code Here

TOP

Related Classes of AGEval.InvalidGrammarException

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.