/*
         * @throws ConversionException
         */
        public ITES5Value CreateValue(ITES4Value value, TES5CodeScope codeScope, TES5GlobalScope globalScope, TES5MultipleScriptsScope multipleScriptsScope)
        {
            ITES4Primitive primitive = value as ITES4Primitive;

            if (primitive != null)
            {
                return(TES5PrimitiveValueFactory.createValue(primitive));
            }
            ITES4Reference reference = value as ITES4Reference;

            if (reference != null)
            {
                return(this.referenceFactory.CreateReadReference(reference.StringValue, globalScope, multipleScriptsScope, codeScope.LocalScope));
            }
            ITES4Callable callable = value as ITES4Callable;

            if (callable != null)
            {
                return(this.CreateCodeChunk(callable, codeScope, globalScope, multipleScriptsScope));
            }
            ITES4BinaryExpression expression = value as ITES4BinaryExpression;

            if (expression != null)
            {
                return(this.ConvertExpression(expression, codeScope, globalScope, multipleScriptsScope));
            }
            throw new ConversionException("Unknown ITES4Value: " + value.GetType().FullName);
        }
예제 #2
0
 public TES4VariableAssignation(ITES4Reference reference, ITES4Value value)
 {
     this.Reference = reference;
     this.Value     = value;
 }