Re: Is it possible to generate a context-free grammar for a programming language?



"Jimmy" <jimmy_please@xxxxxxxxx> writes:

Not knowing enough on how a compiler work, is it just treating all
keyword as string of terminals? Then replace all variables based on
the declaration, through assignment or passing into a function/method/
constructor? Is there certain syntax is not as straight forward so
add-on logic is required to determine the replacement of the string
intelligently?

There is no short answer to this (except "No, it is a bit more
complicated than that", try
http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/index.html .

Torben

.


Quantcast