Beispiel #1
0
        public bool HasVariable(string variableName)
        {
            CSScope next = Current;

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

                next = next._parent;
            }
            return(false);
        }
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #4
0
 public CSState()
 {
     _current = new CSScope();
 }