From 60336d6f6ab93e2c4a248e10941413a503739de7 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 30 Aug 2013 11:57:13 -0700 Subject: [PATCH] Documentation - Added (preliminary) example of the resultant parse tree. --- doc/misc/parser/README | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/doc/misc/parser/README b/doc/misc/parser/README index fe8db036a..d95a2e4cf 100644 --- a/doc/misc/parser/README +++ b/doc/misc/parser/README @@ -64,14 +64,31 @@ from the parser, yielding a single value. As an example, the command line: Is to be parsed as: - raw | add one due:eoy wait:due-2wks - type | command string attr attr - subtype | read - attr | desc due wait - value | eval 'eoy' eval 'due-2wks' + index | 0 1 2 3 4 + --------+----------------------------------------------- + raw | task add one due:eoy wait:due-2wks + type | command string attr attr + subtype | read + attr | desc due wait + value | eval 'eoy' eval 'due-2wks' The eval needs of this command are: 'eoy' == date literal 'due-2wks' == - +The parse tree should be: + + +- add COMMAND + +- "one" WORD + +- attr + | +- due ATTRIBUTE + | +- expr + | | + "eoy" LITERAL DATE + +- attr + +- wait ATTRIBUTE + +- expr + += "due" DOM DATE + += "-" OP + += "2wks" LITERAL DURATION +