Hi Romildo,
José Romildo Malaquias wrote:
> On Mon, Apr 19, 2010 at 12:25:08PM -0400, Steve Rowe wrote:
> [...]
>> > 2. In macro definitions, how does one know where one regular
>> > expression finishes?
>>
>> Within the macro section of a spec, newlines terminate regular
>> expressions - from the above-linked LexScan.flex:
>>
>> 500 {NL} { if (macroDefinition) { yybegin(MACROS); }
>> return symbol(REGEXPEND); }
>
> Then there is an error in examples/java/java.flex in the distribution:
>
> /* comments */
> Comment = {TraditionalComment} | {EndOfLineComment} |
> {DocumentationComment}
>
> Here the macro definition is not supposed to be in a unique line.
I was wrong; starting at line 464 in LexScan.flex:
464 {WSPNL}*"|"{WSP}*$ { if (macroDefinition) {
465 yybegin(EATWSPNL);
466 return symbol(BAR);
467 }
That is, when '|' occurs at end-of-line within a macro definition, the
newline is ignored.
Steve
|