Package sizzle.types

Examples of sizzle.types.SizzleString


    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


    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

    final SymbolTable st = new SymbolTable();

    // fake functions for this unit test
    st.setFunction("day_of_query", new SizzleFunction(new SizzleInt(), new SizzleType[] {}, "Nonexistant.day_of_query()"));
    st.setFunction("month_of_query", new SizzleFunction(new SizzleInt(), new SizzleType[] {}, "Nonexistant.month_of_query()"));
    st.setFunction("words_from_query", new SizzleFunction(new SizzleArray(new SizzleString()), new SizzleType[] {}, "Nonexistant.words_from_query()"));

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

    Assert.assertEquals("out is not an unweighted table of ints indexed by various",
        new SizzleTable(new SizzleInt(), Arrays.asList(new SizzleString(), new SizzleInt(), new SizzleInt()), null), st.get("out"));

    Assert.assertEquals("keywords is not an array of strings", new SizzleArray(new SizzleString()), st.get("keywords"));
    Assert.assertEquals("querywords is not an array of strings", new SizzleArray(new SizzleString()), st.get("querywords"));

    Assert.assertEquals("month is not an int", new SizzleInt(), st.get("month"));
    Assert.assertEquals("day is not an int", new SizzleInt(), st.get("day"));
  }
View Full Code Here

    final SymbolTable st = new SymbolTable();

    // fake functions for this unit test
    st.setFunction("day_of_query", new SizzleFunction(new SizzleInt(), new SizzleType[] {}, "Nonexistant.day_of_query()"));
    st.setFunction("month_of_query", new SizzleFunction(new SizzleInt(), new SizzleType[] {}, "Nonexistant.month_of_query()"));
    st.setFunction("words_from_query", new SizzleFunction(new SizzleArray(new SizzleString()), new SizzleType[] {}, "Nonexistant.words_from_query()"));

    SizzleParser.ReInit(new StringReader(source));
    TestTypeCheckingVisitor.typeChecker.visit(SizzleParser.Start(), st);
  }
View Full Code Here

    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

    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

    final SymbolTable st = new SymbolTable();

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

    Assert.assertEquals("xlated is not an unindexed, unweighted table of string", new SizzleTable(new SizzleString(), null), st.get("xlated"));

    Assert.assertEquals("abbr is not a string", new SizzleString(), st.get("abbr"));
    Assert.assertEquals("CJK is not a mapping from string to string", new SizzleMap(new SizzleString(), new SizzleString()), st.get("CJK"));
  }
View Full Code Here

    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 StringLiteral n, final SymbolTable argu) {
    return new SizzleString();
  }
View Full Code Here

    this.namefinder = new NameFindingVisitor();
    this.staticdeclarator = new StaticDeclarationCodeGeneratingVisitor(this);
    this.staticinitializer = new StaticInitializationCodeGeneratingVisitor(this);

    this.tables = new HashMap<String, TableDescription>();
    this.tables.put("stdout", new TableDescription("stdout", new SizzleString()));
    this.tables.put("stderr", new TableDescription("stderr", new SizzleString()));
    this.tables.put("output", new TableDescription("output", new SizzleBytes()));

    this.name = name;
    this.stg = stg;
  }
View Full Code Here

TOP

Related Classes of sizzle.types.SizzleString

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.