On 2005/03/02 17:07, Derek M Jones at [EMAIL PROTECTED] wrote:
>> I have some vague memory that somebody found (fairly late, in the 90'ies) a
>> grammar transformation to make C becoming LALR(1) (modulo the usual context
>> tweaks for "typedef", etc.) Then you would not need using the %glr option.
Hans,
>>typedef x y;
>>typedef i j;
>>{
>>
>>is a syntactically valid function definition.
>
>So it seems, but I have not been able to figure out which function. :-)
The syntax does not permit an empty declaration. So x must
be the declarator. The second typedef is simply a declaration
and is n
At 15:38 + 2005/03/01, Derek M Jones wrote:
>I suddenly realised that the token sequence:
>
>typedef x y;
>typedef i j;
>{
>
>is a syntactically valid function definition.
So it seems, but I have not been able to figure out which function. :-) The
problem is that C has some grammar difficultie
At 19:24 + 2005/02/28, Derek M Jones wrote:
>>>I have written a parser for C that processes
>>>a single statement or declaration at a time.
>>>So after each statement/declaration yyparse
>>>returns.
>>
>>Bison is clearly not built to handle such applications. The normal thing is
>>to handle the
Hans,
>>In the case:
>>
>>typedef x, y;
>>typedef i, j;
I should have given the example as:
typedef x y;
typedef i j;
>>
>>the second typedef token is shifted onto all three stacks and
>>subsequent tokens are processed like a declaration (which they
>>do form part of)! So I don't get a parse o
> Derek M Jones wrote:
>
> > >>I have written a parser for C that processes
> > >>a single statement or declaration at a time.
> > >>So after each statement/declaration yyparse
> > >>returns.
> > >
I think you might be able to simplify matters by just using
`statement' as your start symbol and cal
Derek M Jones wrote:
> >>I have written a parser for C that processes
> >>a single statement or declaration at a time.
> >>So after each statement/declaration yyparse
> >>returns.
> >
> >Bison is clearly not built to handle such applications. The normal thing is
> >to handle the whole language in
Hans,
>>I have written a parser for C that processes
>>a single statement or declaration at a time.
>>So after each statement/declaration yyparse
>>returns.
>
>Bison is clearly not built to handle such applications. The normal thing is
>to handle the whole language in one go. (How do you handle en
At 17:03 + 2005/02/28, Derek M Jones wrote:
>I have written a parser for C that processes
>a single statement or declaration at a time.
>So after each statement/declaration yyparse
>returns.
Bison is clearly not built to handle such applications. The normal thing is
to handle the whole languag
All,
I have written a parser for C that processes
a single statement or declaration at a time.
So after each statement/declaration yyparse
returns.
Originally I used various ad-hoc rules in yylex
to figure out which was the last token of a
statement/declaration and then returned a zero
value as t
10 matches
Mail list logo