SyntaxEditor use ANTLR

SyntaxEditor for WPF Forum

The latest build of this product (v24.1.3) was released 1 month ago, which was before this thread was created.
Posted 1 month ago by hzh - Appeon
Version: 23.1.0
Avatar

I want to write a SQL formatting application based on the SyntaxEditor control, but SQL syntax parsing is difficult for me. By looking at the online documentation, I found that I can integrate the free ANTLR syntax parser, but I can't find any examples now, and I can't find the AntlrParser described in the document (https://www.actiprosoftware.com/docs/controls/wpf/api/actiprosoftware.text.parsing.implementation.antlrparser?v=23.1). Can you help me successfully integrate the ANTLR tool?

Comments (1)

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Our ANTLR add-on was deprecated several years ago because it only worked with ANTLR 3.  The assemblies for it are still installed by our WPF Controls installer, but they are not available in our nuget.org packages.  The sample for it is no longer shipped in recent versions either due to the deprecation.

Most people would be on ANTLR 4 at this point.  ANTLR 4 was redesigned in a way where we could not make any helper classes to assist with invoking an ANTLR parser, unlike with ANTLR 3.

That being said, you can make a custom IParser language service implementation to call into any parser, including an ANTLR 4 parser.  The main thing you need to write would be a class that allows the custom parser to access our document snapshot text.  You'd want to make a class that uses a snapshot reader to scan the snapshot text as needed.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.