Package sizzle.types

Examples of sizzle.types.SizzleName


    this.setFunction("keys", new SizzleFunction(new SizzleArray(new SizzleScalar()), new SizzleType[] { new SizzleMap(new SizzleScalar(),
        new SizzleScalar()) }, "${0}.keySet().toArray()"));
    this.setFunction("lookup", new SizzleFunction(new SizzleScalar(), new SizzleType[] { new SizzleMap(new SizzleScalar(), new SizzleScalar()),
        new SizzleScalar(), new SizzleScalar() }, "(${0}.containsKey(${1}) ? ${0}.get(${1}) : ${2})"));

    this.setFunction("regex", new SizzleFunction(new SizzleString(), new SizzleType[] { new SizzleName(new SizzleScalar()), new SizzleInt() },
        "sizzle.functions.SizzleSpecialIntrinsics.regex(\"${0}\", ${1})"));
    this.setFunction("regex", new SizzleFunction(new SizzleString(), new SizzleType[] { new SizzleName(new SizzleScalar()) },
        "sizzle.functions.SizzleSpecialIntrinsics.regex(\"${0}\")"));
    // these fingerprints are identity functions
    this.setFunction("fingerprintof", new SizzleFunction(new SizzleFingerprint(), new SizzleScalar[] { new SizzleInt() }));
    this.setFunction("fingerprintof", new SizzleFunction(new SizzleFingerprint(), new SizzleScalar[] { new SizzleTime() }));
View Full Code Here


    return this.globals.containsKey(id) || this.locals.containsKey(id);
  }

  public SizzleType get(final String id) {
    if (this.idmap.containsKey(id))
      return new SizzleName(this.idmap.get(id));

    if (this.globals.containsKey(id))
      return this.globals.get(id);

    if (this.locals.containsKey(id))
View Full Code Here

    final SymbolTable st = new SymbolTable();

    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

    final String id = n.f1.f0.tokenImage;

    if (argu.hasType(id))
      throw new TypeException(id + " already defined as " + argu.getType(id));

    argu.setType(id, new SizzleName(n.f3.accept(this, argu)));

    return null;
  }
View Full Code Here

TOP

Related Classes of sizzle.types.SizzleName

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.