aa
com.cliffc.aa.HM.HM5.Lambda2 Class Reference
Inheritance diagram for com.cliffc.aa.HM.HM5.Lambda2:
[legend]
Collaboration diagram for com.cliffc.aa.HM.HM5.Lambda2:
[legend]

Public Member Functions

String p ()
 
final String toString ()
 

Package Functions

 Lambda2 (String arg0, String arg1, Syntax body)
 
void add_kids (Worklist work)
 
void add_occurs (Worklist work)
 
T2 debug_find ()
 
T2 find ()
 
boolean hm (Worklist work)
 
T2 lookup (String name)
 
boolean more_work (Worklist work)
 
final boolean more_work_impl (Worklist work)
 
final SB p0 (SB sb, VBitSet dups)
 
SB p1 (SB sb)
 
SB p2 (SB sb, VBitSet dups)
 
void prep_lookup_deps (Ident id)
 
int prep_tree (Syntax par, VStack nongen, Worklist work)
 
final void prep_tree_impl (Syntax par, VStack nongen, Worklist work, T2 t)
 
SB str (SB sb)
 
T2 targ0 ()
 
T2 targ1 ()
 

Package Attributes

final String _arg0
 
final String _arg1
 
final Syntax _body
 
VStack _nongen
 
Syntax _par
 
T2 _t
 
T2 _targ0
 
T2 _targ1
 

Detailed Description

Definition at line 255 of file HM5.java.

Constructor & Destructor Documentation

◆ Lambda2()

com.cliffc.aa.HM.HM5.Lambda2.Lambda2 ( String  arg0,
String  arg1,
Syntax  body 
)
package

Definition at line 260 of file HM5.java.

260 { _arg0=arg0; _arg1 = arg1; _body=body; _targ0 = T2.make_leaf(); _targ1 = T2.make_leaf(); }

References com.cliffc.aa.HM.HM5.Lambda2._arg0, com.cliffc.aa.HM.HM5.Lambda2._arg1, com.cliffc.aa.HM.HM5.Lambda2._body, com.cliffc.aa.HM.HM5.Lambda2._targ0, com.cliffc.aa.HM.HM5.Lambda2._targ1, and com.cliffc.aa.HM.HM5.T2.make_leaf().

Here is the call graph for this function:

Member Function Documentation

◆ add_kids()

void com.cliffc.aa.HM.HM5.Lambda2.add_kids ( Worklist  work)
package

Reimplemented from com.cliffc.aa.HM.HM5.Syntax.

Definition at line 283 of file HM5.java.

283 { work.push(_body); }

References com.cliffc.aa.HM.HM5.Lambda2._body, and com.cliffc.aa.HM.HM5.Worklist.push().

Here is the call graph for this function:

◆ add_occurs()

void com.cliffc.aa.HM.HM5.Lambda2.add_occurs ( Worklist  work)
package

Reimplemented from com.cliffc.aa.HM.HM5.Syntax.

Definition at line 284 of file HM5.java.

284  {
285  if( targ0().occurs_in_type(find()) ) work.addAll(_targ0._deps);
286  if( targ1().occurs_in_type(find()) ) work.addAll(_targ1._deps);
287  }

References com.cliffc.aa.HM.HM5.T2._deps, com.cliffc.aa.HM.HM5.Lambda2._targ0, com.cliffc.aa.HM.HM5.Lambda2._targ1, com.cliffc.aa.HM.HM5.Worklist.addAll(), com.cliffc.aa.HM.HM5.Syntax.find(), com.cliffc.aa.HM.HM5.Lambda2.targ0(), and com.cliffc.aa.HM.HM5.Lambda2.targ1().

Here is the call graph for this function:

◆ debug_find()

T2 com.cliffc.aa.HM.HM5.Syntax.debug_find ( )
packageinherited

Definition at line 127 of file HM5.java.

127 { return _t.find(); } // Find, without the roll-up

References com.cliffc.aa.HM.HM5.Syntax._t, and com.cliffc.aa.HM.HM5.T2.find().

Referenced by com.cliffc.aa.HM.HM5.hm().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find()

T2 com.cliffc.aa.HM.HM5.Syntax.find ( )
packageinherited

Definition at line 123 of file HM5.java.

