MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / xmeet

Method xmeet

chapter09/src/main/java/com/seaofnodes/simple/type/Type.java:104–113  ·  view source on GitHub ↗
(Type t)

Source from the content-addressed store, hash-verified

102 // Handle cases where 'this.is_simple()' and unequal to 't'.
103 // Subclassed xmeet calls can assert that '!t.is_simple()'.
104 protected Type xmeet(Type t) {
105 assert is_simple(); // Should be overridden in subclass
106 // ANY meet anything is thing; thing meet ALL is ALL
107 if( _type==TBOT || t._type==TTOP ) return this;
108 if( _type==TTOP || t._type==TBOT ) return t;
109 // 'this' is {TCTRL,TXCTRL}
110 if( !t.is_simple() ) return BOTTOM;
111 // 't' is {TCTRL,TXCTRL}
112 return _type==TCTRL || t._type==TCTRL ? CONTROL : XCONTROL;
113 }
114
115 // True if this "isa" t; e.g. 17 isa TypeInteger.BOT
116 public boolean isa( Type t ) { return meet(t)==t; }

Callers 1

meetMethod · 0.95

Calls 1

is_simpleMethod · 0.95

Tested by

no test coverage detected