| 1 |
// regex in the form: <miniscanner>(opt) regex |
| 2 |
_optMs_regex: |
| 3 |
ms_spec reset regexOrEOF |
| 4 |
{ |
| 5 |
$$ = $3; |
| 6 |
} |
| 7 |
| |
| 8 |
regexOrEOF |
| 9 |
{ |
| 10 |
$$ = $1; |
| 11 |
} |
| 12 |
; |
| 13 |
|
| 14 |
// series of _optMs_regexes, separated by '|' at the end of lines. E.g., |
| 15 |
// _optMs_regex1 | |
| 16 |
// _optMs_regex2 | |
| 17 |
// _optMs_regex3 |
| 18 |
// (ORNL is returned at '| {OPTBL} \n') |
| 19 |
// at ORNL any previously set ms-spec ends, and is back to INITIAL |
| 20 |
|
| 21 |
_optMs_rule: // after ORNL continue parsing |
| 22 |
_optMs_rule ORNL '\n' reset _optMs_rule // at a new line |
| 23 |
{ |
| 24 |
orAction(); |
| 25 |
} |
| 26 |
| |
| 27 |
_optMs_regex |
| 28 |
{ |
| 29 |
addRule($1, true); // true: reset the miniscanner spec to INITIAL |
| 30 |
} |
| 31 |
; |
| 32 |
|
| 33 |
optMs_rule: |
| 34 |
// just regular expressions, without an action block |
| 35 |
_optMs_rule |
| 36 |
| |
| 37 |
// the scanner returns a block if it encounters a non-blank character |
| 38 |
// on a line after ws, unless the character is a '|' |
| 39 |
_optMs_rule action |
| 40 |
{ |
| 41 |
assignBlock(); |
| 42 |
} |
| 43 |
; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|