GenFile() protected method

protected GenFile ( Grammar g, Template outputFileST, string fileName ) : void
g Antlr4.Tool.Grammar
outputFileST Template
fileName string
return void
Example #1
0
        public virtual void WriteBaseVisitor(Template outputFileST, bool header)
        {
            AbstractTarget target = GetTarget();

            if (target == null)
            {
                throw new NotSupportedException("Cannot generate code without a target.");
            }

            target.GenFile(g, outputFileST, GetBaseVisitorFileName(header));
        }
Example #2
0
        public virtual void WriteVocabFile()
        {
            AbstractTarget target = GetTarget();

            if (target == null)
            {
                throw new NotSupportedException("Cannot generate code without a target.");
            }

            // write out the vocab interchange file; used by ANTLR,
            // does not change per target
            Template tokenVocabSerialization = GetTokenVocabOutput();
            string   fileName = GetVocabFileName();

            if (fileName != null)
            {
                target.GenFile(g, tokenVocabSerialization, fileName);
            }
        }