I’m trying to write a simple grammar that recognizes as entities Both Capitalized words and certain verbs.
My .grammar file is like this:
@tokens {
Identifier { $[A-Z][A-Za-z]+ }
Verb { “sumando” | “restando” | “multiplicando” }
space { $[ \t\n\r]+ }
}
@skip { space }
@top Entities { (Identifier | Verb)+ }
But after running ‘npm run prepare’ I get the following message:
[!] (plugin rollup-plugin-lezer) Error: Could not load /home/javier/Documents/bonalLezer/src/my.grammar: Unexpected token ‘+’ (/home/javier/Documents/bonalLezer/src/my.grammar 2:29)
Thanks in advance for your help.
Javier