Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 763 Bytes

string_terminals.md

File metadata and controls

25 lines (17 loc) · 763 Bytes

String Terminals

There are two terminal definitions. The first one is to define a terminal by a string.

A string is indicated by ' or ". The content of a string is put between two ' or two ". Here are some examples:

X: 'a';
Y: 'abc123';
Z: "abc.com";

When parsing a terminal, the corresponding string content is parsed, which means the string content should be consumed in the input.

If there are ' or " in a string, they needs to be replaced with \' or \" respectively. For example, '\'' represents a single '.

Similarly, if there is \ intentionally in a string, it also needs to be replaced with \\.

➡️ Next: Regex Terminals

📘 Back: Table of contents