Similar projects and alternatives to antlr-tsql
The Racket repository
JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern
Scout APM: A developer's best friend. Try free for 14-days. Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
Analyze data from swim, bike and run activities
Brainstorming and draft proposals for Rhombus
Racket parser combinators inspired by parsack and megaparsec
news.ycombinator.com | 2021-02-14
I'm currently working on a TSQL parser in Racket because I want to do some code analysis on a few huge stored proc files (some of which are over 30k lines of code). I didn't want to use existing parsers because the trees they produce are monstrous [1,2]. Tried doing some fancy grep work, but it was giving me way too many false matches and wasn't as sound as I would have liked.
I could use any language with reasonable parsing tools, but I like how flexible Racket is about it. Currently using megaparsack, but there are many different parsing tools available depending on your needs. Also, once you have done parsing, there are lots of convenient ways to manipulate the parse trees into whatever shape you need.
I also think Racket has a lot of tooling that would make it great for large code bases.
-It has great offline docs (scribble) which don't force you to use some comment based system like JavaDoc.
-It has a very powerful and fast contract system that can be attached either at definition time like most languages or only at module boundaries.
- While it has a macro system, it has a really good macro debugger (it lets you view how the code is iteratively expanded with options to show/hide the expansion of various macros). Since even non-hygienic macros deal with syntax objects and not just datums, macros don't even screw up error messages since line/column info is preserved!
- You compile to executables unlike most scripting languages.
- You can write some code with types and some with them, but unlike say TypeScript the boundary between typed and untyped code is sound since contracts are used to verify these boundaries.
- A lot of the time you don't even need types because most names (i.e. variables and functions) are verified at compile time (to be more specific, at macro expansion time).
- It has very aggressive sandboxing tools that let you control not only what names are visible to some untrusted code, but also control how much memory it uses without creating a new process.
- Safer global variables in the form of parameterize. Very convenient for stuff like when you need to temporarily change the stdout for a single call.
datacamp/antlr-tsql is an open source project licensed under GNU Affero General Public License v3.0 which is an OSI approved license.