[antlr-interest] [C target] how to skip empty lines

Юрушкин Михаил yurushkin at rambler.ru
Fri Oct 23 02:28:13 PDT 2009


David-Sarah Hopwood <david-sarah at jacaranda.org> писал(а) в своём письме  
Fri, 23 Oct 2009 09:35:08 +0400:

> Юрушкин Михаил wrote:
>> David-Sarah Hopwood <david-sarah at jacaranda.org> писал(а) в своём письме
>> Fri, 23 Oct 2009 09:20:32 +0400:
>>
>>> Юрушкин Михаил wrote:
>>>> first example: stmnt <\n> stmnt <\n> stmnt <;> <\n> // i mean <\n> is
>>>> enough to seperate statements.
>>>
>>> For most languages that do that, it's sufficient to add an empty
>>> statement rule in the parser.
>>
>> mm.. empty lines can be in every place of grammar: between statements,
>> procedures, declarations etc where empty_statement rule isn't exist.
>> I think it's important to skip redudant <\n> on lexer level... but i
>> don't know how to do that clearly (without overriding nextToken for
>> example).
>
> Can that not be done by using '\n'+ where you had '\n' before?
>


yes=) it was relly simple(
excuse me and thanks!

-- 
Best regards,
Michael


More information about the antlr-interest mailing list