Examples of StatementList


Examples of net.sf.laja.parser.template.StatementList

    boolean ok2 = omList.initReferences(writer);
    if (ok) {
      ok = ok2;
    }

    StatementList statementList = new StatementList();
    defList.generateGrammar(false, false, 1, grammarName, omList, ovSet, outputList, grammarData, writer, parsingSettings, statementList);
    ok = defList.generateGrammar(false, false, 2, grammarName, omList, ovSet, outputList, grammarData, writer, parsingSettings, statementList);

    // ---
    // --- 4. Interfaces.
    // ---
    for (Iterator i = refList.iterator(); i.hasNext();) {
      ref = (Ref) i.next();

      Set<String> signatureSet = new HashSet<String>();
      for (Iterator j = omList.iterator(); j.hasNext();) {
        Outputmethod om = (Outputmethod)j.next();
        if (om.getClassName().equals(ref.getClassName())) {
          List<Omarg> omargList = om.getOmargList();
          String signature = om.getMethodSignature();

          if (signatureSet.contains(signature)) {
            writer.writeln("Error in row " + om.getRow() + ". Duplicate method signature:\n  " + om.getStatement());
            ok = false;
            break;
          }
          signatureSet.add(signature);
         
          ref.addOutputmethod(om);

          String name = om.getArgName();
          for (Omarg omarg : omargList) {
            if (omarg.getArg().equals(name)) {
              writer.writeln("Error in row " + om.getRow() + ". The variable names in the argument list must be unique:\n  " + om.getStatement());
              ok = false;
            }
          }
        }
      }
    }

    // TODO: L�gg in felmeddelande om class inte �r deklarerad.
    // Fill in missing class names.
    for (Iterator i = omList.iterator(); i.hasNext();) {
      Outputmethod om = (Outputmethod) i.next();
      if (om.getClassName() == null) {
        for (Iterator it = refList.iterator(); it.hasNext();) {
          ref = (Ref) it.next();
          if (ref.getRefname().equals(om.getRefname())) {
            om.setClass(ref.getClassName());
          }
        }
      }
    }

    // ---
    // --- 7. Output implementations.
    // ---
    List<Out> outList = new ArrayList<Out>();
    for (Output output : outputList.getList()) {
      for (int phase = 1; phase <= 2; phase++) {
        if (!output.isOutputClassUniqe(phase)) {
          continue;
        }
        List<Outputmethod> odlist = output.getList(phase);
        List<String> commentList = new ArrayList<String>();
        for (Outputmethod om : odlist) {
          if (output.isDefined()) {
            commentList.add(om.getStatement());
          }
        }
        Out out = new Out(phase, output.getClassName(phase), output.getArgClass(), commentList, output.isReceive(phase), output.isPushPop(phase));
        outList.add(out);
       
        output.writeSetStatement(phase, out);
      }
    }

    // ---
    // --- 8. Generate "variable" classes.
    // ---
    List<Varclass> varclassList = new ArrayList<Varclass>();
    for (Outputvar ov : ovSet.getSet()) {
      if (ref != null) {
        Varclass varclass = new Varclass(
            ov.isBoolean(),
            ov.getClassname(),
            ref.getClassName(),
            ov.getMethod());
        varclassList.add(varclass);
      }
    }

    return new GeneratorResult(grammarName, this, outputList.getList(),
        statementList.getList(), ovSet.getSet(), refList.getList(), outList, varclassList);
  }
View Full Code Here

Examples of org.jclouds.scriptbuilder.domain.StatementList

   @Named(ComputeServiceConstants.COMPUTE_LOGGER)
   protected Logger logger = Logger.NULL;
   private final StatementList statements;

   public InstallGuestAdditions(VmSpec vmSpecification, String vboxVersion) {
      this.statements = new StatementList(getStatements(vmSpecification, vboxVersion));
   }
View Full Code Here

Examples of org.jclouds.scriptbuilder.domain.StatementList

            iface = "eth3";
            break;
         default:
            throw new IllegalArgumentException("slot must be 0,1,2,3 (was: " + slot + ")");
      }
      this.statements = new StatementList(getStatements(iface));
   }
View Full Code Here

Examples of org.jclouds.scriptbuilder.domain.StatementList

         throw new RuntimeException("could not connect to virtualbox");
      }
      File file = new File(isosDir, fileName);
      List<Statement> statements = new ImmutableList.Builder<Statement>().add(
            Statements.saveHttpResponseTo(URI.create(httpUrl), isosDir, fileName)).build();
      StatementList statementList = new StatementList(statements);
      NodeMetadata hostNode = checkNotNull(hardcodedHostToHostNodeMetadata.apply(host.get()), "hostNode");
      ListenableFuture<ExecResponse> future = runScriptOnNodeFactory.submit(hostNode, statementList,
            runAsRoot(false));
      Futures.getUnchecked(future);
View Full Code Here

Examples of org.jclouds.scriptbuilder.domain.StatementList

            .updateExistingGems(bootstrapProperties.updateGems()) //
            .build();

      Statement installChef = InstallChefGems.builder().version(bootstrapProperties.chefVersion().orNull()).build();

      return new StatementList(InstallRuby.builder().build(), installRubyGems, installChef);
   }
View Full Code Here

Examples of org.jclouds.scriptbuilder.domain.StatementList

      }

      Set<? extends NodeMetadata> metadatas = null;

      if (!statements.isEmpty()) {
          options.runScript(new StatementList(statements));
      }

      try {
         metadatas = service.createNodesInGroup(group, number, builder.options(options).build());
      } catch (RunNodesException ex) {
View Full Code Here

Examples of org.jclouds.scriptbuilder.domain.StatementList

      ImmutableList<Statement> bootstrap = builder.build();
      if (!bootstrap.isEmpty()) {
         if (options.getTaskName() == null && !(options.getRunScript() instanceof InitScript)) {
            options.nameTask("bootstrap");
         }
         return bootstrap.size() == 1 ? bootstrap.get(0) : new StatementList(bootstrap);
      }

      return null;
   }
View Full Code Here

Examples of org.jclouds.scriptbuilder.domain.StatementList

    statements.add(createOrOverwriteFile(HIERA_COMMON_FILE_LOCATION, confHiera.build()));
    statements.add(createOrOverwriteFile(CONF_PP_FILE_LOCATION, confPp.build()));
    statements.add(createOrOverwriteFile(SITE_PP_FILE_LOCATION, sitePp.build()));
    statements.add(exec("puppet apply " + SITE_PP_FILE_LOCATION));

    return new StatementList(statements.build()).render(arg0);
  }
View Full Code Here

Examples of org.jclouds.scriptbuilder.domain.StatementList

   public static Statement version() {
      return exec(String.format("head -1 %s/VERSION.txt | cut -f1 -d ' '", JETTY_HOME));
   }

   public static Statement install() {
      return new StatementList(
            AdminAccess.builder().adminUsername("web").build(),
            InstallJDK.fromOpenJDK(),
            authorizePortInIpTables(),
            extractTargzAndFlattenIntoDirectory(JETTY_URL, JETTY_HOME),
            exec("chown -R web " + JETTY_HOME));
View Full Code Here

Examples of org.jclouds.scriptbuilder.domain.StatementList

            extractTargzAndFlattenIntoDirectory(JETTY_URL, JETTY_HOME),
            exec("chown -R web " + JETTY_HOME));
   }

   private static Statement authorizePortInIpTables() {
      return new StatementList(
            exec("iptables -I INPUT 1 -p tcp --dport " + port + " -j ACCEPT"),
            exec("iptables-save"));
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.