Python Front-end to GCC
Neil Cerutti
neilc at norwich.edu
Tue Oct 22 14:18:18 EDT 2013
On 2013-10-22, Mark Janssen <dreamingforward at gmail.com> 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
More information about the Python-list
mailing list