| 1 |
_sc_name: |
| 2 |
{ |
| 3 |
d_expect = "list of start condition names"; |
| 4 |
} |
| 5 |
; |
| 6 |
|
| 7 |
_start_condition_type: |
| 8 |
INCL_START_CONDITION |
| 9 |
_sc_name |
| 10 |
{ |
| 11 |
d_rules.setType(StartConditions::INCLUSIVE); |
| 12 |
} |
| 13 |
| |
| 14 |
EXCL_START_CONDITION |
| 15 |
_sc_name |
| 16 |
{ |
| 17 |
d_rules.setType(StartConditions::EXCLUSIVE); |
| 18 |
} |
| 19 |
; |
| 20 |
|
| 21 |
_start_condition_names: |
| 22 |
_start_condition_names identifier |
| 23 |
{ |
| 24 |
d_rules.defineStartCondition($2); |
| 25 |
} |
| 26 |
| |
| 27 |
identifier |
| 28 |
{ |
| 29 |
d_rules.defineStartCondition($1); |
| 30 |
} |
| 31 |
; |
| 32 |
|
| 33 |
_start_condition_directive: |
| 34 |
_start_condition_type |
| 35 |
_start_condition_names |
| 36 |
; |
| 37 |
|
| 38 |
_name_def: |
| 39 |
identifier |
| 40 |
{ |
| 41 |
d_scanner.newDefinition(); // briefly switches to 'line' |
| 42 |
$$ = d_scanner.matched(); |
| 43 |
} |
| 44 |
; |
| 45 |
|
| 46 |
_stringType: |
| 47 |
STRING |
| 48 |
{ |
| 49 |
$$ = TextType::STRING; |
| 50 |
} |
| 51 |
| |
| 52 |
RAWSTRING |
| 53 |
{ |
| 54 |
$$ = rawString(); |
| 55 |
} |
| 56 |
; |
| 57 |
|
| 58 |
_name_definition: |
| 59 |
_name_def _stringType |
| 60 |
{ |
| 61 |
d_scanner.addDefinition($1, $2); |
| 62 |
} |
| 63 |
; |
| 64 |
|
| 65 |
_directive: |
| 66 |
option |
| 67 |
| |
| 68 |
_start_condition_directive |
| 69 |
| |
| 70 |
_name_definition |
| 71 |
| |
| 72 |
error |
| 73 |
| |
| 74 |
// empty |
| 75 |
; |
| 76 |
|
| 77 |
_directive_line: |
| 78 |
_directive '\n' |
| 79 |
; |
| 80 |
|
| 81 |
opt_directives: |
| 82 |
opt_directives _directive_line |
| 83 |
| |
| 84 |
// empty |
| 85 |
; |