Examples of SourceInfo


Examples of com.asakusafw.compiler.flow.ExternalIoDescriptionProcessor.SourceInfo

            return port.getDescription().getDataType();
        }

        @Override
        public SourceInfo getInputInfo() {
            return new SourceInfo(locations, TemporaryInputFormat.class);
        }
View Full Code Here

Examples of com.asakusafw.compiler.flow.ExternalIoDescriptionProcessor.SourceInfo

                .toLocalVariableDeclaration(t(List.class, t(StageInput.class)), list));
            statements.add(new ExpressionBuilder(factory, Models.toNullLiteral(factory))
                .toLocalVariableDeclaration(t(Map.class, t(String.class), t(String.class)), attributes));

            for (CopyDescription slot : slots) {
                SourceInfo info = slot.getInput();
                Type mapperType = generateMapper(slot);
                Type formatClass = t(info.getFormat());
                statements.add(new ExpressionBuilder(factory, attributes)
                    .assignFrom(new TypeBuilder(factory, t(HashMap.class, t(String.class), t(String.class)))
                        .newObject()
                        .toExpression())
                    .toStatement());
                for (Map.Entry<String, String> entry : info.getAttributes().entrySet()) {
                    statements.add(new ExpressionBuilder(factory, attributes)
                        .method("put",
                                Models.toLiteral(factory, entry.getKey()),
                                Models.toLiteral(factory, entry.getValue()))
                        .toStatement());
                }
                for (Location input : info.getLocations()) {
                    statements.add(new ExpressionBuilder(factory, list)
                        .method("add", new TypeBuilder(factory, t(StageInput.class))
                            .newObject(
                                    Models.toLiteral(factory, input.toPath(PATH_SEPARATOR)),
                                    factory.newClassLiteral(formatClass),
View Full Code Here

Examples of com.asakusafw.compiler.flow.ExternalIoDescriptionProcessor.SourceInfo

                .toLocalVariableDeclaration(t(Map.class, t(String.class), t(String.class)), attributes));

            for (Process process : stage.getProcesses()) {
                Expression mapperType = dotClass(process.getMapperTypeName());
                for (Source source : process.getResolvedSources()) {
                    SourceInfo info = source.getInputInfo();
                    Class<?> inputFormatType = info.getFormat();
                    statements.add(new ExpressionBuilder(factory, attributes)
                        .assignFrom(new TypeBuilder(factory, t(HashMap.class, t(String.class), t(String.class)))
                            .newObject()
                            .toExpression())
                        .toStatement());
                    for (Map.Entry<String, String> entry : info.getAttributes().entrySet()) {
                        statements.add(new ExpressionBuilder(factory, attributes)
                            .method("put",
                                    Models.toLiteral(factory, entry.getKey()),
                                    Models.toLiteral(factory, entry.getValue()))
                            .toStatement());
                    }
                    for (Location location : info.getLocations()) {
                        statements.add(new ExpressionBuilder(factory, list)
                            .method("add", new TypeBuilder(factory, t(StageInput.class))
                                .newObject(
                                        Models.toLiteral(factory, location.toPath('/')),
                                        factory.newClassLiteral(t(inputFormatType)),
View Full Code Here

Examples of com.asakusafw.compiler.flow.ExternalIoDescriptionProcessor.SourceInfo

        resolver.resolve(Arrays.asList(slot));
        assertThat(environment.hasError(), is(true));
    }

    private SourceInfo input(String path) {
        return new SourceInfo(Collections.singleton(Location.fromPath(path, '/')), TemporaryInputFormat.class);
    }
View Full Code Here

Examples of com.go.trove.io.SourceInfo

            if (tokenId > LAST_ID) {
                throw new IllegalArgumentException("Token Id out of range: " +
                                                   tokenId);
            }
           
            mInfo = new SourceInfo(sourceLine, sourceStartPos, sourceEndPos);
           
            if (sourceStartPos > sourceEndPos) {
                // This is an internal error.
                throw new IllegalArgumentException
                    ("Token start position greater than " +
View Full Code Here

Examples of com.go.trove.io.SourceInfo

        private void error(String str, SourceInfo info) {
            dispatchParseError(new ErrorEvent(this, str, info));
        }
       
        private void error(String str) {
            error(str, new SourceInfo(mSource.getLineNumber(),
                                      mSource.getStartPosition(),
                                      mSource.getEndPosition()));
        }
View Full Code Here

Examples of com.google.gwt.dev.jjs.SourceInfo

      Collection<JsStringLiteral> toCreate, Map<JsStringLiteral, JsName> names) {
    if (toCreate.size() > 0) {
      // Create the pool of variable names.
      JsVars vars = new JsVars(program.createSourceInfoSynthetic(
          JsStringInterner.class, "Interned string pool"));
      SourceInfo sourceInfo = program.createSourceInfoSynthetic(
          JsStringInterner.class, "Interned string assignment");
      for (JsStringLiteral literal : toCreate) {
        JsVar var = new JsVar(sourceInfo, names.get(literal));
        var.setInitExpr(literal);
        vars.add(var);
View Full Code Here

Examples of com.google.gwt.dev.jjs.SourceInfo

        localVariableNames.add(var.getName());

        // Extract the initialization expression
        JsExpression init = var.getInitExpr();
        if (init != null) {
          SourceInfo sourceInfo = var.getSourceInfo().makeChild(
              JsInliner.class, "Hoisted initializer into inline site");
          JsBinaryOperation assignment = new JsBinaryOperation(sourceInfo,
              JsBinaryOperator.ASG);
          assignment.setArg1(var.getName().makeRef(sourceInfo));
          assignment.setArg2(init);
View Full Code Here

Examples of com.google.gwt.dev.jjs.SourceInfo

   * created with a JsName that has not yet had its static reference set. This
   * is the case in GenerateJavaScriptAST after the names and scopes visitor has
   * been run, but before the AST is fully realized.
   */
  private SourceInfo maybeUpdateSourceInfo() {
    SourceInfo toReturn = super.getSourceInfo();
    if (!hasStaticRef && name != null) {
      JsNode<?> staticRef = name.getStaticRef();
      if (staticRef != null) {
        toReturn.copyMissingCorrelationsFrom(name.getStaticRef().getSourceInfo());
        hasStaticRef = true;
      }
    }
    return toReturn;
  }
View Full Code Here

Examples of com.google.gwt.dev.jjs.SourceInfo

      // The body can't be empty if we have local variables to create
      assert !statements.isEmpty();

      // Find or create the JsVars as the first statement
      SourceInfo sourceInfo = x.getSourceInfo().makeChild(
          InliningVisitor.class, "Synthetic locals");
      JsVars vars;
      if (statements.get(0) instanceof JsVars) {
        vars = (JsVars) statements.get(0);
      } else {
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.