Пример #1
0
 public void Parse(Context context)
 {
     mContext = context;
     string currentTokenValue;
     while (true)
     {
         currentTokenValue = context.CurrentToken().Value.ToLower();
         if (currentTokenValue == "read" || currentTokenValue == "write" || currentTokenValue == "check")
         {
             mAction = currentTokenValue;
             context.SkipToken(context.CurrentToken().Value);
         }
         else if (currentTokenValue == ";")
         {
             break;
         }
         else
         {
             mLiterals = new Literal();
             mLiterals.Parse(context);
         }
     }
 }
Пример #2
0
        public IAccessiable ResolveExecuter(Literal obj)
        {
            object result = null;
            Type type;
            foreach (string qulifiedPath in mAssemblyQualifiePath4Executoer)
            {
                string triedName = qulifiedPath + "." + obj[0].ToString();
                try
                {
                    type = Type.GetType(triedName, true,/*ignore type case*/true);
                    result = Activator.CreateInstance(type);
                    break;
                }
                catch (TypeLoadException ex)
                {
                    continue;
                }
                catch (System.IO.FileNotFoundException ex)
                {
                    continue;
                }
            }

            return (result as IAccessiable);
        }