aa
com.cliffc.aa.HM.HM3.Ident Class Reference
Inheritance diagram for com.cliffc.aa.HM.HM3.Ident:
[legend]
Collaboration diagram for com.cliffc.aa.HM.HM3.Ident:
[legend]

Public Member Functions

String toString ()
 

Protected Member Functions

final void add_work (Worklist work)
 

Package Functions

 Ident (String name)
 
final void add_neighbors (Worklist work)
 
final boolean all_kids_ready ()
 
boolean check_progress (Worklist work)
 
void get_ids (VStack vstk, Worklist work)
 
HMType hm (Worklist work)
 
boolean progress ()
 

Package Attributes

HMType _hm
 
Syntax[] _kids
 
final String _name
 
Syntax _par
 
VStack _vstk
 

Detailed Description

Definition at line 165 of file HM3.java.

Constructor & Destructor Documentation

◆ Ident()

com.cliffc.aa.HM.HM3.Ident.Ident ( String  name)
package

Definition at line 168 of file HM3.java.

168 { _name=name; }

References com.cliffc.aa.HM.HM3.Ident._name.

Member Function Documentation

◆ add_neighbors()

final void com.cliffc.aa.HM.HM3.Syntax.add_neighbors ( Worklist  work)
packageinherited

Definition at line 128 of file HM3.java.

128  {
129  if( _par!=null ) _par.add_work(work);
130  if( _kids!=null )
131  for( Syntax kid : _kids )
132  kid.add_work(work);
133  }

References com.cliffc.aa.HM.HM3.Syntax._kids, com.cliffc.aa.HM.HM3.Syntax._par, and com.cliffc.aa.HM.HM3.Syntax.add_work().

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

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

◆ add_work()

final void com.cliffc.aa.HM.HM3.Syntax.add_work ( Worklist  work)
protectedinherited

Definition at line 126 of file HM3.java.

126 { if( all_kids_ready() ) work.push(this); }

References com.cliffc.aa.HM.HM3.Syntax.all_kids_ready(), and com.cliffc.aa.HM.HM3.Worklist.push().

Referenced by com.cliffc.aa.HM.HM3.Syntax.add_neighbors(), com.cliffc.aa.HM.HM3.Con.get_ids(), and com.cliffc.aa.HM.HM3.Ident.get_ids().

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

◆ all_kids_ready()

final boolean com.cliffc.aa.HM.HM3.Syntax.all_kids_ready ( )
packageinherited

Definition at line 135 of file HM3.java.

135  {
136  if( _kids==null ) return true;
137  for( Syntax kid : _kids ) if( kid._hm==null ) return false;
138  return true;
139  }

References com.cliffc.aa.HM.HM3.Syntax._kids.

Referenced by com.cliffc.aa.HM.HM3.Syntax.add_work(), and com.cliffc.aa.HM.HM3.Syntax.check_progress().

Here is the caller graph for this function:

◆ check_progress()

boolean com.cliffc.aa.HM.HM3.Syntax.check_progress ( Worklist  work)
packageinherited

Definition at line 144 of file HM3.java.

144  {
145  if( all_kids_ready() ) // If kids are not ready, then cannot compute hm() so not on worklist
146  if( _hm==null || progress() ) // Progress is possible
147  if( !work.has(this) ) // Not on worklist?
148  return false; // Fails check
149  if( _kids!=null ) // For all kids
150  for( Syntax kid : _kids )
151  if( !kid.check_progress(work) ) // Recursively check nodes that can make progress on worklist
152  return false;
153  return true;
154  }

References com.cliffc.aa.HM.HM3.Syntax._hm, com.cliffc.aa.HM.HM3.Syntax._kids, com.cliffc.aa.HM.HM3.Syntax.all_kids_ready(), com.cliffc.aa.HM.HM3.Worklist.has(), and com.cliffc.aa.HM.HM3.Syntax.progress().

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

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

◆ get_ids()

void com.cliffc.aa.HM.HM3.Ident.get_ids ( VStack  vstk,
Worklist  work 
)
package

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

Definition at line 178 of file HM3.java.

178  {
179  HMType t = ENV.get(_name);
180  if( t==null )
181  throw new RuntimeException("Parse error, "+_name+" is undefined");
182  if( t._ids==null ) t._ids = new Ary<>(Ident.class);
183  t._ids.push(this);
184  _vstk=vstk;
185  add_work(work);
186  }

References com.cliffc.aa.HM.HM3.HMType._ids, com.cliffc.aa.HM.HM3.Ident._name, com.cliffc.aa.HM.HM3.Ident._vstk, com.cliffc.aa.HM.HM3.Syntax.add_work(), and com.cliffc.aa.HM.HM3.ENV.

Here is the call graph for this function:

◆ hm()

HMType com.cliffc.aa.HM.HM3.Ident.hm ( Worklist  work)
package

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

Definition at line 170 of file HM3.java.

170  {
171  if( _hm!=null ) return null;
172  HMType t = ENV.get(_name).find();
173  return t.fresh(_vstk);
174  }

References com.cliffc.aa.HM.HM3.Syntax._hm, com.cliffc.aa.HM.HM3.Ident._name, com.cliffc.aa.HM.HM3.Ident._vstk, com.cliffc.aa.HM.HM3.ENV, and com.cliffc.aa.HM.HM3.HMType.fresh().

Here is the call graph for this function:

◆ progress()

boolean com.cliffc.aa.HM.HM3.Ident.progress ( )
package

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

Definition at line 177 of file HM3.java.

177 { return false; }

◆ toString()

String com.cliffc.aa.HM.HM3.Ident.toString ( )

Definition at line 169 of file HM3.java.

169 { return _name; }

References com.cliffc.aa.HM.HM3.Ident._name.

Member Data Documentation

◆ _hm

◆ _kids

◆ _name

final String com.cliffc.aa.HM.HM3.Ident._name
package

◆ _par

Syntax com.cliffc.aa.HM.HM3.Syntax._par
packageinherited

◆ _vstk

VStack com.cliffc.aa.HM.HM3.Ident._vstk
package

Definition at line 167 of file HM3.java.

Referenced by com.cliffc.aa.HM.HM3.Ident.get_ids(), and com.cliffc.aa.HM.HM3.Ident.hm().


The documentation for this class was generated from the following file:
com.cliffc.aa.HM.HM3.Ident._vstk
VStack _vstk
Definition: HM3.java:167
com.cliffc.aa.util.Ary
Definition: Ary.java:11
com.cliffc.aa.HM.HM3.Syntax.all_kids_ready
final boolean all_kids_ready()
Definition: HM3.java:135
com.cliffc.aa.HM.HM3.Syntax.progress
abstract boolean progress()
com.cliffc.aa.HM.HM3.Syntax._par
Syntax _par
Definition: HM3.java:116
com.cliffc.aa.HM.HM3.ENV
static final HashMap< String, HMType > ENV
Definition: HM3.java:32
com.cliffc.aa.HM.HM3.Ident._name
final String _name
Definition: HM3.java:166
com.cliffc.aa.HM.HM3.Ident.Ident
Ident(String name)
Definition: HM3.java:168
com.cliffc.aa.HM.HM3.Syntax.add_work
final void add_work(Worklist work)
Definition: HM3.java:126
com.cliffc.aa.HM.HM3.Syntax._hm
HMType _hm
Definition: HM3.java:118
com.cliffc.aa.HM.HM3.Syntax._kids
Syntax[] _kids
Definition: HM3.java:117