Package wycs.core

Examples of wycs.core.SemanticType$Atom


  display.check_error();
    }

    private void clientMessage(ClientMessage event) {
  if (event.window_id() == 0) {
      Atom type = event.type();
      if (type.name.equals("SERVER_SHUTDOWN")) {
    System.err.println("Xremwin server shutdown detected");
    exit_now = true;
    return;
      }
  }
     
  X11Client client
      = (X11Client)X11Client.intern(this, event.window_id());
  Atom type = event.type();
  // client asks to change window state from normal to iconic
  if (event.format() == 32 /*atom*/) {
      if (type.name.equals("WM_CHANGE_STATE")
    && event.wm_data () == Window.WMHints.ICONIC)
      {
View Full Code Here


      }
  }
    }

    private void propertyNotify(PropertyNotify event) {
  Atom atom = event.atom(display);
  X11Client client
      = (X11Client)X11Client.intern(this, event.window_id());
  //if (atom == atomWmColormapWindows || atom == atomWmProtocols) {
  //    logger.warning("Unhandled property notify: " + atom);
  //}
View Full Code Here

  // Note: this condition will return false if we unmap this window.
  if(client.isMappedBefore()) {
      return;
  }
 
  Atom type = X11WindowManagerHints.getNetWindowType(display, client);
  if (type != null) {
      X11WindowManagerHints.setNetWindowType(display, client, type);
      // check if window is supported. we don't map it if not supported.
      if (!X11WindowManagerHints.isSupportedWinType(display, client)) {
        return;
View Full Code Here

  ArrayList<Atom> res = new ArrayList<Atom>();
  Window.PropertyReply rep = win.property(false, netWmState, Atom.ATOM,
    0, 5);
  Enum enm = rep.items();
  while (enm.more()) {
      Atom atom = (Atom) Atom.intern(display, enm.next_integer());
      res.add(atom);
      logger.fine("WM State: " + win + " " + atom);
  }
  if (res.size() > 0) {
      return res.toArray(new Atom[res.size()]);
View Full Code Here

     * get window type (_NET_WM_WINDOW_TYPE)
     * @param win
     * @return window type ATOM
     */
    static Atom getNetWindowType(Display display, Window win) {
  Atom res = null;
  Window.PropertyReply rep = win.property(false, windowTypes[0],
    Atom.ATOM, 0, 1);

  if (rep.length() == 1) {
      Enum enm = rep.items();
View Full Code Here

      SyntacticType.Set t = (SyntacticType.Set) type;
      return SemanticType.Set(true,convert(t.element,generics,context));
    } else if(type instanceof SyntacticType.Map) {
      // FIXME: need to include the map constraints here
      SyntacticType.Map t = (SyntacticType.Map) type;
      SemanticType key = convert(t.key,generics,context);
      SemanticType value = convert(t.value,generics,context);
      if (key instanceof SemanticType.Void
          || value instanceof SemanticType.Void) {
        // surprisingly, this case is possible and does occur.
        return SemanticType.Set(true, SemanticType.Void);
      } else {
        return SemanticType.Set(true, SemanticType.Tuple(key, value));
      }
    } else if(type instanceof SyntacticType.List) {
      // FIXME: need to include the list constraints here
      SyntacticType.List t = (SyntacticType.List) type;
      SemanticType element = convert(t.element,generics,context);
      if (element instanceof SemanticType.Void) {
        // surprisingly, this case is possible and does occur.
        return SemanticType.Set(true, SemanticType.Void);
      } else {
        return SemanticType.Set(true,
View Full Code Here

  private WycsFile getModuleStub(WyalFile wyalFile) {
    ArrayList<WycsFile.Declaration> declarations = new ArrayList<WycsFile.Declaration>();
    for (WyalFile.Declaration d : wyalFile.declarations()) {
      if (d instanceof WyalFile.Macro) {
        WyalFile.Macro def = (WyalFile.Macro) d;
        SemanticType from = convert(def.from, def.generics, d);
        SemanticType to = SemanticType.Bool;
        SemanticType.Var[] generics = new SemanticType.Var[def.generics
            .size()];
        for (int i = 0; i != generics.length; ++i) {
          generics[i] = SemanticType.Var(def.generics.get(i));
        }
        SemanticType.Function type = SemanticType.Function(from, to,
            generics);
        declarations.add(new WycsFile.Macro(def.name, type, null, def
            .attribute(Attribute.Source.class)));
      } else if (d instanceof WyalFile.Function) {
        WyalFile.Function fun = (WyalFile.Function) d;
        SemanticType from = convert(fun.from, fun.generics, d);
        SemanticType to = convert(fun.to, fun.generics, d);
        SemanticType.Var[] generics = new SemanticType.Var[fun.generics
            .size()];
        for (int i = 0; i != generics.length; ++i) {
          generics[i] = SemanticType.Var(fun.generics.get(i));
        }
View Full Code Here

    HashMap<String,Integer> nEnvironment = new HashMap<String,Integer>(environment);
    Pair<SemanticType,Integer>[] variables = code.types;
    int[] vars = new int[variables.length];
    for (int i = 0; i != variables.length; ++i) {
      Pair<SemanticType,Integer> p = variables[i];
      SemanticType type = p.first();
      String var = "r" + p.second();
      int varIdx = Var(automaton, var);
      nEnvironment.put(var, varIdx);
      int srcIdx;
      // FIXME: generate actual type of variable here
View Full Code Here

    if(s.constraint != null) {
      HashSet<String> generics = new HashSet<String>(s.generics);
      HashMap<String,SemanticType> environment = new HashMap<String,SemanticType>();
      addDeclaredVariables(s.from, environment,generics,s);
      addDeclaredVariables(s.to, environment,generics,s);
      SemanticType r = propagate(s.constraint,environment,generics,s);
      checkIsSubtype(SemanticType.Bool,r,s.constraint);
    }
  }
View Full Code Here

  private void propagate(WyalFile.Macro s) {
    HashSet<String> generics = new HashSet<String>(s.generics);
    HashMap<String,SemanticType> environment = new HashMap<String,SemanticType>();
    addDeclaredVariables(s.from, environment,generics,s);
    SemanticType r = propagate(s.body,environment,generics,s);
    checkIsSubtype(SemanticType.Bool,r,s.body);
  }
View Full Code Here

TOP

Related Classes of wycs.core.SemanticType$Atom

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.