Package com.google.devtools.moe.client.parser

Examples of com.google.devtools.moe.client.parser.Expression


      return;
    }

    Codebase to, from;
    try {
      Expression toEx =
          new RepositoryExpression(toRev.repositoryName).atRevision(toRev.revId);
      Expression fromEx =
          new RepositoryExpression(fromRev.repositoryName).atRevision(fromRev.revId);

      // Use the forward-translator to check an inverse-translated migration.
      if (inverse) {
        String fromProjectSpace =
            context.config.getRepositoryConfigs().get(fromRev.repositoryName).getProjectSpace();
        toEx = toEx.translateTo(fromProjectSpace);
      } else {
        String toProjectSpace =
            context.config.getRepositoryConfigs().get(toRev.repositoryName).getProjectSpace();
        fromEx = fromEx.translateTo(toProjectSpace);
      }

      to = toEx.createCodebase(context);
      from = fromEx.createCodebase(context);

    } catch (CodebaseCreationError e) {
      AppContext.RUN.ui.error(e, "Could not generate codebase");
      return;
    } catch (InvalidProject e) {
View Full Code Here


    } catch (ParseError e) {
      throw new CodebaseCreationError("Couldn't parse in translation: " + e);
    }

    // This Expression is used only for informative output.
    Expression forwardEditExp = refTo.getExpression();
    for (TranslatorStep forwardStep : forwardSteps) {
      forwardEditExp = forwardEditExp.editWith(forwardStep.name, ImmutableMap.<String, String>of());
      Task task = AppContext.RUN.ui.pushTask(
          "edit", "Pushing to forward-translation stack: " + forwardEditExp);
      refTo = forwardStep.editor.edit(refTo, context, options).copyWithExpression(forwardEditExp);
      forwardTransStack.push(refTo);
      AppContext.RUN.ui.popTaskAndPersist(task, refTo.getPath());
View Full Code Here

      }

      for (Migration m : migrations) {
        // For each migration, the reference to-codebase for inverse translation is the Writer,
        // since it contains the latest changes (i.e. previous migrations) to the to-repository.
        Expression referenceToCodebase = new RepositoryExpression(migrationConfig.getToRepository())
              .withOption("localroot", toWriter.getRoot().getAbsolutePath());

        Ui.Task oneMigrationTask = AppContext.RUN.ui.pushTask(
            "perform_individual_migration",
            String.format("Performing individual migration '%s'", m.toString()));
View Full Code Here

TOP

Related Classes of com.google.devtools.moe.client.parser.Expression

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.