Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'operator': 0.03; '(at': 0.04; 'source,': 0.04; 'syntax': 0.04; 'yet.': 0.04; 'tree': 0.05; 'subject:Python': 0.06; 'semantic': 0.09; 'topics,': 0.09; 'cc:addr:python-list': 0.11; 'language,': 0.12; 'language.': 0.14; 'ast': 0.16; 'cc:name:python list': 0.16; 'enough.': 0.16; 'janssen': 0.16; 'lexer': 0.16; 'or)': 0.16; 'somehow.': 0.16; 'syntax,': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; '(not': 0.18; 'trying': 0.19; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'compiled': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'cc:2**2': 0.30; 'specified': 0.30; 'gcc': 0.31; 'subject:end': 0.31; 'this.': 0.32; "we're": 0.32; 'not.': 0.33; 'role': 0.34; 'could': 0.34; "can't": 0.35; 'received:google.com': 0.35; 'clear': 0.37; 'pm,': 0.38; 'previous': 0.38; 'enough': 0.39; 'skip:* 10': 0.61; 'discuss': 0.62; 'information': 0.63; 'hear': 0.63; 'such': 0.63; 'become': 0.64; 'provide': 0.64; 'to:addr:gmail.com': 0.65; 'exclusive': 0.81; 'boom.': 0.84; 'inclusive': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=J2OqOK/kIthlspu45625Uw/OpcpCVdRHmBVMVYbAdMM=; b=y1bLBTiipolx9XUFp2gAaYCyKlwUze+oV5iMQoyXxMs7lTPQEkfBzdkl9t7bbeWm77 mh4Q2Qzo3UAhSaVcSYCqjsrSKEgw4q97L8z5Qny9N/SFgJSSV0/HfwxR8x7P3B/uIQBy 0FBYydK+uZetSqbj8vp2ApLqAWo8eMJ8ccRCWeCqf/54EIHVhv7+9FajyjlMOPmQUZAL ihPfRQUjWBVn/SsmMtjuMgivkxWqSOv/wHzkblVR2e3s5vg4GxUqwu9FYMWJ3MwwfVuK ANlkOWcXAt4LMDm0QJQptmJq4Z9Q0RV91iWEHZQ++XD1dr2XIZK1E3N79WhueuD1exjb JAvQ== X-Received: by 10.236.37.105 with SMTP id x69mr16659914yha.15.1382464570784; Tue, 22 Oct 2013 10:56:10 -0700 (PDT) Sender: Ned Batchelder Date: Tue, 22 Oct 2013 13:56:09 -0400 From: Ned Batchelder User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Mark Janssen Subject: Re: Python Front-end to GCC References: <4012031f-5334-4be8-a673-e0d8c8917fb2@googlegroups.com> <5a4e0ec9-c977-4a86-83b0-9f4c55a82e37@googlegroups.com> <54f8eb09-7a2e-4306-86f2-7ae118fa8055@googlegroups.com> <52669DC3.5010601@nedbatchelder.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Python List , Dave Angel , Steven D'Aprano X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382468581 news.xs4all.nl 15970 [2001:888:2000:d::a6]:46965 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57302 On 10/22/13 1:50 PM, Mark Janssen wrote: >>> So which of you is confused? I ask that in the inclusive (not >>> exclusive OR) sense.... ;^) <-- face says "both". >> Could you please be less snarky? We're trying to communicate here, and it >> is not at all clear yet who is confused and who is not. If you are >> interested in discussing technical topics, then discuss them. > Okay. The purpose of BNF (at least as I envision it) is to > produce/specify a *context-free* "grammar". A lexer parses the tokens > specified in the BNF into an Abstract Syntax Tree. If one can produce > such a tree for any given source, the language, in theory, can be > compiled by GCC into an executable. > > Boom. Hmm, I don't hear the boom yet. An Abstract Syntax Tree is a tree representation of a program. To use my previous example: the program "123 *!? 456" would become a tree: op: "*!?" num: 123 num: 456 There's still not enough information to compile this. The operator *!? needs to have a meaning assigned to it. That's the role of the semantic specification of a language. That has to be provided somehow. A BNF, or a grammar, or a syntax, or an AST can't provide the semantics. That was the original point: syntax isn't enough. --Ned.