This repo contains my ongoing side project to create a BNF grammar powered, programming language and IDE agnostic, language server that can be used to provide baseline language functionality to a large number of programming languages.
It is somewhat inspired by 'TextMate' bundles (http://github.com/textmate/textmate) and 'VS Code Anycode' (https://github.com/microsoft/vscode-anycode) but with slightly different goals.
The emphasis of this project is:
Here is a (not yet functional) bundle example.
BNF-style grammatical productions. May require some additional way to specify top level options for how to handle 'whitespace' characters.
ROOT = STATEMENT
IF_STATEMENT = IF LPAREN BOOL_EXPRESSION RPAREN STATEMENT
IF = 'if'
LPAREN = '('
RPAREN = ')'
SEMICOLON = ';'
STATEMENT = IF_STATEMENT | SEMICOLON
CONDITIONAL = 'true' | 'false'
BOOL_EXPRESSION = CONDITIONAL | AND_EXPRESSON | OR_EXPRESSION
AND_EXPRESSION = BOOL_EXPRESSION AND BOOL_EXPRESSION
OR_EXPRESSION = BOOL_EXPRESSION OR BOOL_EXPRESSION
AND = '&&'
OR = '||'
Declarative rules describing how types are assigned to parsed AST nodes. The following example describes rules for boolean expressions. Anything not explictly specified is assumed to be impossible.
CONDITIONAL => T_BOOL
AND_EXPRESSION(T_BOOL, T_BOOL) => T_BOOL
OR_EXPRESSION(T_BOOL, T_BOOL) => T_BOOL
My goal is to enable the following editor features:
Note that some of these require 'semantic understanding' of the code and project structure. This language server should provide baseline functionality only. Ambiguity and misbehaior, is expected, the goal is just to provide rudimentary editor support.