Package noop.operations

Examples of noop.operations.NewProjectOperation


  @Test public void shouldRunTheHelloWorldProgram() throws Exception {
    UUID uuid = UUID.randomUUID();   
    Project project = new Project("Hello World", "com.example", "");
    project.addLibrary(new Library(uuid, "hello")).addFunction(new Function("go"));
    controller.addProject(new NewProjectOperation(project));
    repository.save(project);
    StandardLibraryBuilder stdLib = new StandardLibraryBuilder().build(controller);
    repository.save(stdLib.noop);

    InterpreterMain.main(new String[] {
View Full Code Here


    for (String libraryPath : options.getLibraryPaths()) {
      CommandLineLibraryNameParser parser = new CommandLineLibraryNameParser(libraryPath).invoke();
      Project project = parser.getProject();
      Library library = repository.load(project, parser.getLibraryName());
      project.addLibrary(library);
      controller.addProject(new NewProjectOperation(project));
    }

    Library mainLib = workspace.lookupLibrary(UUID.fromString(options.getMainLib()));
    if (mainLib == null) {
      throw new IllegalArgumentException("No library found with id " + options.getMainLib());
View Full Code Here

    Expression assertion = new MethodInvocation();
    unitTest.addStatement(assertion);
    // TODO: fill in assertion

    controller.apply(new NewProjectOperation(project));
    controller.apply(
        new NewEdgeOperation(sayHello, TYPEOF, stdLib.intClazz),
        new NewEdgeOperation(consoleDep, TYPEOF, stdLib.consoleClazz));
    controller.apply(new NewEdgeOperation(helloWorld, TYPEOF, stdLib.stringClazz));
    controller.apply(
View Full Code Here

    loop.setBody(body);

    Expression printValue = new MethodInvocation();
    body.addStatement(printValue);

    controller.apply(new NewProjectOperation(project));
    controller.apply(new NewEdgeOperation(i, TYPEOF, stdLib.intClazz));
    controller.apply(
        new NewEdgeOperation(terminateWhen, TARGET, i),
        new NewEdgeOperation(terminateWhen, INVOKE, stdLib.integerEquals),
        new NewEdgeOperation(terminateWhen, ARG, ten));
View Full Code Here

    entryPoint.addStatement(zero);

    Expression returnVal = new Return();
    entryPoint.addStatement(returnVal);
   
    controller.apply(new NewProjectOperation(project));
    controller.apply(
        new NewEdgeOperation(entryPoint, TYPEOF, stdLib.intClazz),
        new NewEdgeOperation(consoleDep, TYPEOF, stdLib.consoleClazz));
    controller.apply(
        new NewEdgeOperation(sum, INVOKE, stdLib.integerPlus),
View Full Code Here

    controller = new Controller(workspace, new VertexCreatingVisitor());
  }

  @Test public void shouldMakeNewProject() {
    Project project = new Project("helloWorld", "com.google", "");
    controller.apply(new NewProjectOperation(project));
    assertTrue(workspace.getProjects().contains(project));
  }
View Full Code Here

    p.addLibrary(l);
    Clazz c = new Clazz("c");
    l.addClazz(c);
    Method m = new Method("m");
    c.addBlock(m);
    controller.apply(new NewProjectOperation(p));

    Clazz c2 = new Clazz("c2");
    Method m2 = new Method("m2");
    c2.addBlock(m);
    c2.addBlock(m2);
View Full Code Here

  @Test public void shouldErrorWhenEditingWithWrongType() {
    Library l = new Library(UUID.randomUUID(), "l");
    p.addLibrary(l);
    Clazz c = new Clazz("c");
    l.addClazz(c);
    controller.apply(new NewProjectOperation(p));
   
    try {
      controller.apply(new EditNodeOperation(c.vertex, new StringLiteral("String is not Clazz")));
      fail("should throw IllegalArgumentException");
    } catch (IllegalArgumentException e) {
View Full Code Here

    intClazz.addBlock(integerEquals);

    Parameter integerPlusArg = new Parameter("i");
    integerPlus.addParameter(integerPlusArg);

    controller.apply(new NewProjectOperation(noop));
    controller.apply(new NewEdgeOperation(printMethod, TYPEOF, voidClazz));
    controller.apply(new NewEdgeOperation(printArg, TYPEOF, stringClazz));
    controller.apply(new NewEdgeOperation(integerPlus, TYPEOF, intClazz));
    controller.apply(new NewEdgeOperation(integerEquals, TYPEOF, booleanClazz));
    controller.apply(new NewEdgeOperation(integerPlusArg, TYPEOF, intClazz));
View Full Code Here

TOP

Related Classes of noop.operations.NewProjectOperation

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.