Package sizzle.types

Examples of sizzle.types.SizzleTuple


        names.put(member, i++);
        members.add(this.protomap.get(type));
      }

      this.idmap.put(c.getSimpleName(), new SizzleTuple(members, names));
      // TODO support protocol buffer casts
    }
  }
View Full Code Here


    SizzleParser.ReInit(new StringReader(source));
    TestTypeCheckingVisitor.typeChecker.visit(SizzleParser.Start(), st);

    final List<SizzleType> members = new ArrayList<SizzleType>(Arrays.asList(new SizzleInt(), new SizzleFloat(), new SizzleFloat()));

    Assert.assertEquals("s is not an unweighted, unindexed table of tuple of int, float and float", new SizzleTable(new SizzleTuple(members)), st.get("s"));

    Assert.assertEquals("x is not a float", new SizzleFloat(), st.get("x"));
  }
View Full Code Here

    TestTypeCheckingVisitor.typeChecker.visit(SizzleParser.Start(), st);

    Assert.assertEquals("submitsthroughweek is not an unweighted table of ints indexed by int",
        new SizzleTable(new SizzleInt(), Arrays.asList(new SizzleScalar[] { new SizzleInt() }), null), st.get("submitsthroughweek"));
    final List<SizzleType> members = new ArrayList<SizzleType>(Arrays.asList(new SizzleInt()));
    Assert.assertEquals("log is not a P4ChangelistStats", new SizzleTuple(members), st.get("log"));
    Assert.assertEquals("t is not a time", new SizzleTime(), st.get("t"));
    Assert.assertEquals("minute is not an int", new SizzleInt(), st.get("minute"));
  }
View Full Code Here

    TestTypeCheckingVisitor.typeChecker.visit(SizzleParser.Start(), st);

    Assert.assertEquals("max_pagerank_url is not table of strings indexed by string weighted by int",
        new SizzleTable(new SizzleString(), Arrays.asList(new SizzleScalar[] { new SizzleString() }), new SizzleFloat()), st.get("max_pagerank_url"));
    final List<SizzleType> members = new ArrayList<SizzleType>(Arrays.asList(new SizzleString(), new SizzleInt()));
    Assert.assertEquals("doc is not a Document", new SizzleTuple(members), st.get("doc"));
  }
View Full Code Here

    Assert.assertEquals("queries_per_degree is not an unweighted table of ints indexed by ints",
        new SizzleTable(new SizzleInt(), Arrays.asList(new SizzleScalar[] { new SizzleInt(), new SizzleInt() }), null), st.get("queries_per_degree"));

    final List<SizzleType> lmembers = new ArrayList<SizzleType>(Arrays.asList(new SizzleFloat(), new SizzleFloat()));

    Assert.assertEquals("loc is not a Location", new SizzleTuple(lmembers), st.get("loc"));

    final List<SizzleType> qlpmembers = new ArrayList<SizzleType>(Arrays.asList(new SizzleString(), new SizzleInt()));

    Assert.assertEquals("log_record is not a QueryLogProto", new SizzleTuple(qlpmembers), st.get("log_record"));
  }
View Full Code Here

    // assertEquals("m is not an int", new SizzleInt(), st.get("m"));
    Assert.assertEquals("RESOLUTION is not an int", new SizzleInt(), st.get("RESOLUTION"));

    final List<SizzleType> lmembers = new ArrayList<SizzleType>(Arrays.asList(new SizzleFloat(), new SizzleFloat()));

    Assert.assertEquals("loc is not a Location", new SizzleTuple(lmembers), st.get("loc"));

    final List<SizzleType> qlpmembers = new ArrayList<SizzleType>(Arrays.asList(new SizzleString(), new SizzleInt()));

    Assert.assertEquals("log_record is not a QueryLogProto", new SizzleTuple(qlpmembers), st.get("log_record"));
  }
View Full Code Here

    SizzleParser.ReInit(new StringReader(source));
    TestTypeCheckingVisitor.typeChecker.visit(SizzleParser.Start(), st);

    final List<SizzleType> members = new ArrayList<SizzleType>(Arrays.asList(new SizzleInt(), new SizzleFloat()));

    Assert.assertEquals("out is not a unindexed, unweighted table of tuple of int and float", new SizzleTable(new SizzleTuple(members)), st.get("out"));

    Assert.assertEquals("line is not a string", new SizzleString(), st.get("line"));
    Assert.assertEquals("tuple is not an array of strings", new SizzleArray(new SizzleString()), st.get("tuple"));
  }
View Full Code Here

    SizzleParser.ReInit(new StringReader(source));
    TestTypeCheckingVisitor.typeChecker.visit(SizzleParser.Start(), st);

    final List<SizzleType> members = new ArrayList<SizzleType>(Arrays.asList(new SizzleInt(), new SizzleFloat()));

    Assert.assertEquals("out is not an unindexed, unweighted table of int and float", new SizzleTable(new SizzleTuple(members)), st.get("out"));

    Assert.assertEquals("line is not a string", new SizzleString(), st.get("line"));
    Assert.assertEquals("tuple is not an array of strings", new SizzleArray(new SizzleString()), st.get("tuple"));
  }
View Full Code Here

    SizzleParser.ReInit(new StringReader(source));
    TestTypeCheckingVisitor.typeChecker.visit(SizzleParser.Start(), st);

    Assert.assertEquals("my_bool is not an alias for bool", new SizzleName(new SizzleBool()), st.getType("my_bool"));
    final ArrayList<SizzleType> members = new ArrayList<SizzleType>(Arrays.asList(new SizzleFloat(), new SizzleFloat()));
    Assert.assertEquals("Coordinates is not is not an alias for a tuple of x: float, y: float", new SizzleName(new SizzleTuple(members)),
        st.getType("Coordinates"));
    Assert.assertEquals("CityMap is not an alias for a mapping from string to tuple of x: float, y: float", new SizzleName(new SizzleMap(
        new SizzleString(), new SizzleName(new SizzleTuple(members)))), st.getType("CityMap"));

  }
View Full Code Here

  /** {@inheritDoc} */
  @Override
  public SizzleType visit(final SimpleTupleType n, final SymbolTable argu) {
    if (n.f1.present())
      return new SizzleTuple(this.check((SimpleMemberList) n.f1.node, argu));
    else
      return new SizzleTuple(new ArrayList<SizzleType>());
  }
View Full Code Here

TOP

Related Classes of sizzle.types.SizzleTuple

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.