From 2f92c7b4a79298eb0e11fd87b2550ac1c7f3e73e Mon Sep 17 00:00:00 2001 From: Erez Sh Date: Thu, 16 Jan 2020 14:50:10 +0200 Subject: [PATCH] Small addition to docs about terminal operators --- docs/grammar.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/grammar.md b/docs/grammar.md index cc518e9..c36756b 100644 --- a/docs/grammar.md +++ b/docs/grammar.md @@ -54,6 +54,10 @@ Literals can be one of: * `/re with flags/imulx` * Literal range: `"a".."z"`, `"1".."9"`, etc. +Terminals also support grammar operators, such as `|`, `+`, `*` and `?`. + +Terminals are a linear construct, and therefor may not contain themselves (recursion isn't allowed). + ### Priority Terminals can be assigned priority only when using a lexer (future versions may support Earley's dynamic lexing). @@ -74,7 +78,7 @@ When using a lexer (standard or contextual), it is the grammar-author's responsi IF: "if" INTEGER : /[0-9]+/ INTEGER2 : ("0".."9")+ //# Same as INTEGER -DECIMAL.2: INTEGER "." INTEGER //# Will be matched before INTEGER +DECIMAL.2: INTEGER? "." INTEGER //# Will be matched before INTEGER WHITESPACE: (" " | /\t/ )+ SQL_SELECT: "select"i ```