123  { // U-F find
124  T2 t = _t.find();
125  return t==_t ? t : (_t=t);
126  }

References com.cliffc.aa.HM.HM5.Syntax._t, and com.cliffc.aa.HM.HM5.T2.find().

Referenced by com.cliffc.aa.HM.HM5.T2._occurs_in(), com.cliffc.aa.HM.HM5.Lambda.add_occurs(), com.cliffc.aa.HM.HM5.Lambda2.add_occurs(), com.cliffc.aa.HM.HM5.Let.add_occurs(), com.cliffc.aa.HM.HM5.Con.hm(), com.cliffc.aa.HM.HM5.Ident.hm(), com.cliffc.aa.HM.HM5.Lambda.hm(), com.cliffc.aa.HM.HM5.Lambda2.hm(), com.cliffc.aa.HM.HM5.Let.hm(), and com.cliffc.aa.HM.HM5.Apply.hm().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hm()

boolean com.cliffc.aa.HM.HM5.Lambda2.hm ( Worklist  work)
package

Reimplemented from com.cliffc.aa.HM.HM5.Syntax.

Definition at line 266 of file HM5.java.

266  {
267  // The normal lambda work
268  T2 old = find();
269  if( old.is_fun() && // Already a function? Compare-by-parts
270  !old.args(0).unify(targ0() ,work) &&
271  !old.args(1).unify(targ1() ,work) &&
272  !old.args(2).unify(_body.find(),work) )
273  return false;
274  // Make a new T2 for progress
275  T2 fun = T2.make_fun(targ0(),targ1(),_body.find());
276  return old.unify(fun,work);
277  }

References com.cliffc.aa.HM.HM5.Lambda2._body, com.cliffc.aa.HM.HM5.T2.args(), com.cliffc.aa.HM.HM5.Syntax.find(), com.cliffc.aa.HM.HM5.T2.is_fun(), com.cliffc.aa.HM.HM5.T2.make_fun(), com.cliffc.aa.HM.HM5.Lambda2.targ0(), com.cliffc.aa.HM.HM5.Lambda2.targ1(), and com.cliffc.aa.HM.HM5.T2.unify().

Here is the call graph for this function:

◆ lookup()

T2 com.cliffc.aa.HM.HM5.Lambda2.lookup ( String  name)
package

Reimplemented from com.cliffc.aa.HM.HM5.Syntax.

Definition at line 278 of file HM5.java.

278  {
279  if( Util.eq(_arg0,name) ) return targ0();
280  if( Util.eq(_arg1,name) ) return targ1();
281  return _par==null ? null : _par.lookup(name);
282  }

References com.cliffc.aa.HM.HM5.Lambda2._arg0, com.cliffc.aa.HM.HM5.Lambda2._arg1, com.cliffc.aa.HM.HM5.Syntax._par, com.cliffc.aa.util.Util.eq(), com.cliffc.aa.HM.HM5.Syntax.lookup(), com.cliffc.aa.HM.HM5.Lambda2.targ0(), and com.cliffc.aa.HM.HM5.Lambda2.targ1().

Here is the call graph for this function:

◆ more_work()

boolean com.cliffc.aa.HM.HM5.Lambda2.more_work ( Worklist  work)
package

Reimplemented from com.cliffc.aa.HM.HM5.Syntax.

Definition at line 298 of file HM5.java.

298  {
299  if( !more_work_impl(work) ) return false;
300  return _body.more_work(work);
301  }

References com.cliffc.aa.HM.HM5.Lambda2._body, com.cliffc.aa.HM.HM5.Syntax.more_work(), and com.cliffc.aa.HM.HM5.Syntax.more_work_impl().

Here is the call graph for this function:

◆ more_work_impl()

final boolean com.cliffc.aa.HM.HM5.Syntax.more_work_impl ( Worklist  work)
packageinherited

Definition at line 147 of file HM5.java.

147  {
148  return work.has(this) || !hm(null); // Either on worklist, or no-progress
149  }

References com.cliffc.aa.HM.HM5.Worklist.has(), and com.cliffc.aa.HM.HM5.Syntax.hm().

