This How-To tutorial explains how to add support for a programming language to Apache NetBeans using ANTLR4.

What is the ANTLR?

ANTLR is the modern way, but it is not easy to keep the many languages up-to-date; there are a number of tutorials on how to create a NB plugin using ANTLR, many outdated, with the best one in the Apache NetBeans book to add a plugin for blockchain support.

How to add support in NetBeans to a programming language using ANTLR?

1. File Type Recognition

See Adding New Language Support.

2. Custom project types

See Adding New Language Support.

3. Semantic Syntax highlighting and braces matching

4. Code Completion 

5. Navigation

6. Types and documentation on hover

7. Code formatting

8. Configuration

See Adding New Language Support.

9. Refactoring

10. Error squiggles and apply suggestions from errors

11. Debugging

12. Snippets

13. Build tasks

Plugins supported by ANTLR

Rust plugin is a good example of extending NetBeans to support the Rust programming language using ANTLR. 

NetBeans Specific Resources

Other resources

  1. Clinton J.L. (2021), Build Your Own Programming Language, Packt.
  2. Parr T. (2010), Language Implementation Patterns, The Pragmatic Programmer.
  3. Stalla A. (2021a), "Converting from JavaCC to ANTLR", Strumenta.
  4. Singh V., Basics of Compiler Design, Anniversary Edition.
  5. Tomassetti G., "The ANTLR Mega Tutorial", Strumenta.
  • No labels