示例#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();
 }