Example #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="Document"> The compilation document </param>
 /// <param name="destination">The Output stream for the generated code</param>
 /// <param name="skeletons">All skeletons pattern for code generation </param>
 public Generator(TypeCobol.Compiler.CompilationDocument document, TextWriter destination, List <Skeleton> skeletons)
 {
     this.CompilationResults = document;
     Destination             = destination;
     Actions = new GeneratorActions(skeletons, document);
     //To Store Erased Nodes by the Erase Action.
     ErasedNodes = new List <Node>();
     //The After Action Listener
     Actions.AfterAction += OnAfterAction;
 }
Example #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Document"> The compilation document </param>
        /// <param name="destination">The Output stream for the generated code</param>
        /// <param name="skeletons">All skeletons pattern for code generation </param>
        public Generator(TypeCobol.Compiler.CompilationDocument document, TextWriter destination, List <Skeleton> skeletons, string typeCobolVersion)
        {
            this.CompilationResults = document;
            this.TypeCobolVersion   = typeCobolVersion;
            Destination             = destination;

            //Add version to output file
            if (!string.IsNullOrEmpty(TypeCobolVersion))
            {
                Destination.WriteLine("      *TypeCobol_Version:" + TypeCobolVersion);
            }

            Actions = new GeneratorActions(this, skeletons, document);
            //To Store Erased Nodes by the Erase Action.
            ErasedNodes = new List <Node>();
            //The After Action Listener
            Actions.AfterAction += OnAfterAction;
        }