Example #1
0
        /// <summary>
        /// Inserts a ILElementInfo in the context table
        /// </summary>
        /// <param name="name">name of the element</param>
        /// <param name="element">element to insert</param>
        /// <returns>the inserted element</returns>
        public ILElementInfo InsertILElement(string name, ILElementInfo element)
        {
            switch (element.ElementKind)
            {
            case SymbolKind.Type:
                return(currentContext.InsertType(name, element));

            case SymbolKind.Variable:
            case SymbolKind.Function:
            case SymbolKind.Procedure:
                return(currentContext.InsertVarOrCallable(name, element));

            default:
                return(null);
            }
        }
Example #2
0
 public ILElementInfo InsertVarOrCallable(string name, ILElementInfo element)
 {
     ///asumimos que no va a haber nada repetido
     varsAndFunctions.Add(name, element);
     return(element);
 }
Example #3
0
 /// <summary>
 /// Inserts a new ILElementInfo
 /// </summary>
 /// <param name="name">id of the ILElementInfo</param>
 /// <param name="element">the ILElementInfo</param>
 /// <returns>Inserted ILElementInfo</returns>
 public ILElementInfo InsertType(string name, ILElementInfo element)
 {
     ///asumimos que no va a haber nada repetido
     types.Add(name, element);
     return(element);
 }
Example #4
0
 public ILElementInfo InsertPredefinedCallable(string name, ILElementInfo element)
 {
     globalContext.InsertVarOrCallable(name, element);
     return(element);
 }