mirror of
https://codeberg.org/NLnet/takentaal.git
synced 2025-08-29 22:10:07 +00:00
101 lines
No EOL
1 KiB
ANTLR
101 lines
No EOL
1 KiB
ANTLR
grammar takentaal;
|
|
|
|
takentaal
|
|
: line+ EOF
|
|
;
|
|
|
|
line
|
|
: plan
|
|
| task
|
|
| subtask
|
|
| comment
|
|
;
|
|
|
|
plan
|
|
: PLAN_TOKEN TEXT amount?
|
|
;
|
|
|
|
task
|
|
: TASK_TOKEN TEXT amount?
|
|
;
|
|
|
|
subtask
|
|
: subtask_new
|
|
| subtask_partial
|
|
| subtask_complete
|
|
| subtask_obsolete
|
|
;
|
|
|
|
subtask_new
|
|
: SUBTASK_NEW_TOKEN TEXT amount?
|
|
;
|
|
|
|
subtask_partial
|
|
: SUBTASK_PARTIAL_TOKEN TEXT amount?
|
|
;
|
|
|
|
subtask_complete
|
|
: SUBTASK_COMPLETE_TOKEN TEXT amount?
|
|
;
|
|
|
|
subtask_obsolete
|
|
: SUBTASK_OBSOLETE_TOKEN TEXT amount?
|
|
;
|
|
|
|
comment
|
|
: TEXT
|
|
;
|
|
|
|
amount
|
|
: '{' INT '}'
|
|
;
|
|
|
|
PLAN_TOKEN
|
|
: '# '
|
|
;
|
|
|
|
TASK_TOKEN
|
|
: '## '
|
|
;
|
|
|
|
SUBTASK_NEW_TOKEN
|
|
: '- '
|
|
;
|
|
|
|
SUBTASK_PARTIAL_TOKEN
|
|
: '/ '
|
|
;
|
|
|
|
SUBTASK_COMPLETE_TOKEN
|
|
: '* '
|
|
;
|
|
|
|
SUBTASK_OBSOLETE_TOKEN
|
|
: '! '
|
|
;
|
|
|
|
WS
|
|
: [ \r\n\t]+ -> skip
|
|
;
|
|
|
|
|
|
TEXT
|
|
: TEXTHEAD TEXTBODY*
|
|
;
|
|
|
|
INT
|
|
: DIGIT+
|
|
;
|
|
|
|
fragment DIGIT
|
|
: [0-9]
|
|
;
|
|
|
|
fragment TEXTHEAD
|
|
: [a-zA-Z]
|
|
;
|
|
|
|
fragment TEXTBODY
|
|
: TEXTHEAD
|
|
| [0-9_()., ]
|
|
; |