|YACC Parsing Question firstname.lastname@example.org (Pradeep) (2005-11-08)|
|Re: YACC Parsing Question email@example.com (Jatin Bhateja) (2005-11-12)|
|Re: YACC Parsing Question firstname.lastname@example.org (email@example.com) (2005-11-12)|
|From:||"Jatin Bhateja" <firstname.lastname@example.org>|
|Date:||12 Nov 2005 16:08:59 -0500|
By using the suitable look ahead you can solve your problem. I mean to
say instead of using LR parsing use LR (k) parsing.
Let me explain it to you in detail for example consider the following
>>void Function1 (char aname, int value)
Now on using a look ahead of one as soon as you encounter a variable whose
next token is a LEFT PARENTHESIS ( '(' )
add it to the symbol table and set its type to function as you are already
Now apart from the usual fields in the symbol table data structure you
must also have a pointer to the list of the arguments of the Function
(which will be useful only in case of function name). Thus as you
parse that argument list of the function you will be creating separate
symbol table entries for all the arguments in the symbol table plus
you will also be adding the pointers to the symbol table entries of
the arguments to the argument list field in the symbol table entry of
I hope this helps you.
Thanks and Best Regards,
Subject Matter Expert
Return to the
Search the comp.compilers archives again.