Package Exports
- lezer-feel
Readme
lezer-feel
This is a DMN FEEL grammar for the Lezer parser system.
Usage
Parse FEEL to a Tree:
import {
parser
} from 'lezer-feel';
// parse <Expressions>
parser.parse('foo > 1');Choose Dialect
Use Expressions or UnaryTests as a top node depending on which FEEL dialect you intend to parse:
import {
parser
} from 'lezer-feel';
const unaryParser = parser.configure({
top: 'UnaryTests'
})
// parse <UnaryTests>
unaryParser.parse('> 100');Provide Context
Override the default context tracker to enable context sensitive parsing based on inputs:
import {
parser,
trackVariables
} from 'lezer-feel';
const contextTracker = trackVariables({
'if foo then bar': 1
});
const contextualParser = parser.configure({
contextTracker
});
// recognizes <if foo then bar> as a <VariableName>
contextualParser.parse('if foo then bar');Related
- feelin - Interpreter for the FEEL language
- feel-playground - Playground to tryout and learn the FEEL language
License
The code is licensed under an MIT license.