Antlr4.Codegen.CodeGenerator.Write C# (CSharp) Method

Write() public method

public Write ( Template code, string fileName ) : void
code Template
fileName string
return void
        public virtual void Write(Template code, string fileName)
        {
            try
            {
                Stopwatch stopwatch = Stopwatch.StartNew();
                using (TextWriter w = tool.GetOutputFileWriter(g, fileName))
                {
                    ITemplateWriter wr = new AutoIndentWriter(w);
                    wr.LineWidth = lineWidth;
                    code.Write(wr);
                }

                stopwatch.Stop();
            }
            catch (IOException ioe)
            {
                tool.errMgr.ToolError(ErrorType.CANNOT_WRITE_FILE,
                                      ioe,
                                      fileName);
            }
        }