Sometimes, we want to parse a string repeatedly.
In this case, we can use operator +
.
For example:
S: A+;
terminals
A: 'a';
This grammar accepts a sequence of a
and at least one a
(optional white spaces are allowed).
Formally, S: A+;
is shorthand for the following grammar rules:
S: A1;
@vec
A1: A1 A | A;
We will explain @vec
later.
➡️ Next: Zero Or More
📘 Back: Table of contents