Referenced by com.cliffc.aa.HM.HM5.Con.more_work(), com.cliffc.aa.HM.HM5.Ident.more_work(), com.cliffc.aa.HM.HM5.Lambda.more_work(), com.cliffc.aa.HM.HM5.Lambda2.more_work(), com.cliffc.aa.HM.HM5.Let.more_work(), and com.cliffc.aa.HM.HM5.Apply.more_work().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ p()

String com.cliffc.aa.HM.HM5.Syntax.p ( )
inherited

Definition at line 154 of file HM5.java.

154 { return p0(new SB(), new VBitSet()).toString(); }

References com.cliffc.aa.HM.HM5.Syntax.p0(), and com.cliffc.aa.util.SB.toString().

Here is the call graph for this function:

◆ p0()

final SB com.cliffc.aa.HM.HM5.Syntax.p0 ( SB  sb,
VBitSet  dups 
)
packageinherited

Definition at line 155 of file HM5.java.

155  {
156  _t.get_dups(dups);
157  _t.str(p1(sb.i()).p(" "), new VBitSet(),dups).nl();
158  return p2(sb.ii(1),dups).di(1);
159  }

References com.cliffc.aa.HM.HM5.Syntax._t, com.cliffc.aa.util.SB.di(), com.cliffc.aa.HM.HM5.T2.get_dups(), com.cliffc.aa.util.SB.i(), com.cliffc.aa.util.SB.ii(), com.cliffc.aa.util.SB.nl(), com.cliffc.aa.util.SB.p(), com.cliffc.aa.HM.HM5.Syntax.p1(), com.cliffc.aa.HM.HM5.Syntax.p2(), and com.cliffc.aa.HM.HM5.T2.str().

Referenced by com.cliffc.aa.HM.HM5.Syntax.p(), com.cliffc.aa.HM.HM5.Lambda.p2(), com.cliffc.aa.HM.HM5.Lambda2.p2(), com.cliffc.aa.HM.HM5.Let.p2(), and com.cliffc.aa.HM.HM5.Apply.p2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ p1()

SB com.cliffc.aa.HM.HM5.Lambda2.p1 ( SB  sb)
package

Reimplemented from com.cliffc.aa.HM.HM5.Syntax.

Definition at line 262 of file HM5.java.

262 { return sb.p("{ ").p(_arg0).p(" ").p(_arg1).p(" -> ... } "); }

References com.cliffc.aa.HM.HM5.Lambda2._arg0, com.cliffc.aa.HM.HM5.Lambda2._arg1, and com.cliffc.aa.util.SB.p().

Here is the call graph for this function:

◆ p2()

SB com.cliffc.aa.HM.HM5.Lambda2.p2 ( SB  sb,
VBitSet  dups 
)
package

Reimplemented from com.cliffc.aa.HM.HM5.Syntax.

Definition at line 263 of file HM5.java.

263 { return _body.p0(sb,dups); }

References com.cliffc.aa.HM.HM5.Lambda2._body, and com.cliffc.aa.HM.HM5.Syntax.p0().

Here is the call graph for this function:

◆ prep_lookup_deps()

void com.cliffc.aa.HM.HM5.Lambda2.prep_lookup_deps ( Ident  id)
package

Reimplemented from com.cliffc.aa.HM.HM5.Syntax.

Definition at line 294 of file HM5.java.

294  {
295  if( Util.eq(id._name,_arg0) ) _targ0.push_update(id);
296  if( Util.eq(id._name,_arg1) ) _targ1.push_update(id);
297  }

References com.cliffc.aa.HM.HM5.Lambda2._arg0, com.cliffc.aa.HM.HM5.Lambda2._arg1, com.cliffc.aa.HM.HM5.Lambda2._targ0, com.cliffc.aa.HM.HM5.Lambda2._targ1, com.cliffc.aa.util.Util.eq(), and com.cliffc.aa.HM.HM5.T2.push_update().

Here is the call graph for this function:

◆ prep_tree()

int com.cliffc.aa.HM.HM5.Lambda2.prep_tree ( Syntax  par,
VStack  nongen,
Worklist  work 
)
package

Reimplemented from com.cliffc.aa.HM.HM5.Syntax.

Definition at line 288 of file HM5.java.

