Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Piet van Oostrum Newsgroups: comp.lang.python Subject: Re: Python Front-end to GCC Date: Tue, 22 Oct 2013 13:20:51 -0400 Lines: 36 Message-ID: References: <4012031f-5334-4be8-a673-e0d8c8917fb2@googlegroups.com> <5a4e0ec9-c977-4a86-83b0-9f4c55a82e37@googlegroups.com> <54f8eb09-7a2e-4306-86f2-7ae118fa8055@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net FSnNbrGT77bYUTa71ZI1TQbk9sX9zeR7K0AktyPIxAdPh+EJOu Cancel-Lock: sha1:uQwN3anW/0MIMMRdYhJij47odRE= sha1:UZ76aoMu9bE4b93dhdW01CY75MQ= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (darwin) Xref: csiph.com comp.lang.python:57278 Mark Janssen writes: > 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. Syntax is grammar. Tokens are part of the grammar (but often specified separately with a different grammar, usually regular expressions, which is a subset of BNF). So are you just confused or are you trollong? -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4]