taskwarrior/doc/misc/parser/grammar.txt
Paul Beckingham 235fb9f054 Command Line Grammar
- Updated documentation.
2013-07-22 20:31:09 -04:00

79 lines
1.9 KiB
Text

# The command line needs to obey a grammar. It is then against this grammar
# that bugs will be identified.
#
# Conventions:
# - Literals are always double-quoted.
# - "*", "+" and "?" suffixes have POSIX semantics.
# - Low-level primitives are in <brackets>.
# - @reports for dynamic lists such as custom report names.
#
# The general form of commands is:
# task [ all-commands ]
#
grammar ::= all-commands?
;
all-commands ::= custom-report
| read-command
| write-command
| special-command
;
custom-report ::= filter? @report ;
read-command ::= filter? @readcmd ;
write-command ::= filter? @writecmd modifiers ;
special-command ::= ;
filter ::= expression ;
expression ::= ;
modifiers ::= ;
# Low-level:
dom ::= context-value
| system-value
| rc-value
| task-value
;
context-value ::= "context.program"
| "context.args"
| "context.width"
| "context.height"
;
system-value ::= "system.version"
| "system.os"
;
rc-value ::= /rc\.[a-zA-Z.]+/
;
task-value ::= <id> "." attribute
| <uuid> "." attribute
;
literal ::= <string>
| <numeric>
| <date>
| <duration>
;
# Supported primitives:
#
# <id>
# <uuid>
# <override>
# <string>
# <numeric>
# <date>
# <duration>
# @command all commands
# @report all custom reports
# @attributes all attributes, UDAs
# @readcmd all read-only commands
# @writecmd all write commands