288  {
289  prep_tree_impl(par,nongen,work,T2.make_leaf());
290  VStack vs0 = new VStack(nongen,_targ0);
291  VStack vs1 = new VStack(vs0 ,_targ1);
292  return _body.prep_tree(this,vs1,work) + 1;
293  }

References com.cliffc.aa.HM.HM5.Lambda2._body, com.cliffc.aa.HM.HM5.Lambda2._targ0, com.cliffc.aa.HM.HM5.Lambda2._targ1, com.cliffc.aa.HM.HM5.T2.make_leaf(), com.cliffc.aa.HM.HM5.Syntax.prep_tree(), and com.cliffc.aa.HM.HM5.Syntax.prep_tree_impl().

Here is the call graph for this function:

◆ prep_tree_impl()

final void com.cliffc.aa.HM.HM5.Syntax.prep_tree_impl ( Syntax  par,
VStack  nongen,
Worklist  work,
T2  t 
)
packageinherited

Definition at line 137 of file HM5.java.

137 { _par=par; _t=t; _nongen = nongen; work.push(this); }

References com.cliffc.aa.HM.HM5.Syntax._nongen, com.cliffc.aa.HM.HM5.Syntax._par, com.cliffc.aa.HM.HM5.Syntax._t, and com.cliffc.aa.HM.HM5.Worklist.push().

Referenced by com.cliffc.aa.HM.HM5.Con.prep_tree(), com.cliffc.aa.HM.HM5.Ident.prep_tree(), com.cliffc.aa.HM.HM5.Lambda.prep_tree(), com.cliffc.aa.HM.HM5.Lambda2.prep_tree(), com.cliffc.aa.HM.HM5.Let.prep_tree(), and com.cliffc.aa.HM.HM5.Apply.prep_tree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ str()

SB com.cliffc.aa.HM.HM5.Lambda2.str ( SB  sb)
package

Reimplemented from com.cliffc.aa.HM.HM5.Syntax.

Definition at line 261 of file HM5.java.

261 { return _body.str(sb.p("{ ").p(_arg0).p(" ").p(_arg1).p(" -> ")).p(" }"); }

References com.cliffc.aa.HM.HM5.Lambda2._arg0, com.cliffc.aa.HM.HM5.Lambda2._arg1, com.cliffc.aa.HM.HM5.Lambda2._body, com.cliffc.aa.util.SB.p(), and com.cliffc.aa.HM.HM5.Syntax.str().

Here is the call graph for this function:

◆ targ0()

T2 com.cliffc.aa.HM.HM5.Lambda2.targ0 ( )
package

Definition at line 264 of file HM5.java.

264 { T2 targ = _targ0.find(); return targ==_targ0 ? targ : (_targ0=targ); }

References com.cliffc.aa.HM.HM5.Lambda2._targ0, and com.cliffc.aa.HM.HM5.T2.find().

Referenced by com.cliffc.aa.HM.HM5.Lambda2.add_occurs(), com.cliffc.aa.HM.HM5.Lambda2.hm(), and com.cliffc.aa.HM.HM5.Lambda2.lookup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ targ1()

T2 com.cliffc.aa.HM.HM5.Lambda2.targ1 ( )
package

Definition at line 265 of file HM5.java.

265 { T2 targ = _targ1.find(); return targ==_targ1 ? targ : (_targ1=targ); }

References com.cliffc.aa.HM.HM5.Lambda2._targ1, and com.cliffc.aa.HM.HM5.T2.find().

Referenced by com.cliffc.aa.HM.HM5.Lambda2.add_occurs(), com.cliffc.aa.HM.HM5.Lambda2.hm(), and com.cliffc.aa.HM.HM5.Lambda2.lookup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

final String com.cliffc.aa.HM.HM5.Syntax.toString ( )
inherited

Definition at line 151 of file HM5.java.

151 { return str(new SB()).toString(); }

References com.cliffc.aa.HM.HM5.Syntax.str(), and com.cliffc.aa.util.SB.toString().

Here is the call graph for this function:

Member Data Documentation

◆ _arg0

◆ _arg1

◆ _body

◆ _nongen

VStack com.cliffc.aa.HM.HM5.Syntax._nongen
packageinherited

◆ _par

◆ _t

◆ _targ0

◆ _targ1


