Ejemplo n.º 1
0
        /// <summary>
        /// Evaluates this node and all its children
        /// </summary>
        /// <param name="scope">The scope of this expression</param>
        /// <returns></returns>
        public override Expression Evaluate(Scope scope)
        {
            // Set return type by getting variable from symbol table
            returnType = scope.GetVariable(name);

            // Check if no type was returned
            if (returnType == null)
            {
                // Issue error
                Compiler.Compiler.errors.SemErr(t.line, t.col, "Unknown variable reference");
            }

            return this;
        }