Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 501 Bytes

one_or_more.md

File metadata and controls

29 lines (19 loc) · 501 Bytes

One Or More

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