help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Solving >> issue in templates


From: John Horigan
Subject: Re: Solving >> issue in templates
Date: Wed, 6 Feb 2013 07:56:30 -0800

What if you let the lexer emit the SHL token and have your grammar
accept '>' tokens or SHL tokens for closing template lists? The action
would check if SHL closed the template list and issue a call to the
lexer telling it to flush its input and insert another '>' token.

-- john

On Wed, Feb 6, 2013 at 2:32 AM, John P. Hartmann <address@hidden> wrote:
> Isn't the point that <> are brackets (parentheses) in this context.
> Clearly the lexer must determine this and emit an appropriate token.
>
> On 6 February 2013 10:14, Hans Aberg <address@hidden> wrote:
>> On 6 Feb 2013, at 00:54, Adam Smalin <address@hidden> wrote:
>>
>>> This doesn't help :( I see >> is in the lexer (search SHL) which means 
>>> List<List<int>> will not compile because >> is a right shift. But i looked 
>>> in the y file first and well... like i said its a C++ problem so C++ 
>>> obviously would suffer from it.
>>
>> Have you tried the other way around: sorting out ">>" in the actions? But 
>> otherwise, there might be somebody out there already having solved this.
>>
>>> On Mon, Jan 28, 2013 at 6:16 PM, Hans Aberg <address@hidden> wrote:
>>> On 15 Jan 2013, at 03:48, Adam Smalin <address@hidden> wrote:
>>>
>>> > As we know in C++ there is a issue...
>>>
>>>
>>> You might inquiry in the Usenet newsgroup comp.compilers. There is a 
>>> Yaccable C++ grammar for an older revision, it may not have been updated.
>>> http://www.parashift.com/c++-faq-lite/yaccable-grammar.html
>>>
>>> Hans
>>
>>
>> _______________________________________________
>> address@hidden https://lists.gnu.org/mailman/listinfo/help-bison
>
> _______________________________________________
> address@hidden https://lists.gnu.org/mailman/listinfo/help-bison



reply via email to

[Prev in Thread] Current Thread [Next in Thread]