Lezer-based FEEL grammar
npm install lezer-feel
This is a DMN FEEL grammar for the
Lezer parser system.
Parse FEEL to a Tree:
``javascript
import {
parser
} from 'lezer-feel';
// parse
parser.parse('foo > 1');
`
#### Choose Dialect
Use Expression or UnaryTests as a top node depending on which FEEL dialect you intend to parse:
`javascript
import {
parser
} from 'lezer-feel';
const unaryParser = parser.configure({
top: 'UnaryTests'
})
// parse
unaryParser.parse('> 100');
`
#### Provide Context
Override the default context tracker to enable context sensitive parsing based on inputs:
`javascript
import {
parser,
trackVariables
} from 'lezer-feel';
const contextTracker = trackVariables({
'if foo then bar': 1
});
const contextualParser = parser.configure({
contextTracker
});
// recognizes
contextualParser.parse('if foo then bar');
`
`shellbuild and test
npm run all
Prefix individual tests with a
* to test them in focus mode:`markdown
*ArithmeticExpression (error)
...
``* feelin - Interpreter for the FEEL language
* feel-playground - A visual playground to learn the FEEL language
* lang-feel - Integration into a CodeMirror editor
The code is licensed under an MIT license.