J
junky_fellow
Hi,
Sorry, for asking similar questions again and again.
1) I want to know how should we reslove the ambiguities in a c
expression ?
Should we use precedence table as mentioned in K&R book or should
we refer to the ANSI C grammar ?
2) As told by many people in this newsgroup that ANSI C grammar does
not use
precedence to resolve the ambiguities. In fact, the grammar has been
written in
such a way so that no precedence is required to resolve the
ambiguities (please
correct me if I am wrong).
My question is, why "precedence" is not used in ANSI C grammar to
resolve the
ambiguities ? Is it possible to write a new ANSI C grammar file (yacc
file) that
uses precedence ? Is there any such file already available on the web
?
3) Personally, I feel "precedence and associativity table" more handy
and easy
to remember to parse a C expression. Should I continue to use this
table or
refer the C grammar for this ?
4) Any idea in which language the first C compiler was written ?
5) Do the people use lex/yacc to write modern C compilers (like gcc
and other) ?
thanks for any help .....
Sorry, for asking similar questions again and again.
1) I want to know how should we reslove the ambiguities in a c
expression ?
Should we use precedence table as mentioned in K&R book or should
we refer to the ANSI C grammar ?
2) As told by many people in this newsgroup that ANSI C grammar does
not use
precedence to resolve the ambiguities. In fact, the grammar has been
written in
such a way so that no precedence is required to resolve the
ambiguities (please
correct me if I am wrong).
My question is, why "precedence" is not used in ANSI C grammar to
resolve the
ambiguities ? Is it possible to write a new ANSI C grammar file (yacc
file) that
uses precedence ? Is there any such file already available on the web
?
3) Personally, I feel "precedence and associativity table" more handy
and easy
to remember to parse a C expression. Should I continue to use this
table or
refer the C grammar for this ?
4) Any idea in which language the first C compiler was written ?
5) Do the people use lex/yacc to write modern C compilers (like gcc
and other) ?
thanks for any help .....