public override ScriptVariableType Process(ScriptParser parser, int level)
        {
            base.Process(parser, level);

            ResultType = ScriptVariableType.Undefined;
            try {
                ScriptVariableDefinition v = parser.GetVariable(VarName.Value);
                ResultType = v.VarType;
            }
            catch {
                parser.Errors.Add(new ErrorInfo(ErrorLevel.Error, ErrorCode.UndefinedVariable, VarName, VarName.Value));
            }
            Value = TypeCastExecutionNode.ImplicitCast(parser, level + 1, ResultType, Value);
            return(ResultType);
        }
Esempio n. 2
0
        public virtual ScriptVariableType Process(ScriptParser parser, int level)
        {
            if (parser.DebugParsing)
            {
                Utils.IndentedOutput(level, "Parse: {0}", GetType().Name);
            }

            ScriptVariableType type = ScriptVariableType.Undefined;

            try {
                type = parser.GetVariable(Value).VarType;
            }
            catch {
                parser.Errors.Add(new ErrorInfo(ErrorLevel.CriticalError, ErrorCode.UndefinedVariable, this, Value));
                throw new ScriptCriticalErrorException();
            }

            return(type);
        }