mirror of
https://codeberg.org/NLnet/takentaal.git
synced 2025-08-29 14:00:06 +00:00
107 lines
1.2 KiB
ANTLR
107 lines
1.2 KiB
ANTLR
grammar takentaal;
|
|
|
|
takentaal
|
|
: (line '\n'+)+ EOF
|
|
;
|
|
|
|
line
|
|
: plan
|
|
| task
|
|
| subtask
|
|
| description
|
|
;
|
|
|
|
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?
|
|
;
|
|
|
|
amount
|
|
: '{' INT '}'
|
|
;
|
|
|
|
description
|
|
: TEXT
|
|
;
|
|
|
|
PLAN_TOKEN
|
|
: '# '
|
|
;
|
|
|
|
TASK_TOKEN
|
|
: '## '
|
|
;
|
|
|
|
SUBTASK_NEW_TOKEN
|
|
: '- '
|
|
;
|
|
|
|
SUBTASK_PARTIAL_TOKEN
|
|
: '/ '
|
|
;
|
|
|
|
SUBTASK_COMPLETE_TOKEN
|
|
: '* '
|
|
;
|
|
|
|
SUBTASK_OBSOLETE_TOKEN
|
|
: '! '
|
|
;
|
|
|
|
WS
|
|
: [ \t]+ -> skip
|
|
;
|
|
|
|
INT
|
|
: DIGIT+
|
|
;
|
|
|
|
TEXT
|
|
: TEXTHEAD TEXTBODY*
|
|
;
|
|
|
|
fragment LETTER
|
|
: [a-zA-Z\u0080-\u00FF_]
|
|
;
|
|
|
|
fragment DIGIT
|
|
: [0-9]
|
|
;
|
|
|
|
fragment TEXTHEAD
|
|
: LETTER
|
|
| DIGIT
|
|
;
|
|
|
|
fragment TEXTBODY
|
|
: LETTER
|
|
| DIGIT
|
|
| [\u0021-\u007A\u007C\u007E ] // ASCII without {}
|
|
| [\u00A0-\u33FF] // UNICODE
|
|
;
|