The documentation for this class was generated from the following file:
com.cliffc.aa.HM.HM5.Lambda2.targ0
T2 targ0()
Definition: HM5.java:264
com.cliffc.aa.util.Util.eq
static boolean eq(String s0, String s1)
Definition: Util.java:16
com.cliffc.aa.util.SB.ii
SB ii(int i)
Definition: SB.java:44
com.cliffc.aa.util.SB.di
SB di(int i)
Definition: SB.java:46
com.cliffc.aa.HM.HM5.T2.str
SB str(SB sb, VBitSet visit, VBitSet dups)
Definition: HM5.java:745
com.cliffc.aa.HM.HM5.Syntax.hm
abstract boolean hm(Worklist work)
com.cliffc.aa.HM.HM5.T2.find
T2 find()
Definition: HM5.java:452
com.cliffc.aa.HM.HM5.T2._deps
Ary< Ident > _deps
Definition: HM5.java:428
com.cliffc.aa.HM.HM5.T2.make_leaf
static T2 make_leaf()
Definition: HM5.java:432
com.cliffc.aa.HM.HM5.Syntax.prep_tree
abstract int prep_tree(Syntax par, VStack nongen, Worklist work)
com.cliffc.aa.HM.HM5.Lambda2._body
final Syntax _body
Definition: HM5.java:257
com.cliffc.aa.HM.HM5.Lambda2._targ1
T2 _targ1
Definition: HM5.java:259
com.cliffc.aa.HM.HM5.T2.get_dups
VBitSet get_dups(VBitSet dups)
Definition: HM5.java:732
com.cliffc.aa.HM.HM5.Syntax.p0
final SB p0(SB sb, VBitSet dups)
Definition: HM5.java:155
com.cliffc.aa.HM.HM5.Syntax.lookup
abstract T2 lookup(String name)
com.cliffc.aa.HM.HM5.T2.push_update
boolean push_update(Ident a)
Definition: HM5.java:704
com.cliffc.aa.util.Util
Definition: Util.java:5
com.cliffc.aa.HM.HM5.Syntax.find
T2 find()
Definition: HM5.java:123
com.cliffc.aa.HM.HM5.Lambda2._targ0
T2 _targ0
Definition: HM5.java:258
com.cliffc.aa.HM.HM5.Syntax._t
T2 _t
Definition: HM5.java:122
com.cliffc.aa.HM.HM5.Syntax._nongen
VStack _nongen
Definition: HM5.java:121
com.cliffc.aa.HM.HM5.Syntax.p1
abstract SB p1(SB sb)
com.cliffc.aa.util.VBitSet
Definition: VBitSet.java:5
com.cliffc.aa.HM.HM5.Syntax.p2
abstract SB p2(SB sb, VBitSet dups)
com.cliffc.aa.util.SB
Tight/tiny StringBuilder wrapper.
Definition: SB.java:8
com.cliffc.aa.HM.HM5.Syntax.more_work
abstract boolean more_work(Worklist work)
com.cliffc.aa.HM.HM5.Lambda2._arg0
final String _arg0
Definition: HM5.java:256
com.cliffc.aa.util.SB.nl
SB nl()
Definition: SB.java:48
com.cliffc.aa.HM.HM5.Lambda2.targ1
T2 targ1()
Definition: HM5.java:265
com.cliffc.aa.util.SB.p
SB p(String s)
Definition: SB.java:13
com.cliffc.aa.HM.HM5.Syntax.str
abstract SB str(SB sb)
com.cliffc.aa.HM.HM5.Lambda2._arg1
final String _arg1
Definition: HM5.java:256
com.cliffc.aa.util.SB.i
SB i(int d)
Definition: SB.java:38
com.cliffc.aa.util.SB.toString
String toString()
Definition: SB.java:62
com.cliffc.aa.HM.HM5.Syntax.more_work_impl
final boolean more_work_impl(Worklist work)
Definition: HM5.java:147
com.cliffc.aa.HM.HM5.Syntax._par
Syntax _par
Definition: HM5.java:120
com.cliffc.aa.HM.HM5.Syntax.prep_tree_impl
final void prep_tree_impl(Syntax par, VStack nongen, Worklist work, T2 t)
Definition: HM5.java:137