Go to the documentation of this file.
8 import java.util.HashSet;
73 boolean first_time =
START ==
null;
130 if( ptr ==
null )
return;
144 if( pscope !=
null &&
_par.
_par !=
null )
178 if( name ==
null )
return null;
188 return scope==
null ? null : scope.
get(name);
205 for(
int i=name.length(); i>0; i-- ) {
224 if( t !=
null )
return t;
230 if( t !=
null )
return t;
239 HashSet<TV2> tvars =
new HashSet<>();
243 if( def !=
null ) tvars.add(def.tvar());
270 cnt += vs._tvars._len;
271 TV2[] tv2s =
new TV2[cnt];
273 for(
VStack vs =
this; vs!=
null; vs=vs.
_par ) {
274 System.arraycopy(vs._tvars._es,0,tv2s,cnt,vs._tvars._len);
275 cnt += vs._tvars._len;
286 for(
VStack vs =
this; vs!=null ; vs=vs.
_par )
287 if( vs._tvars !=
null )
288 for(
TV2 tv2 : vs._tvars )
289 if( tv2 !=
null ) tv2.
find_dups(bs,dups,0);
293 SB sb =
new SB().
p(
"[");
294 for(
VStack vs =
this; vs!=null ; vs=vs.
_par ) {
295 if( vs._tvars !=
null ) {
296 for(
int i=0; i<vs._tvars._len; i++ ) {
297 sb.
p(vs._flds.at(i)).
p(
'=');
298 TV2 tv2 = vs._tvars.at(i);
299 if( tv2 !=
null ) tv2.
str(sb,bs,dups,
false,0,0);
302 if( vs._tvars._len>0 ) sb.
unchar(2);
boolean exists(String name)
void add_type(String name, ConTypeNode t)
static void reset_to_init0()
E push(E e)
Add element in amortized constant time.
Type lookup_valtype(String name)
Node add_fun(Parse bad, String name, Node val)
static final TypeRPC ALL_CALL
Node early_exit(Parse P, Node val)
Node add_work_all(Node n)
an implementation of language AA
void add_type(String name, ConTypeNode t)
public< N extends Node > N keep()
void nongen_push(Env par)
static void record_for_top_reset1()
ConTypeNode lookup_type(String name)
FunPtrNode add_fun(Parse bad, String name, FunPtrNode ptr)
A memory-based collection of optionally named fields.
static BitsAlias ALL_DISPLAYS
HashSet< TV2 > collect_active_scope()
static void reset_to_init0()
public< N extends Node > N unkeep()
static ScopeNode init(Node ctl, Node clo, Node mem, Type back_ptr, Parse errmsg, boolean is_closure)
void close_display(GVNGCM gvn)
abstract Type value(GVNGCM.Mode opt_mode)
static final Ary< NewPrimNode > INTRINSICS
MrgProjNode make_mem_proj(NewNode nn, Node mem)
static Env file_scope(Env top_scope)
final int find_dups(VBitSet bs, NonBlockingHashMapLong< String > dups, int scnt)
static TypeStruct open(Type tdisp)
abstract UnOrFunPtrNode filter(int nargs)
static StartMemNode MEM_0
Tight/tiny StringBuilder wrapper.
static void record_for_top_reset2()
static boolean isOp(String s)
Node do_exit(ScopeNode s, Node rez)
an implementation of language AA
static void reset_to_init0()
static BitsAlias LEX_DISPLAYS
static void reset_to_init0()
void create_active(String name, Node val, Access mutable)
public< N extends Node > N add_flow(N n)
Node nongen_pop(Node ret)
int find(E e)
Find the first matching element using ==, or -1 if none.
public< N extends Node > N set_ctrl(N n)
Env lookup_fref(String tok)
ConTypeNode lookup_type(int alias)
ConTypeNode get_type(String name)
String add_var(String fld, TV2 tv)
void promote_forward(NewObjNode parent)
UnOrFunPtrNode lookup_filter_fresh(String name, int nargs, Node ctrl)
public< N extends Node > N init(N n)
an implementation of language AA
ScopeNode lookup_scope(String name, boolean lookup_current_scope_only)
static void reset_to_init0()
Env(Env par, Parse P, boolean is_closure, Node ctrl, Node mem)