aa
com.cliffc.aa.HM.HM6.Lambda Class Reference
Inheritance diagram for com.cliffc.aa.HM.HM6.Lambda:
[legend]
Collaboration diagram for com.cliffc.aa.HM.HM6.Lambda:
[legend]

Public Member Functions

String p ()
 
final String toString ()
 

Package Functions

 Lambda (String arg0, 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 targ ()
 

Package Attributes

final String _arg0
 
final Syntax _body
 
VStack _nongen
 
Syntax _par
 
T2 _t
 
T2 _targ
 

Detailed Description

Definition at line 305 of file HM6.java.

Constructor & Destructor Documentation

◆ Lambda()

com.cliffc.aa.HM.HM6.Lambda.Lambda ( String  arg0,
Syntax  body 
)
package

Definition at line 309 of file HM6.java.

309 { _arg0=arg0; _body=body; _targ = T2.make_leaf(); }

References com.cliffc.aa.HM.HM6.Lambda._arg0, com.cliffc.aa.HM.HM6.Lambda._body, com.cliffc.aa.HM.HM6.Lambda._targ, and com.cliffc.aa.HM.HM6.T2.make_leaf().

Here is the call graph for this function:

Member Function Documentation

◆ add_kids()

void com.cliffc.aa.HM.HM6.Lambda.add_kids ( Worklist  work)
package

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

Definition at line 329 of file HM6.java.

329 { work.push(_body); }

References com.cliffc.aa.HM.HM6.Lambda._body, and com.cliffc.aa.HM.HM6.Worklist.push().

Here is the call graph for this function:

◆ add_occurs()

void com.cliffc.aa.HM.HM6.Lambda.add_occurs ( Worklist  work)
package

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

Definition at line 330 of file HM6.java.

330  {
331  if( targ().occurs_in_type(find()) ) work.addAll(_targ._deps);
332  }

References com.cliffc.aa.HM.HM6.T2._deps, com.cliffc.aa.HM.HM6.Lambda._targ, com.cliffc.aa.HM.HM6.Worklist.addAll(), com.cliffc.aa.HM.HM6.Syntax.find(), and com.cliffc.aa.HM.HM6.Lambda.targ().

Here is the call graph for this function:

◆ debug_find()

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

Definition at line 218 of file HM6.java.

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

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

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

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

◆ find()

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

Definition at line 214 of file HM6.java.

214  { // U-F find
215  T2 t = _t.find();
216  return t==_t ? t : (_t=t);
217  }

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

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

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

◆ hm()

boolean com.cliffc.aa.HM.HM6.Lambda.hm ( Worklist  work)
package

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

Definition at line 314 of file HM6.java.

314  {
315  // The normal lambda work
316  T2 old = find();
317  if( old.is_fun() && // Already a function? Compare-by-parts
318  !old.args(0).unify(targ() ,work) &&
319  !old.args(1).unify(_body.find(),work) )
320  return false;
321  // Make a new T2 for progress
322  T2 fun = T2.make_fun(targ(),_body.find());
323  return old.unify(fun,work);
324  }

References com.cliffc.aa.HM.HM6.Lambda._body, com.cliffc.aa.HM.HM6.T2.args(), com.cliffc.aa.HM.HM6.Syntax.find(), com.cliffc.aa.HM.HM6.T2.is_fun(), com.cliffc.aa.HM.HM6.T2.make_fun(), com.cliffc.aa.HM.HM6.Lambda.targ(), and com.cliffc.aa.HM.HM6.T2.unify().

Here is the call graph for this function:

◆ lookup()

T2 com.cliffc.aa.HM.HM6.Lambda.lookup ( String  name)
package

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

Definition at line 325 of file HM6.java.

325  {
326  if( Util.eq(_arg0,name) ) return targ();
327  return _par==null ? null : _par.lookup(name);
328  }

References com.cliffc.aa.HM.HM6.Lambda._arg0, com.cliffc.aa.HM.HM6.Syntax._par, com.cliffc.aa.util.Util.eq(), com.cliffc.aa.HM.HM6.Syntax.lookup(), and com.cliffc.aa.HM.HM6.Lambda.targ().

Here is the call graph for this function:

◆ more_work()

boolean com.cliffc.aa.HM.HM6.Lambda.more_work ( Worklist  work)
package

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

Definition at line 340 of file HM6.java.

340  {
341  if( !more_work_impl(work) ) return false;
342  return _body.more_work(work);
343  }

References com.cliffc.aa.HM.HM6.Lambda._body, com.cliffc.aa.HM.HM6.Syntax.more_work(), and com.cliffc.aa.HM.HM6.Syntax.more_work_impl().

Here is the call graph for this function:

◆ more_work_impl()

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

Definition at line 238 of file HM6.java.

238  {
239  return work.has(this) || !hm(null); // Either on worklist, or no-progress
240  }

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

Referenced by com.cliffc.aa.HM.HM6.Con.more_work(), com.cliffc.aa.HM.HM6.Ident.more_work(), com.cliffc.aa.HM.HM6.Lambda.more_work(), com.cliffc.aa.HM.HM6.Lambda2.more_work(), com.cliffc.aa.HM.HM6.Let.more_work(), and com.cliffc.aa.HM.HM6.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.HM6.Syntax.p ( )
inherited

Definition at line 245 of file HM6.java.

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

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

Here is the call graph for this function:

◆ p0()

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

Definition at line 246 of file HM6.java.

246  {
247  _t.get_dups(dups);
248  _t.str(p1(sb.i()).p(" "), new VBitSet(),dups).nl();
249  return p2(sb.ii(1),dups).di(1);
250  }

References com.cliffc.aa.HM.HM6.Syntax._t, com.cliffc.aa.util.SB.di(), com.cliffc.aa.HM.HM6.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.HM6.Syntax.p1(), com.cliffc.aa.HM.HM6.Syntax.p2(), and com.cliffc.aa.HM.HM6.T2.str().

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

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

◆ p1()

SB com.cliffc.aa.HM.HM6.Lambda.p1 ( SB  sb)
package

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

Definition at line 311 of file HM6.java.

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

References com.cliffc.aa.HM.HM6.Lambda._arg0, and com.cliffc.aa.util.SB.p().

Here is the call graph for this function:

◆ p2()

SB com.cliffc.aa.HM.HM6.Lambda.p2 ( SB  sb,
VBitSet  dups 
)
package

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

Definition at line 312 of file HM6.java.

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

References com.cliffc.aa.HM.HM6.Lambda._body, and com.cliffc.aa.HM.HM6.Syntax.p0().

Here is the call graph for this function:

◆ prep_lookup_deps()

void com.cliffc.aa.HM.HM6.Lambda.prep_lookup_deps ( Ident  id)
package

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

Definition at line 337 of file HM6.java.

337  {
338  if( Util.eq(id._name,_arg0) ) _targ.push_update(id);
339  }

References com.cliffc.aa.HM.HM6.Lambda._arg0, com.cliffc.aa.HM.HM6.Lambda._targ, com.cliffc.aa.util.Util.eq(), and com.cliffc.aa.HM.HM6.T2.push_update().

Here is the call graph for this function:

◆ prep_tree()

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

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

Definition at line 333 of file HM6.java.

333  {
334  prep_tree_impl(par,nongen,work,T2.make_leaf());
335  return _body.prep_tree(this,new VStack(nongen,_targ),work) + 1;
336  }

References com.cliffc.aa.HM.HM6.Lambda._body, com.cliffc.aa.HM.HM6.Lambda._targ, com.cliffc.aa.HM.HM6.T2.make_leaf(), com.cliffc.aa.HM.HM6.Syntax.prep_tree(), and com.cliffc.aa.HM.HM6.Syntax.prep_tree_impl().

Here is the call graph for this function:

◆ prep_tree_impl()

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

Definition at line 228 of file HM6.java.

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

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

Referenced by com.cliffc.aa.HM.HM6.Con.prep_tree(), com.cliffc.aa.HM.HM6.Ident.prep_tree(), com.cliffc.aa.HM.HM6.Lambda.prep_tree(), com.cliffc.aa.HM.HM6.Lambda2.prep_tree(), com.cliffc.aa.HM.HM6.Let.prep_tree(), and com.cliffc.aa.HM.HM6.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.HM6.Lambda.str ( SB  sb)
package

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

Definition at line 310 of file HM6.java.

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

References com.cliffc.aa.HM.HM6.Lambda._arg0, com.cliffc.aa.HM.HM6.Lambda._body, com.cliffc.aa.util.SB.p(), and com.cliffc.aa.HM.HM6.Syntax.str().

Here is the call graph for this function:

◆ targ()

T2 com.cliffc.aa.HM.HM6.Lambda.targ ( )
package

Definition at line 313 of file HM6.java.

313 { T2 targ = _targ.find(); return targ==_targ ? targ : (_targ=targ); }

References com.cliffc.aa.HM.HM6.Lambda._targ, com.cliffc.aa.HM.HM6.T2.find(), and com.cliffc.aa.HM.HM6.Lambda.targ().

Referenced by com.cliffc.aa.HM.HM6.Lambda.add_occurs(), com.cliffc.aa.HM.HM6.Lambda.hm(), com.cliffc.aa.HM.HM6.Lambda.lookup(), and com.cliffc.aa.HM.HM6.Lambda.targ().

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

◆ toString()

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

Definition at line 242 of file HM6.java.

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

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

Here is the call graph for this function:

Member Data Documentation

◆ _arg0

◆ _body

◆ _nongen

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

◆ _par

◆ _t

◆ _targ


The documentation for this class was generated from the following file:
com.cliffc.aa.HM.HM6.Syntax.lookup
abstract T2 lookup(String name)
com.cliffc.aa.HM.HM6.Syntax._t
T2 _t
Definition: HM6.java:213
com.cliffc.aa.HM.HM6.T2.str
SB str(SB sb, VBitSet visit, VBitSet dups)
Definition: HM6.java:836
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.HM6.T2.get_dups
VBitSet get_dups(VBitSet dups)
Definition: HM6.java:823
com.cliffc.aa.HM.HM6.Lambda.targ
T2 targ()
Definition: HM6.java:313
com.cliffc.aa.HM.HM6.Lambda._arg0
final String _arg0
Definition: HM6.java:306
com.cliffc.aa.HM.HM6.Syntax.prep_tree_impl
final void prep_tree_impl(Syntax par, VStack nongen, Worklist work, T2 t)
Definition: HM6.java:228
com.cliffc.aa.HM.HM6.Lambda._body
final Syntax _body
Definition: HM6.java:307
com.cliffc.aa.HM.HM6.T2._deps
Ary< Ident > _deps
Definition: HM6.java:519
com.cliffc.aa.HM.HM6.Syntax.p2
abstract SB p2(SB sb, VBitSet dups)
com.cliffc.aa.HM.HM6.Syntax._nongen
VStack _nongen
Definition: HM6.java:212
com.cliffc.aa.HM.HM6.Syntax.more_work
abstract boolean more_work(Worklist work)
com.cliffc.aa.HM.HM6.T2.make_leaf
static T2 make_leaf()
Definition: HM6.java:523
com.cliffc.aa.HM.HM6.T2.find
T2 find()
Definition: HM6.java:543
com.cliffc.aa.HM.HM6.T2.push_update
boolean push_update(Ident a)
Definition: HM6.java:795
com.cliffc.aa.HM.HM6.Syntax._par
Syntax _par
Definition: HM6.java:211
com.cliffc.aa.util.Util
Definition: Util.java:5
com.cliffc.aa.HM.HM6.Syntax.p1
abstract SB p1(SB sb)
com.cliffc.aa.HM.HM6.Lambda._targ
T2 _targ
Definition: HM6.java:308
com.cliffc.aa.HM.HM6.Syntax.str
abstract SB str(SB sb)
com.cliffc.aa.HM.HM6.Syntax.find
T2 find()
Definition: HM6.java:214
com.cliffc.aa.util.VBitSet
Definition: VBitSet.java:5
com.cliffc.aa.util.SB
Tight/tiny StringBuilder wrapper.
Definition: SB.java:8
com.cliffc.aa.util.SB.nl
SB nl()
Definition: SB.java:48
com.cliffc.aa.util.SB.p
SB p(String s)
Definition: SB.java:13
com.cliffc.aa.util.SB.i
SB i(int d)
Definition: SB.java:38
com.cliffc.aa.HM.HM6.Syntax.hm
abstract boolean hm(Worklist work)
com.cliffc.aa.HM.HM6.Syntax.prep_tree
abstract int prep_tree(Syntax par, VStack nongen, Worklist work)
com.cliffc.aa.util.SB.toString
String toString()
Definition: SB.java:62
com.cliffc.aa.HM.HM6.Syntax.more_work_impl
final boolean more_work_impl(Worklist work)
Definition: HM6.java:238
com.cliffc.aa.HM.HM6.Syntax.p0
final SB p0(SB sb, VBitSet dups)
Definition: HM6.java:246