Ejemplo n.º 1
0
 public override void ResolveNames(LexicalScope scope)
 {
     if (scope != null)
     {
         declaration = scope.Resolve(operation);
     }
     if (declaration == null)
     {
         Console.WriteLine("Error: {0}", operation);
         throw new Exception(operation + " does not exist");
     }
 }
Ejemplo n.º 2
0
 public override void ResolveNames(LexicalScope scope)
 {
     if (scope != null)
     {
         declaration = scope.Resolve(name);
         if (declaration == null)
         {
             Console.Error.WriteLine("Error: Undeclared identifier {0}\n", name);
             throw new Exception("Name Resolution error");
         }
     }
 }
Ejemplo n.º 3
0
            public override bool ResolveNames(LexicalScope scope)
            {
                if (scope != NULL)
                {
                    declaration = scope.Resolve(name);
                }

                if (declaration == NULL)
                {
                    Console.WriteLine(stderr, "Error: Undeclared identifier %s\n", name.c_str());
                }

                return(declaration != NULL);
            }
Ejemplo n.º 4
0
        public Declaration Resolve(string symbol)
        {
            Declaration local = ResolveHere(symbol);

            if (local != null)
            {
                return(local);
            }
            else if (parentScope != null)
            {
                return(parentScope.Resolve(symbol));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 5
0
        public override void ResolveNames(LexicalScope ls)
        {
            if (ls != null)
            {
                var result = ls.Resolve(Identifier.Name);
                if (result == null)
                {
                    throw new ApplicationException($"Error: Undeclared identifier {Identifier.Name}");
                }
                else
                {
                    Declaration = result;
                    type        = Declaration.GetDeclarationType();
                }
            }

            //ls.SymbolTable.Add(GetName(), this);
        }