Exemplo n.º 1
0
    protected void ResolveLocal(ResolvedIdent identifier, int lineNumber)
    {
        Debug.Assert(identifier.m_hops == ResolvedIdent.s_globalScopeOrUnresolved);

        for (int i = 0; i < m_scopes.Count; i++)
        {
            var scope = m_scopes[m_scopes.Count - 1 - i];
            if (scope.ContainsKey(identifier.m_identifier))
            {
                identifier.m_hops = i;
                return;
            }
        }

        // BB (andrews) Can't distinguish between unresolveable lookups and global variables, since
        //  global resolves are done at runtime
    }
Exemplo n.º 2
0
    public bool Get(ResolvedIdent identifier, out object value)
    {
        Environment target = TargetEnvironment(identifier.m_hops);

        return(target.GetInternal(identifier.m_identifier, out value));
    }
Exemplo n.º 3
0
    public bool Assign(ResolvedIdent identifier, object value)
    {
        Environment target = TargetEnvironment(identifier.m_hops);

        return(target.AssignInternal(identifier.m_identifier, value));
    }
Exemplo n.º 4
0
 public AstThisExpr(int line)
     : base(EXPRK.This, line)
 {
     m_identifier = new ResolvedIdent();
     m_identifier.m_identifier = "this";
 }