Пример #1
0
        public bool HasVariable(string variableName)
        {
            CSScope next = Current;

            while (next != null)
            {
                if (next.HasVariable(variableName))
                {
                    return(true);
                }

                next = next._parent;
            }
            return(false);
        }
Пример #2
0
        public CSObject GetVariable(string variableName)
        {
            CSScope  next = Current;
            CSObject val;

            while (next != null)
            {
                if (next.TryGetVariable(variableName, out val))
                {
                    return(val);
                }
                next = next._parent;
            }
            CSLog.E("Variable: " + variableName + " does not exist...");
            return(null);
        }
Пример #3
0
        public bool TryGetVariable(string variableName, out CSObject obj)
        {
            CSScope  next = Current;
            CSObject val;

            while (next != null)
            {
                if (next.TryGetVariable(variableName, out val))
                {
                    obj = val;
                    return(true);
                }
                next = next._parent;
            }
            obj = null;
            return(false);
        }
Пример #4
0
 public CSState()
 {
     _current = new CSScope();
 }