コード例 #1
0
 /// <summary>
 /// Instantiates the correct type of component.
 /// </summary>
 /// <param name="component">The component.</param>
 /// <param name="localVariable">The local variable.</param>
 /// <returns></returns>
 private LocalVariableComponent InstantiateTheCorrectTypeOfComponent(Object component,VariableType localVariable)
 {
     if (component is ObjectComponentType)
         return new LocalVariableObjectComponent((ObjectComponentType)component, systemCharacteristics);
     if (component is VariableComponentType)
         return new LocalVariableVariablesComponent(
             localVariable, 
             (VariableComponentType)component, 
             this.variablesOfDefinitions, 
             this.systemCharacteristics,
             this.ExternalVariables);
     if (component is LiteralComponentType)
         return new LocalVariableLiteralComponent((LiteralComponentType)component);
     if (component is ConcatFunctionType)
         return this.CreateConcatFunctionComponent(component,localVariable);
     if (component is ArithmeticFunctionType)
         return this.CreateArithmeticFunctionComponent(component, localVariable);
     if (component is BeginFunctionType)
         return this.CreateBeginFunctionComponent(component, localVariable);
     if (component is EndFunctionType)
         return this.CreateEndFunctionComponent(component, localVariable);
     if (component is SubstringFunctionType)
         return this.CreateSubstringFunctionComponent(component, localVariable);
     if (component is SplitFunctionType)
         return this.CreateSplitFunctionComponent(component, localVariable);
     if (component is TimeDifferenceFunctionType)
         return this.CreateTimeDifferenceComponent(component, localVariable);
     if (component is RegexCaptureFunctionType)
         return this.CreateRegexCaptureFunctionComponent(component, localVariable);
     if (component is EscapeRegexFunctionType)
         return this.CreateEscapeRegexFunctionComponent(component, localVariable);
     if (component is UniqueFunctionType)
         return this.CreateUniqueFunctionComponent(component, localVariable);
     if (component is CountFunctionType)
         return this.CreateCountFunctionComponent(component, localVariable);
     return null;
 }
コード例 #2
0
 private LocalVariableComponent CreateEscapeRegexFunctionComponent(object component, VariableType localVariable)
 {
     EscapeRegexFunctionType escapeRegexFunctionType = (EscapeRegexFunctionType)component;
     EscapeRegexFunctionComponent escapeRegexFunctionComponent = new EscapeRegexFunctionComponent(escapeRegexFunctionType);
     LocalVariableComponent variableComponent = this.InstantiateTheCorrectTypeOfComponent(escapeRegexFunctionType.Item, localVariable);
     escapeRegexFunctionComponent.AddComponent(variableComponent);
     return escapeRegexFunctionComponent;
 }   
コード例 #3
0
        private LocalVariableComponent CreateTimeDifferenceComponent(object component, VariableType localVariable)
        {
            TimeDifferenceFunctionType timeDifferenceType = (TimeDifferenceFunctionType)component;
            TimeDifferenceFunctionComponent timeDifferenceComponent = new TimeDifferenceFunctionComponent(timeDifferenceType);

            for (int i = 0; i < timeDifferenceType.Items.Count(); i++)
            {
                LocalVariableComponent variableComponent = this.InstantiateTheCorrectTypeOfComponent(timeDifferenceType.Items[i],localVariable);
                timeDifferenceComponent.AddComponent(variableComponent);
            }
            return timeDifferenceComponent;
        }
コード例 #4
0
 private LocalVariableComponent CreateRegexCaptureFunctionComponent(object component, VariableType localVariable)
 {
     RegexCaptureFunctionType regexCaptureFunctionType = (RegexCaptureFunctionType)component;
     RegexCaptureFunctionComponent regexCaptureFunctionComponent = new RegexCaptureFunctionComponent(regexCaptureFunctionType);
     LocalVariableComponent variableComponent = this.InstantiateTheCorrectTypeOfComponent(regexCaptureFunctionType.Item, localVariable);
     regexCaptureFunctionComponent.AddComponent(variableComponent);
     return regexCaptureFunctionComponent;
 }
