From 60cae7e1a4b1a79658a6b87bdbb30417c279e204 Mon Sep 17 00:00:00 2001 From: Ken Domino Date: Sat, 2 Nov 2024 07:32:11 -0400 Subject: [PATCH] Fix for #4304 --- .../CSharp/LexerDispatchingErrorListener.cs | 39 ---------- .../CSharp/ParserDispatchingErrorListener.cs | 38 ---------- .../Java/LexerDispatchingErrorListener.java | 76 ------------------- .../Java/ParserDispatchingErrorListener.java | 76 ------------------- 4 files changed, 229 deletions(-) delete mode 100644 sql/postgresql/CSharp/LexerDispatchingErrorListener.cs delete mode 100644 sql/postgresql/CSharp/ParserDispatchingErrorListener.cs delete mode 100644 sql/postgresql/Java/LexerDispatchingErrorListener.java delete mode 100644 sql/postgresql/Java/ParserDispatchingErrorListener.java diff --git a/sql/postgresql/CSharp/LexerDispatchingErrorListener.cs b/sql/postgresql/CSharp/LexerDispatchingErrorListener.cs deleted file mode 100644 index d103799893..0000000000 --- a/sql/postgresql/CSharp/LexerDispatchingErrorListener.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* -PostgreSQL grammar. -The MIT License (MIT). -Copyright (c) 2021-2023, Oleksii Kovalov (Oleksii.Kovalov@outlook.com). -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -using Antlr4.Runtime; -using System.IO; - -class LexerDispatchingErrorListener : IAntlrErrorListener -{ - Lexer _parent; - - public LexerDispatchingErrorListener(Lexer parent) - { - _parent = parent; - } - - public void SyntaxError(TextWriter output, IRecognizer recognizer, int offendingSymbol, int line, int charPositionInLine, string msg, RecognitionException e) - { - var foo = new ProxyErrorListener(_parent.ErrorListeners); - foo.SyntaxError(output, recognizer, offendingSymbol, line, charPositionInLine, msg, e); - } -} diff --git a/sql/postgresql/CSharp/ParserDispatchingErrorListener.cs b/sql/postgresql/CSharp/ParserDispatchingErrorListener.cs deleted file mode 100644 index f59fa8bd06..0000000000 --- a/sql/postgresql/CSharp/ParserDispatchingErrorListener.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -PostgreSQL grammar. -The MIT License (MIT). -Copyright (c) 2021-2023, Oleksii Kovalov (Oleksii.Kovalov@outlook.com). -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -using Antlr4.Runtime; -using System.IO; - -class ParserDispatchingErrorListener : IAntlrErrorListener -{ - Parser _parent; - - public ParserDispatchingErrorListener(Parser parent) - { - _parent = parent; - } - public void SyntaxError(TextWriter output, IRecognizer recognizer, IToken offendingSymbol, int line, int charPositionInLine, string msg, RecognitionException e) - { - var foo = new ProxyErrorListener(_parent.ErrorListeners); - foo.SyntaxError(output, recognizer, offendingSymbol, line, charPositionInLine, msg, e); - } -} diff --git a/sql/postgresql/Java/LexerDispatchingErrorListener.java b/sql/postgresql/Java/LexerDispatchingErrorListener.java deleted file mode 100644 index 3fb47beeef..0000000000 --- a/sql/postgresql/Java/LexerDispatchingErrorListener.java +++ /dev/null @@ -1,76 +0,0 @@ -/* -PostgreSQL grammar. -The MIT License (MIT). -Copyright (c) 2021-2023, Oleksii Kovalov (Oleksii.Kovalov@outlook.com). -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -import java.util.BitSet; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.*; -import org.antlr.v4.runtime.misc.*; - -public class LexerDispatchingErrorListener implements ANTLRErrorListener -{ - Lexer _parent; - - public LexerDispatchingErrorListener(Lexer parent) - { - _parent = parent; - } - - public void syntaxError(Recognizer recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) - { - ProxyErrorListener foo = new ProxyErrorListener(_parent.getErrorListeners()); - foo.syntaxError(recognizer, offendingSymbol, line, charPositionInLine, msg, e); - } - - public void reportAmbiguity(Parser recognizer, - DFA dfa, - int startIndex, - int stopIndex, - boolean exact, - BitSet ambigAlts, - ATNConfigSet configs) - { - ProxyErrorListener foo = new ProxyErrorListener(_parent.getErrorListeners()); - foo.reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs); - } - - public void reportAttemptingFullContext(Parser recognizer, - DFA dfa, - int startIndex, - int stopIndex, - BitSet conflictingAlts, - ATNConfigSet configs) - { - ProxyErrorListener foo = new ProxyErrorListener(_parent.getErrorListeners()); - foo.reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs); - } - - public void reportContextSensitivity(Parser recognizer, - DFA dfa, - int startIndex, - int stopIndex, - int prediction, - ATNConfigSet configs) - { - ProxyErrorListener foo = new ProxyErrorListener(_parent.getErrorListeners()); - foo.reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs); - } -} diff --git a/sql/postgresql/Java/ParserDispatchingErrorListener.java b/sql/postgresql/Java/ParserDispatchingErrorListener.java deleted file mode 100644 index c905ec0129..0000000000 --- a/sql/postgresql/Java/ParserDispatchingErrorListener.java +++ /dev/null @@ -1,76 +0,0 @@ -/* -PostgreSQL grammar. -The MIT License (MIT). -Copyright (c) 2021-2023, Oleksii Kovalov (Oleksii.Kovalov@outlook.com). -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -import java.util.BitSet; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.*; -import org.antlr.v4.runtime.misc.*; - -public class ParserDispatchingErrorListener implements ANTLRErrorListener -{ - Parser _parent; - - public ParserDispatchingErrorListener(Parser parent) - { - _parent = parent; - } - - public void syntaxError(Recognizer recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) - { - var foo = new ProxyErrorListener(_parent.getErrorListeners()); - foo.syntaxError(recognizer, offendingSymbol, line, charPositionInLine, msg, e); - } - - public void reportAmbiguity(Parser recognizer, - DFA dfa, - int startIndex, - int stopIndex, - boolean exact, - BitSet ambigAlts, - ATNConfigSet configs) - { - ProxyErrorListener foo = new ProxyErrorListener(_parent.getErrorListeners()); - foo.reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs); - } - - public void reportAttemptingFullContext(Parser recognizer, - DFA dfa, - int startIndex, - int stopIndex, - BitSet conflictingAlts, - ATNConfigSet configs) - { - ProxyErrorListener foo = new ProxyErrorListener(_parent.getErrorListeners()); - foo.reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs); - } - - public void reportContextSensitivity(Parser recognizer, - DFA dfa, - int startIndex, - int stopIndex, - int prediction, - ATNConfigSet configs) - { - ProxyErrorListener foo = new ProxyErrorListener(_parent.getErrorListeners()); - foo.reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs); - } -}