Skip to content

Literal

xtay2 edited this page Feb 16, 2023 · 7 revisions

Introduction

The Literal represents a terminal string in an EBNF which is a symbol that cannot be further decomposed into smaller sections. To initialise it, call the constructor with a literal String. It gets used for all kinds of symbols and keywords.

Constructor

  • Literal(String literal): Strips the literal and rejects blank ones.

Examples

new Literal("abc");

Matches

"abc"
" abc "
"   abc"

Fails

"ab c"
"ab"
"Hello"

Clone this wiki locally