22 lines
356 B
ANTLR
22 lines
356 B
ANTLR
grammar PostProcessing;
|
|
|
|
line: (text | variable | functionCall)* EOF;
|
|
|
|
functionCall: '$' identifier '(' (expression (',' expression)*)? ')';
|
|
|
|
text: CH+?;
|
|
identifier: CH+?;
|
|
|
|
parameter: text;
|
|
|
|
variable: '${' identifier ('(' parameter ')')? ('?' expression)? '}';
|
|
|
|
expression
|
|
: text
|
|
| variable
|
|
| functionCall
|
|
;
|
|
|
|
CH: .;
|
|
WS: [ \t\r\n]+ -> skip;
|