Python Front-end to GCC
Mark Janssen
dreamingforward at gmail.com
Tue Oct 22 11:04:21 EDT 2013
I love it. Watch this...
[context]
>>> A language specification in BNF is just syntax. It doesn't say anything
>>> about semantics. So how could this be used to produce executable C code
>>> for a program? BNF is used to produce parsers. But a parser isn't
>>> sufficient.
>>
>> A C program is just syntax also. How does the compiler generate
>> executable machine code? Extrapolate into a Python front-end to C.
[Dave Angel responds:]
> Did you even read the paragraph you quoted above? The BNF specification
> does NOT completely describe a language, it only defines its syntax.
[Steven D'Aprano responds:]
> Like every other language, C programs are certainly not *just* syntax.
> Here is some syntax:
>
> &foo bar^ :=
Now, I don't know where y'all were taught Computer Science, but BNF
specifies not only syntax (which would be the *tokens* of a language),
but also its *grammar*; how syntax relates to linguistic categories
like keywords, and tokens relate to each other.
Dave is claiming that BNF only defines the syntax of a language, but
then Stephen goes on to supply some syntax that a BNF specification of
the language would not allow (even though Steven calls it "syntax"
which is what BNF in Dave's claim parses).
So which of you is confused? I ask that in the inclusive (not
exclusive OR) sense.... ;^) <-- face says "both".
Mark Janssen
Tacoma, Washington.
More information about the Python-list
mailing list