From c28c698bbf1b645c96ea9d4fd79d0a54865a3304 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 28 Jan 2009 12:09:24 -0500 Subject: [PATCH] Cleanup - Converted grammar.bnf to the EBNF used by Parser. --- grammar.bnf | 86 ++++++++++++++++------------------------------------- 1 file changed, 26 insertions(+), 60 deletions(-) diff --git a/grammar.bnf b/grammar.bnf index aad7d610c..18c082005 100644 --- a/grammar.bnf +++ b/grammar.bnf @@ -1,69 +1,35 @@ -This is a full BNF grammar for the task command line. It is intended that a -future release of task will incorporate a complete lexer/parser implementing -this grammar. +# This is a full BNF grammar for the task command line. It is intended that a +# future release of task will incorporate a complete lexer/parser implementing +# this grammar. +command ::= simple_command + | filter_command filter? + | id_command + | "export" file + | + | -command: - VERSION - | HELP - | PROJECTS - | TAGS - | SUMMARY - | HISTORY - | NEXT - | CALENDAR - | ACTIVE - | OVERDUE - | STATS - | USAGE - | OLDEST - | NEWEST - | EXPORT - | COLOR - | DELETE - | UNDELETE - | INFO - | START - | DONE - | ADD [] [] [] - | LIST [] [] [] - | LONG [] [] [] - | LS [] [] [] - | COMPLETED [] [] [] - | [] [] [] - | +simple_command ::= "version" | "help" | "projects" | "tags" | "next" | "stats" + | "color" ; -id: - \d+ - | \d{8}-\d{4}-\d{4}-\d{12} +filter_command ::= "summary" | "history" | "calendar" | "active" | "overdue" + | "oldest" | "newest" | "add" | "list" | "long" | "ls" + | "completed" ; -tags: - + - | - +id_command ::= "delete" | "undelete" | "info" | "start" | "end" | "done" + | "undo" ; -tag: - \w+ +filter ::= filter_part+ ; -attrs: - - | +filter_part ::= tag_add | tag_remove | attribute | word ; -attr: - : - -name: - \w+ - -value: - .+ - -substitution: - / / / - -pattern: - .+ - -file: - ? +tag_add ::= "+" word ; +tag_remove ::= "-" word ; +attribute ::= word ":" word ; +word ::= ... +file ::= ... +id ::= digit+ ; +digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; +substitution ::= "/" word+ "/" word* "/" ;