Package fig.basic

Examples of fig.basic.LispTree


    if (argType.isSupertypeOf(that)) return retType;
    return SemType.bottomType;
  }
  public SemType reverse() { return new FuncSemType(retType, argType); }
  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("->");
    tree.addChild(argType.toLispTree());
    tree.addChild(retType.toLispTree());
    return tree;
  }
View Full Code Here


      result.add(baseType.reverse());
    return result.simplify();
  }

  public LispTree toLispTree() {
    LispTree result = LispTree.proto.newList();
    result.addChild("union");
    for (SemType baseType : baseTypes)
      result.addChild(baseType.toLispTree());
    return result;
  }
View Full Code Here

  public DescriptionValue(LispTree tree) { this(tree.child(1).value); }
  public DescriptionValue(String value) { this.value = value; }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("description");
    tree.addChild(value);
    return tree;
  }
View Full Code Here

    this.mode = mode;
    this.child = child;
  }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild(mode.toString());
    tree.addChild(child.toLispTree());
    return tree;
  }
View Full Code Here

  public final Formula child;

  public NotFormula(Formula child) { this.child = child; }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("not");
    tree.addChild(child.toLispTree());
    return tree;
  }
View Full Code Here

    this.id = id;
    this.description = description;
  }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("name");
    tree.addChild(id);
    if (description != null) tree.addChild(description);
    return tree;
  }
View Full Code Here

    this.child1 = child1;
    this.child2 = child2;
  }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild(mode.toString());
    tree.addChild(child1.toLispTree());
    tree.addChild(child2.toLispTree());
    return tree;
  }
View Full Code Here

    this.value = Double.parseDouble(tree.child(1).value);
    this.unit = 2 < tree.children.size() ? tree.child(2).value : unitless;
  }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("number");
    tree.addChild(Fmt.D(value));
    if (!unit.equals(unitless))
      tree.addChild(unit);
    return tree;
  }
View Full Code Here

  public StringValue(String value) { this.value = value; }
  public StringValue(LispTree tree) { this.value = tree.child(1).value; }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("string");
    tree.addChild(value);
    return tree;
  }
View Full Code Here

    this.var = var;
    this.body = body;
  }

  public LispTree toLispTree() {
    LispTree tree = LispTree.proto.newList();
    tree.addChild("lambda");
    tree.addChild(var);
    tree.addChild(body.toLispTree());
    return tree;
  }
View Full Code Here

TOP

Related Classes of fig.basic.LispTree

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.