From bcd88c719e3897262c2f6431d3373ecd89d1c12f Mon Sep 17 00:00:00 2001 From: David MARKEY Date: Sun, 31 May 2020 19:05:01 +0200 Subject: [PATCH 1/3] Register as a contribuor --- contributors.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contributors.txt b/contributors.txt index d1c759981..e24449596 100644 --- a/contributors.txt +++ b/contributors.txt @@ -242,4 +242,5 @@ YYYY/MM/DD, github id, Full name, email 2020/02/21, StochasticTinkr, Daniel Pitts, github@coloraura.com 2020/03/17, XsongyangX, Song Yang, songyang1218@gmail.com 2020/04/07, deniskyashif, Denis Kyashif, denis.kyashif@gmail.com -2020/04/30, TristonianJones, Tristan Swadell, tswadell@google.com \ No newline at end of file +2020/04/30, TristonianJones, Tristan Swadell, tswadell@google.com +2020/05/31, d-markey, David Markey, dmarkey@free.fr From 4cfbe5bd78668a294206addd9b6a8aa10d68d7fc Mon Sep 17 00:00:00 2001 From: David MARKEY Date: Sun, 31 May 2020 19:07:13 +0200 Subject: [PATCH 2/3] Update CSharp.stg --- .../org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg index a665ba67b..f3d4c37a2 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg @@ -116,6 +116,7 @@ using ParserRuleContext = Antlr4.Runtime.ParserRuleContext; /// of the available methods. /// \ [System.CodeDom.Compiler.GeneratedCode("ANTLR", "")] +[System.Diagnostics.DebuggerStepThrough] [System.CLSCompliant(false)] public partial class BaseListener : IListener { /// \The return type of the visit operation.\ [System.CodeDom.Compiler.GeneratedCode("ANTLR", "")] +[System.Diagnostics.DebuggerStepThrough] [System.CLSCompliant(false)] public partial class BaseVisitor\ : AbstractParseTreeVisitor\, IVisitor\ { ")] +[System.Diagnostics.DebuggerStepThrough] [System.CLSCompliant(false)] public partial class : { protected static DFA[] decisionToDFA; @@ -855,6 +858,7 @@ CaptureNextTokenType(d) ::= " = TokenStream.LA(1);" StructDecl(struct,ctorAttrs,attrs,getters,dispatchMethods,interfaces,extensionMembers, superClass={ParserRuleContext}) ::= << +[System.Diagnostics.DebuggerStepThrough] public partial class : ParserRuleContext, { ;}; separator="\n"> }; separator="\n"> @@ -878,6 +882,7 @@ public partial class : < >> AltLabelStructDecl(struct,attrs,getters,dispatchMethods) ::= << +[System.Diagnostics.DebuggerStepThrough] public partial class : Context { ;}; separator="\n"> }; separator="\n"> @@ -976,6 +981,7 @@ using DFA = Antlr4.Runtime.Dfa.DFA; Lexer(lexer, atn, actionFuncs, sempredFuncs, superClass) ::= << [System.CodeDom.Compiler.GeneratedCode("ANTLR", "")] +[System.Diagnostics.DebuggerStepThrough] [System.CLSCompliant(false)] public partial class : { protected static DFA[] decisionToDFA; From 2191c386190a7d57d457319dd2f6aec4f0231d4c Mon Sep 17 00:00:00 2001 From: David MARKEY Date: Sun, 31 May 2020 23:27:42 +0200 Subject: [PATCH 3/3] Prefer "DebuggerNonUserCode" --- .../tool/templates/codegen/CSharp/CSharp.stg | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg index f3d4c37a2..13d497dcb 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg @@ -116,7 +116,7 @@ using ParserRuleContext = Antlr4.Runtime.ParserRuleContext; /// of the available methods. /// \ [System.CodeDom.Compiler.GeneratedCode("ANTLR", "")] -[System.Diagnostics.DebuggerStepThrough] +[System.Diagnostics.DebuggerNonUserCode] [System.CLSCompliant(false)] public partial class BaseListener : IListener { /// \The return type of the visit operation.\ [System.CodeDom.Compiler.GeneratedCode("ANTLR", "")] -[System.Diagnostics.DebuggerStepThrough] +[System.Diagnostics.DebuggerNonUserCode] [System.CLSCompliant(false)] public partial class BaseVisitor\ : AbstractParseTreeVisitor\, IVisitor\ { ")] -[System.Diagnostics.DebuggerStepThrough] [System.CLSCompliant(false)] public partial class : { protected static DFA[] decisionToDFA; @@ -816,27 +815,27 @@ contextGetterCollection(elementType) ::= <% %> ContextTokenGetterDecl(t) ::= - "public ITerminalNode () { return GetToken(., 0); }" + "[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode () { return GetToken(., 0); }" ContextTokenListGetterDecl(t) ::= << -public () { return GetTokens(.); } +[System.Diagnostics.DebuggerNonUserCode] public () { return GetTokens(.); } >> ContextTokenListIndexedGetterDecl(t) ::= << -public ITerminalNode (int i) { +[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode (int i) { return GetToken(., i); } >> ContextRuleGetterDecl(r) ::= << -public () { +[System.Diagnostics.DebuggerNonUserCode] public () { return GetRuleContext\<\>(0); } >> ContextRuleListGetterDecl(r) ::= << -public })> () { +[System.Diagnostics.DebuggerNonUserCode] public })> () { return GetRuleContexts\<\>(); } >> ContextRuleListIndexedGetterDecl(r) ::= << -public (int i) { +[System.Diagnostics.DebuggerNonUserCode] public (int i) { return GetRuleContext\<\>(i); } >> @@ -858,7 +857,6 @@ CaptureNextTokenType(d) ::= " = TokenStream.LA(1);" StructDecl(struct,ctorAttrs,attrs,getters,dispatchMethods,interfaces,extensionMembers, superClass={ParserRuleContext}) ::= << -[System.Diagnostics.DebuggerStepThrough] public partial class : ParserRuleContext, { ;}; separator="\n"> }; separator="\n"> @@ -882,7 +880,6 @@ public partial class : < >> AltLabelStructDecl(struct,attrs,getters,dispatchMethods) ::= << -[System.Diagnostics.DebuggerStepThrough] public partial class : Context { ;}; separator="\n"> }; separator="\n"> @@ -892,6 +889,7 @@ public partial class : Context { >> ListenerDispatchMethod(method) ::= << +[System.Diagnostics.DebuggerNonUserCode] public override void EnterExitRule(IParseTreeListener listener) { IListener typedListener = listener as IListener; if (typedListener != null) typedListener.EnterExit(this); @@ -899,6 +897,7 @@ public override void EnterExitRule(IParseTreeLi >> VisitorDispatchMethod(method) ::= << +[System.Diagnostics.DebuggerNonUserCode] public override TResult Accept\(IParseTreeVisitor\ visitor) { IVisitor\ typedVisitor = visitor as IVisitor\; if (typedVisitor != null) return typedVisitor.Visit(this); @@ -981,7 +980,6 @@ using DFA = Antlr4.Runtime.Dfa.DFA; Lexer(lexer, atn, actionFuncs, sempredFuncs, superClass) ::= << [System.CodeDom.Compiler.GeneratedCode("ANTLR", "")] -[System.Diagnostics.DebuggerStepThrough] [System.CLSCompliant(false)] public partial class : { protected static DFA[] decisionToDFA;