Example #1
0
 public virtual Value Invoke(List Arguments)
 {
     if (Identifiers.ContainsKey("Constructor"))
     {
         Value constructor = Identifiers["Constructor"].ReferencingValue;
         if (constructor is IInvokable)
         {
             (constructor as IInvokable).Invoke(Arguments);
         }
     }
     return(this);
 }
Example #2
0
 public override void Destroy()
 {
     foreach (var reference in Arr)
     {
         reference.Dereference();
     }
     if (Identifiers.ContainsKey("this"))
     {
         Compiler.FreeMemoy(Identifiers["this"].Index);
         Identifiers.Remove("this");
     }
     Identifiers.Destroy();
 }
Example #3
0
        private void IdentifierOut(StringBuilder sb)
        {
            var str = sb.ToString();

            //handle keyword
            if (Keywords.ContainsKey(str))
            {
                Output.Add(Keywords[str]);
            }
            else if (Identifiers.ContainsKey(str)) //handle existing user identifier
            {
                Output.Add(Identifiers[str]);
            }
            else //create new identifier
            {
                Identifiers.Add(str);
                Output.Add(Identifiers[str]);
            }
        }