Package com.odiago.flumebase.parser

Examples of com.odiago.flumebase.parser.IdentifierExpr


    if (e instanceof IdentifierExpr) {
      //  Delay setting avro labels for IdentifierExprs; the type checking
      //  phase will provide us with source labels that are set as the
      //  avro labels for the encompassing AliasedExprs.
      //  The exception are '#idents' which are either magic keys or attributes.
      IdentifierExpr ident = (IdentifierExpr) e;
      if (ident.getIdentifier().startsWith("#")) {
        // Attribute, etc. Use _foo instead.
        String label = "_" + ident.getIdentifier().substring(1);
        ae.setAvroLabel(label);
      }
    } else {
      // Use a generated name. Use "__e_" for "[e]xpression".
      String label = "__e_" + mNextId + "_";
View Full Code Here


    symbols.addSymbol(new AssignedSymbol("x", Type.getPrimitive(Type.TypeName.INT), "x",
        IdentifierExpr.AccessType.FIELD));

    Expr binopExpr = new BinExpr(
      new ConstExpr(Type.getPrimitive(Type.TypeName.INT), Integer.valueOf(2)),
      BinOp.Add, new IdentifierExpr("x"));
    TypeChecker tc = new TypeChecker(symbols);
    binopExpr.accept(tc);
  }
View Full Code Here

    symbols.addSymbol(new AssignedSymbol("x", Type.getPrimitive(Type.TypeName.INT), "x",
        IdentifierExpr.AccessType.FIELD));

    Expr binopExpr = new BinExpr(
      new ConstExpr(Type.getPrimitive(Type.TypeName.BIGINT), Integer.valueOf(2)),
      BinOp.Add, new IdentifierExpr("x"));
    TypeChecker tc = new TypeChecker(symbols);
    binopExpr.accept(tc);
  }
View Full Code Here

    symbols.addSymbol(new AssignedSymbol("x", Type.getPrimitive(Type.TypeName.BIGINT), "x",
        IdentifierExpr.AccessType.FIELD));

    Expr binopExpr = new BinExpr(
      new ConstExpr(Type.getPrimitive(Type.TypeName.INT), Integer.valueOf(2)),
      BinOp.Add, new IdentifierExpr("x"));
    TypeChecker tc = new TypeChecker(symbols);
    binopExpr.accept(tc);
  }
View Full Code Here

          }
        } else if (aliasedExpr.getExpr() instanceof IdentifierExpr) {
          // AliasedExpr entries which are just IdentifierExprs were
          // not handled in AssignFieldLabelsVisitor. Now that the
          // IdentifierExpr has been visited, resolve its avro name here.
          IdentifierExpr ident = (IdentifierExpr) aliasedExpr.getExpr();
          String name = aliasedExpr.getUserAlias();
          String assignedName = ident.getAssignedName();

          if (!ident.getIdentifier().startsWith("#")) {
            // Use the avro label of the identified field.
            aliasedExpr.setAvroLabel(assignedName);
          }

          Type type = ident.getType(exprTable);

          // Create symbols for the output SymbolTable.
          createSymbols(outTable, stmtAlias, name, assignedName, type);

        } else {
View Full Code Here

TOP

Related Classes of com.odiago.flumebase.parser.IdentifierExpr

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.