Examples of SymbolList


Examples of org.ggp.base.util.symbol.grammar.SymbolList

{
  public Request create(Gamer gamer, String source) throws RequestFormatException
  {
    try
    {
      SymbolList list = (SymbolList) SymbolFactory.create(source);
      SymbolAtom head = (SymbolAtom) list.get(0);

      String type = head.getValue().toLowerCase();
      if (type.equals("play"))
      {
        return createPlay(gamer, list);
View Full Code Here

Examples of org.ggp.base.util.symbol.grammar.SymbolList

      throw new IllegalArgumentException("Expected at least 5 arguments!");
    }

    SymbolAtom arg1 = (SymbolAtom) list.get(1);
    SymbolAtom arg2 = (SymbolAtom) list.get(2);
    SymbolList arg3 = (SymbolList) list.get(3);
    SymbolAtom arg4 = (SymbolAtom) list.get(4);
    SymbolAtom arg5 = (SymbolAtom) list.get(5);

    String matchId = arg1.getValue();
    GdlConstant roleName = (GdlConstant) GdlFactory.createTerm(arg2);
    String theRulesheet = arg3.toString();
    int startClock = Integer.valueOf(arg4.getValue());
    int playClock = Integer.valueOf(arg5.getValue());

    // For now, there are only five standard arguments. If there are any
    // new standard arguments added to START, they should be added here.
View Full Code Here

Examples of org.ggp.base.util.symbol.grammar.SymbolList

      return null;
    }
    else
    {
      List<GdlTerm> moves = new ArrayList<GdlTerm>();
      SymbolList list = (SymbolList) symbol;

      for (int i = 0; i < list.size(); i++)
      {
        moves.add(GdlFactory.createTerm(list.get(i)));
      }

      return moves;
    }
  }
View Full Code Here

Examples of org.ggp.base.util.symbol.grammar.SymbolList

  private static Gdl createGdl(Symbol symbol)
  {
    if (symbol instanceof SymbolList)
    {
      SymbolList list = (SymbolList) symbol;
      SymbolAtom type = (SymbolAtom) list.get(0);

      if (type.getValue().equals("<="))
      {
        return createRule(list);
      }
View Full Code Here

Examples of org.ggp.base.util.symbol.grammar.SymbolList

  private static GdlLiteral createLiteral(Symbol symbol)
  {
    if (symbol instanceof SymbolList)
    {
      SymbolList list = (SymbolList) symbol;
      SymbolAtom type = (SymbolAtom) list.get(0);

      if (type.getValue().toLowerCase().equals("distinct"))
      {
        return createDistinct(list);
      }
View Full Code Here

Examples of org.ggp.base.util.symbol.grammar.SymbolList

            moveHistory.add(theMove);
        }
        JSONArray theStates = theMatchObject.getJSONArray("states");
        for (int i = 0; i < theStates.length(); i++) {
            Set<GdlSentence> theState = new HashSet<GdlSentence>();
            SymbolList stateElements = (SymbolList) SymbolFactory.create(theStates.getString(i));
            for (int j = 0; j < stateElements.size(); j++)
            {
                theState.add((GdlSentence)GdlFactory.create("( true " + stateElements.get(j).toString() + " )"));
            }
            stateHistory.add(theState);
        }
        JSONArray theStateTimes = theMatchObject.getJSONArray("stateTimes");
        for (int i = 0; i < theStateTimes.length(); i++) {
View Full Code Here

Examples of org.ggp.base.util.symbol.grammar.SymbolList

    return species;
  }

  public InfoResponse(Symbol symbol) {
    if (symbol instanceof SymbolList) {
      SymbolList pairs = (SymbolList)symbol;
      for (int i = 0; i < pairs.size(); i++) {
        Symbol pairSymbol = pairs.get(i);
        if (pairSymbol instanceof SymbolList) {
          SymbolList pair = (SymbolList)pairSymbol;
          if (pair.size() < 2) continue;
          String key = pair.get(0).toString().toLowerCase();
          String value = "";
          for (int j = 1; j < pair.size(); j++) {
            value += pair.get(j).toString();
          }
          if (key.equals("name")) {
            name = value;
          } else if (key.equals("status")) {
            status = value;
View Full Code Here

Examples of tv.porst.swfretools.parser.structures.SymbolList

    for (int i=0;i<count.value();i++) {
      symbols.add(SymbolParser.parse(parser, String.format("ImportAssets2::SymbolList[%d]", i)));
    }

    return new ImportAssets2Tag(header, url, reserved, reserved2, count, new SymbolList(symbols));
  }
View Full Code Here

Examples of tv.porst.swfretools.parser.structures.SymbolList

    for (int i=0;i<numSymbols.value();i++) {
      symbols.add(SymbolParser.parse(parser, String.format("SymbolClass::Symbols[%d]", i)));
    }

    return new SymbolClassTag(header, numSymbols, new SymbolList(symbols));
  }
View Full Code Here

Examples of tv.porst.swfretools.parser.structures.SymbolList

    for (int i=0;i<count.value();i++) {
      symbols.add(SymbolParser.parse(parser, String.format("ImportAssets::Symbols[%d]", i)));
    }

    return new ImportAssetsTag(header, url, count, new SymbolList(symbols));
  }
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.