UNPKG

@lcap/nasl-parser

Version:

Take Nasl text to Nasl AST with the help of generalized parsing.

9 lines (7 loc) 211 B
import { Parser, Grammar } from "nearley"; import grammar from "./nasl"; export const parse = code => { const parser = new Parser(Grammar.fromCompiled(grammar)); parser.feed(code); return parser; }