Ejemplo n.º 1
0
 private void WriteAtomInstance(StreamWriter stream, FunctionAtom atom)
 {
     stream.WriteLine();
     stream.Write("\t");
     atom.WriteSourceCode(stream, TargetLanguage);
     stream.WriteLine();
 }
Ejemplo n.º 2
0
        /// <summary>
        ///   Delete a function atom instance from this function
        /// </summary>
        /// <param name="atomInstance"> The atom instance to delete </param>
        /// <returns> True if atomInstance found and deleted </returns>
        internal bool DeleteAtomInstance(FunctionAtom atomInstance)
        {
            for (int i = 0; i < this.atomInstances.Count; i++)
            {
                if (this.atomInstances[i] == atomInstance)
                {
                    this.atomInstances[i].Dispose();
                    this.atomInstances[i] = null;
                    this.atomInstances.RemoveAt(i);
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///   Builds a map between parameter and all the references to it
        /// </summary>
        /// <param name="funcAtomList"> </param>
        /// <param name="paramsRefMap"> </param>
        internal static void BuildParameterReferenceMap(List <FunctionAtom> funcAtomList,
                                                        Dictionary <Parameter, List <Operand> > paramsRefMap)
        {
            for (int i = 0; i < funcAtomList.Count; i++)
            {
                FunctionAtom curAtom = funcAtomList[i];

                //Deal only with the function invocations.
                if (curAtom is FunctionInvocation)
                {
                    var curFuncInvocation = curAtom as FunctionInvocation;
                    var funcOperands      = curFuncInvocation.OperandList;

                    for (int op = 0; op < funcOperands.Count; op++)
                    {
                        Operand curOperand = funcOperands[op];

                        paramsRefMap[curOperand.Parameter].Add(curOperand);
                    }
                }
            }
        }
Ejemplo n.º 4
0
		private void WriteAtomInstance( StreamWriter stream, FunctionAtom atom )
		{
			stream.WriteLine();
			stream.Write( "\t" );
			atom.WriteSourceCode( stream, TargetLanguage );
			stream.WriteLine();
		}
Ejemplo n.º 5
0
 /// <summary>
 ///   Add a function atom instance to this function
 /// </summary>
 /// <param name="atomInstance"> The atom instance to add </param>
 public void AddAtomInstance(FunctionAtom atomInstance)
 {
     this.atomInstances.Add(atomInstance);
 }