UNPKG
@lcap/nasl-parser
Version:
latest (0.1.0)
0.1.0
Take Nasl text to Nasl AST with the help of generalized parsing.
@lcap/nasl-parser
/
ts
/
nasl-parser.ts
9 lines
(7 loc)
•
211 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
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; }