コード例 #5
0
 private LocalVariableComponent CreateSubstringFunctionComponent(Object component, VariableType localVariable)
 {
     SubstringFunctionType substringFunctionType = (SubstringFunctionType)component;
     SubStringFunctionComponent subStringFunctionComponent = new SubStringFunctionComponent(substringFunctionType);
     LocalVariableComponent variableComponent = this.InstantiateTheCorrectTypeOfComponent(substringFunctionType.Item, localVariable);
     subStringFunctionComponent.AddComponent(variableComponent);
     return subStringFunctionComponent;
 }
コード例 #6
0
 private LocalVariableComponent CreateSplitFunctionComponent(object component, VariableType localVariable)
 {
     SplitFunctionType splitFunctionType = (SplitFunctionType)component;
     SplitFunctionComponent splitFunctionComponent = new SplitFunctionComponent(splitFunctionType);
     LocalVariableComponent variableComponent = this.InstantiateTheCorrectTypeOfComponent(splitFunctionType.Item, localVariable);
     splitFunctionComponent.AddComponent(variableComponent);
     return splitFunctionComponent;
 }
コード例 #7
0
        private LocalVariableComponent CreateEndFunctionComponent(object component, VariableType localVariable)
        {
            EndFunctionType endFunctionType = (EndFunctionType)component;
            EndFunctionComponent endFunctionComponent = new EndFunctionComponent(endFunctionType);
            LocalVariableComponent localVariableComponent = this.InstantiateTheCorrectTypeOfComponent(endFunctionType.Item, localVariable);
            endFunctionComponent.AddComponent(localVariableComponent);
            return endFunctionComponent;

        }
コード例 #8
0
 private LocalVariableComponent CreateBeginFunctionComponent(object component, VariableType localVariable)
 {
     BeginFunctionType beginFunctionType = (BeginFunctionType)component;
     BeginFunctionComponent beginFunctionComponent = new BeginFunctionComponent(beginFunctionType);
     LocalVariableComponent localVariableComponent = this.InstantiateTheCorrectTypeOfComponent(beginFunctionType.Item, localVariable);
     beginFunctionComponent.AddComponent(localVariableComponent);
     return beginFunctionComponent;
 }
コード例 #9
0
        private LocalVariableComponent CreateArithmeticFunctionComponent(Object component, VariableType localVariable)
        {
            ArithmeticFunctionType arithmeticFunctionType = (ArithmeticFunctionType)component;
            ArithmeticFunctionComponent arithmeticFunctionComponent = new ArithmeticFunctionComponent(arithmeticFunctionType);

            for (int i = 0; i < arithmeticFunctionType.Items.Count(); i++)
            {
                LocalVariableComponent variableComponent = this.InstantiateTheCorrectTypeOfComponent(arithmeticFunctionType.Items[i],localVariable);
                arithmeticFunctionComponent.AddComponent(variableComponent);
            }
            return arithmeticFunctionComponent;
        }
コード例 #10
0
        /// <summary>
        /// Creates the concat function component.
        /// </summary>
        /// <param name="component">The component.</param>
        /// <param name="localVariable">The local variable.</param>
        /// <returns></returns>
        private LocalVariableComponent CreateConcatFunctionComponent(Object component, VariableType localVariable)
        {
            ConcatFunctionType concatFunctionType = (ConcatFunctionType)component;
            ConcatFunctionComponent concatFunctionComponent = new ConcatFunctionComponent(concatFunctionType, this.variablesOfDefinitions,this.systemCharacteristics);

            for (int i = 0; i < concatFunctionType.Items.Count(); i++)
            {
                LocalVariableComponent variableComponent = this.InstantiateTheCorrectTypeOfComponent(concatFunctionType.Items[i],localVariable);
                concatFunctionComponent.AddComponent(variableComponent);
            }
            return concatFunctionComponent;
        }
コード例 #11
0
        private LocalVariableComponent CreateUniqueFunctionComponent(object component, VariableType localVariable)
        {
            var uniqueFunctionType = (UniqueFunctionType)component;
            var uniqueFunctionComponent = new UniqueFunctionComponent(uniqueFunctionType, this.variablesOfDefinitions, this.systemCharacteristics);

            for (int i = 0; i < uniqueFunctionType.Items.Count(); i++)
            {
                LocalVariableComponent variableComponent = this.InstantiateTheCorrectTypeOfComponent(uniqueFunctionType.Items[i], localVariable);
                uniqueFunctionComponent.AddComponent(variableComponent);
            }
            return uniqueFunctionComponent;
        }