Add generated code file headers and [GeneratedCode] attributes (fixes #11)

This commit is contained in:
Sam Harwell 2013-08-05 20:39:47 -05:00
parent b9d3a129ad
commit 1e4a53919f
1 changed files with 16 additions and 0 deletions

View File

@ -63,6 +63,7 @@ using IToken = Antlr4.Runtime.IToken;
/// This interface defines a complete listener for a parse tree produced by
/// \<see cref="<file.parserName>"/>.
/// \</summary>
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "<file.ANTLRVersion>")]
public interface I<file.grammarName>Listener : IParseTreeListener {
<file.listenerNames:{lname |
/// \<summary>
@ -99,6 +100,7 @@ using ParserRuleContext = Antlr4.Runtime.ParserRuleContext;
/// which can be extended to create a listener which only needs to handle a subset
/// of the available methods.
/// \</summary>
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "<file.ANTLRVersion>")]
public partial class <file.grammarName>BaseListener : I<file.grammarName>Listener {
<file.listenerNames:{lname |
/// \<summary>
@ -147,6 +149,7 @@ using IToken = Antlr4.Runtime.IToken;
/// by \<see cref="<file.parserName>"/>.
/// \</summary>
/// \<typeparam name="Result">The return type of the visit operation.\</typeparam>
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "<file.ANTLRVersion>")]
public interface I<file.grammarName>Visitor\<Result> : IParseTreeVisitor\<Result> {
<file.visitorNames:{lname |
/// \<summary>
@ -178,6 +181,7 @@ using ParserRuleContext = Antlr4.Runtime.ParserRuleContext;
/// of the available methods.
/// \</summary>
/// \<typeparam name="Result">The return type of the visit operation.\</typeparam>
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "<file.ANTLRVersion>")]
public partial class <file.grammarName>BaseVisitor\<Result> : AbstractParseTreeVisitor\<Result>, I<file.grammarName>Visitor\<Result> {
<file.visitorNames:{lname |
/// \<summary>
@ -197,6 +201,16 @@ public virtual Result Visit<lname; format="cap">([NotNull] <file.parserName>.<ln
>>
fileHeader(grammarFileName, ANTLRVersion) ::= <<
//------------------------------------------------------------------------------
// \<auto-generated>
// This code was generated by a tool.
// ANTLR Version: <ANTLRVersion>
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// \</auto-generated>
//------------------------------------------------------------------------------
// Generated from <grammarFileName> by ANTLR <ANTLRVersion>
>>
@ -205,6 +219,7 @@ Parser(parser, funcs, atn, sempredFuncs, superClass) ::= <<
>>
Parser_(parser, funcs, atn, sempredFuncs, ctor, superClass) ::= <<
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "<file.ANTLRVersion>")]
public <if(parser.abstractRecognizer)>abstract <endif>partial class <parser.name> : <superClass> {
<if(parser.tokens)>
public const int
@ -892,6 +907,7 @@ using DFA = Antlr4.Runtime.Dfa.DFA;
>>
Lexer(lexer, atn, actionFuncs, sempredFuncs, superClass) ::= <<
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "<file.ANTLRVersion>")]
public <if(lexer.abstractRecognizer)>abstract <endif>partial class <lexer.name> : <superClass> {
public const int
<lexer.tokens:{k | <k>=<lexer.tokens.(k)>}; separator=", ", wrap, anchor>;