Ejemplo n.º 1
0
        internal override SCode LocateVariable(IVariableSpecializer variable)
        {
            ValueCell cell;

            if (this.importedTopLevelVariables.TryGetValue(variable.Name, out cell))
            {
                return(variable.MakeTopLevel(cell));
            }
            else
            {
                return(this.environment.SpecializeVariable(variable));
            }
        }
Ejemplo n.º 2
0
        internal override SCode LocateVariable(IVariableSpecializer variable)
        {
            int argOffset = this.envClosure.FormalOffset(variable.Name);

            if (argOffset != -1)
            {
                return(variable.MakeArgument(argOffset));
            }

            int staticOffset = this.StaticOffset(variable.Name);

            if (staticOffset != -1)
            {
                return(variable.MakeStatic(staticOffset));
            }
            //// Must be last so that bindings and statics will shadow!
            ValueCell topLevelCell;

            if (this.importedTopLevelVariables.TryGetValue(variable.Name, out topLevelCell))
            {
                return(variable.MakeTopLevel(topLevelCell));
            }
            return(variable.MakeFree());
        }
Ejemplo n.º 3
0
 internal abstract SCode LocateVariable(IVariableSpecializer variable);
Ejemplo n.º 4
0
 internal override SCode LocateVariable(IVariableSpecializer variable)
 {
     throw new NotImplementedException();
 }