Questions tagged [moo-lexer]

For questions about the moo lexer/tokenizer JavaScript package.

Moo is a lexer/tokenizer for JavaScript.

Links

3 questions
2
votes
2 answers

Grammar - How to match optional and required whitespaces before and after words?

I am using nearley and moo to come up with a rather complex grammar. It seems to be working fine EXCEPT for my whitespace requirements. I need to require whitespace when needed and allow it when not while keeping the grammar unambiguous. For…
jiveturkey
  • 2,484
  • 1
  • 23
  • 41
1
vote
2 answers

Nearley Moo - Grammar does not work with Moo lexer used

I'm using the nearley.js grammar (and parser) with the moo.js tokeniser. My grammar.ne file is the following: @{% const moo = require('moo') let lexer = moo.compile({ number: /[0-9]+/ }); %} @lexer lexer trig -> "sin"…
TheMrZZ
  • 188
  • 1
  • 11
0
votes
0 answers

How to use moo lexer (and nearley) with large files

I am trying to find something that will parse very large files (PGN files, basically.) I started using antlr4, but even though they claim that their classes are "streams", they aren't. antlr4 takes my 5,457,518 game test file and tried to load the…