Esempio n. 1
0
        /// <summary>
        /// Restarts a check of number types.
        /// </summary>
        public void RestartNumberType(ref bool isChanged)
        {
            foreach (IEntityDeclaration EntityDeclaration in EntityDeclarationList)
            {
                EntityDeclaration.RestartNumberType(ref isChanged);
            }

            foreach (IInstruction Instruction in InitInstructionList)
            {
                Instruction.RestartNumberType(ref isChanged);
            }

            ((IExpression)WhileCondition).RestartNumberType(ref isChanged);

            foreach (IInstruction Instruction in LoopInstructionList)
            {
                Instruction.RestartNumberType(ref isChanged);
            }

            foreach (IInstruction Instruction in IterationInstructionList)
            {
                Instruction.RestartNumberType(ref isChanged);
            }

            if (Variant.IsAssigned)
            {
                ((IExpression)Variant.Item).RestartNumberType(ref isChanged);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Restarts a check of number types.
        /// </summary>
        public void RestartNumberType(ref bool isChanged)
        {
            foreach (IEntityDeclaration EntityDeclaration in ParameterList)
            {
                EntityDeclaration.RestartNumberType(ref isChanged);
            }

            ((IBody)CommandBody).RestartNumberType(ref isChanged);
        }
Esempio n. 3
0
        /// <summary>
        /// Restarts a check of number types.
        /// </summary>
        public void RestartNumberType(ref bool isChanged)
        {
            foreach (IEntityDeclaration EntityDeclaration in EntityDeclarationList)
            {
                EntityDeclaration.RestartNumberType(ref isChanged);
            }

            foreach (IInstruction Instruction in BodyInstructionList)
            {
                Instruction.RestartNumberType(ref isChanged);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Restarts a check of number types.
        /// </summary>
        public void RestartNumberType(ref bool isChanged)
        {
            foreach (IEntityDeclaration EntityDeclaration in ParameterList)
            {
                EntityDeclaration.RestartNumberType(ref isChanged);
            }

            foreach (IEntityDeclaration EntityDeclaration in ResultList)
            {
                EntityDeclaration.RestartNumberType(ref isChanged);
            }

            if (Variant.IsAssigned)
            {
                ((IExpression)Variant).RestartNumberType(ref isChanged);
            }

            ((IBody)QueryBody).RestartNumberType(ref isChanged);

            if (ParameterTable.Count > 0)
            {
                if (NumberArgumentTable.Count == 0)
                {
                    for (int i = 0; i < ParameterTable.Count; i++)
                    {
                        IParameter Parameter = ParameterTable[i];
                        NumberArgumentTable.Add(Parameter, new List <NumberKinds>());
                    }
                }
                else
                {
                    // Result of the previous pass.
                    for (int i = 0; i < ParameterTable.Count; i++)
                    {
                        IParameter Parameter = ParameterTable[i];
                        Debug.Assert(NumberArgumentTable.ContainsKey(Parameter));

                        Debug.Assert(Parameter.ResolvedParameter.ResolvedEffectiveType.IsAssigned);

                        if (Parameter.ResolvedParameter.ResolvedEffectiveType.Item is ICompiledNumberType AsNumberType)
                        {
                            NumberKinds BestGuess = AsNumberType.GetDefaultNumberKind();
                            UpdateParameterKind(NumberArgumentTable[Parameter], ref BestGuess);
                            AsNumberType.UpdateNumberKind(BestGuess, ref isChanged);
                        }

                        NumberArgumentTable[Parameter].Clear();
                    }
                }
            }
        }