DanielBV / antlr4-shulk

An autocomplete library for ANTLR4 grammars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Antlr4-shulk

An autocomplete library for ANTLR4 grammars. The development of this library was explained in a series of posts: https://www.abstractsyntaxseed.com/blog/antlr4-autocomplete-library/introduction

How to use

For the basic use, you can do:

const ac = new Autocompleter(MyLexer, MyParser);
const result = ac.autocomplete(input);

Here MyLexer and MyParser are classes, not objects. The autocompleter will instanciate them.

To change the starting rule, you can use the second argument of autocomplete:

const options = {initialRule: MyParser.RULE_myRule};
const ac = new Autocompleter(MyLexer, MyParser, options);
const result = ac.autocomplete(input);

About

An autocomplete library for ANTLR4 grammars


Languages

Language:JavaScript 64.8%Language:ANTLR 35.2%