Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.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: Neil Cerutti Newsgroups: comp.lang.python Subject: Re: Python Front-end to GCC Date: 22 Oct 2013 18:18:18 GMT Organization: Norwich University Lines: 32 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net bFBOj4jkR6wOxM/HomxTdww/SXa8s52QsAXjFfwWJ9gnm0DReO Cancel-Lock: sha1:sOc8rFQYDE0fmdjARayZPmrk458= User-Agent: slrn/0.9.9p1/mm/ao (Win32) Xref: csiph.com comp.lang.python:57291 On 2013-10-22, 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". Context-sensitive grammars can be parse, too. > A lexer parses the tokens specified in the BNF into an Abstract > Syntax Tree. A lexer traditionaly reads the text and generates a stream of tokens to the parser. > If one can produce such a tree for any given source, the > language, in theory, can be compiled by GCC into an executable. What executable would GCC compile from a program that matched this grammar? spamgram = spam1, { ', ', more_spam }, '.' spam1 = 'Spam' more_spam = spam, { ', ', spam } spam = 'spam' -- Neil Cerutti