Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: compiler with python

0 views
Skip to first unread message

Dave Angel

unread,
Mar 6, 2010, 6:37:12 AM3/6/10
to mohamed issolah, pytho...@python.org
mohamed issolah wrote:
> hey,
>
> How can I construct a compiler with python just for informatiom ., I have
> habit to construct it with C language,
>
> sorry for my english ;-)
>
You need to tell us what you're really trying to do, what tools you're
willing to use, and probably why you want it. And if you're not sure
about your English, keep the sentence structure straightforward.

Let me make a couple of wild guesses:

You want to design and build a compiler that takes xml information as
its source code, and compiles those xml files into Intel x86 machine
code. The compiler and the resulting executable needs to run on an x86
Linux machine. Your previous experience was in doing this sort of thing
in C, but you want to try it with Python instead. You want to do it
without using the lxml libraries.

You want to build a python compiler, that takes python source code and
produces Java byte code files. You'd like to do this in C, but don't
want to use any of the available existing CPython or Jython source
code. Your goal is not to make a commercially viable product, but to
learn as much as possible in the process.


DaveA

Dave Angel

unread,
Mar 6, 2010, 10:56:19 AM3/6/10
to mohamed issolah, pythonlist
mohamed issolah wrote:
>
> 2010/3/6 Dave Angel <da...@ieee.org>
> hey,
>
> I want to create a compiler which transform a code like pascal code (that
> what I do in C) to "quad"
> In C, I use BISON and FLEX tools.
>
>
>
I've forwarded your message to the list, and fixed your top-posting by
moving your response to the bottom. I don't have a clue what "quad" is,
unless it's a synonym for Forth.

You haven't specified the OS you'll be using to run the compiler, nor
the one you're targeting, so some of these choices may not be useful.
For example, the first one is Linux only.

http://www.freenet.org.nz/python/pybison/
PyBison - Python binding for Bison/Flex

http://freshmeat.net/projects/yeanpypa/
http://www.slash-me.net/dev/snippets/yeanpypa/documentation.html

http://www.python.org/community/sigs/retired/parser-sig/towards-standard/

Or you could go here, which has links to (most of) these and others.
http://wiki.python.org/moin/LanguageParsing

DaveA

Steven Howe

unread,
Mar 6, 2010, 4:13:19 PM3/6/10
to pytho...@python.org
Is it possible he's talking about a 'quad core'? as in a CPU? In that
case I think he wants
to optimize a python program for a multiprocessor core with four processors.

sph

Alf P. Steinbach

unread,
Mar 6, 2010, 4:29:04 PM3/6/10
to
Since Mohamed is talking about compilation I think it's more likely he's talking
about an intermediate program represention based on quad tuples like

(OP, DESTINATION, ARG1, ARG2)

Cheers,

- Alf


* Steven Howe:

Stefan Behnel

unread,
Mar 7, 2010, 9:57:02 AM3/7/10
to pytho...@python.org
mohamed issolah, 06.03.2010 14:07:

> I want to create a compiler which transform a code like pascal code (that
> what I do in C) to "quad"
> In C, I use BISON and FLEX tools.

Hi,

please stop starting new threads for the same topic. Instead, reply to
responses you get.

Stefan

Mark Lawrence

unread,
Mar 7, 2010, 10:16:25 AM3/7/10
to pytho...@python.org
Alf and Steven Howe, please don't top post, it makes it all but
impossible to follow a thread. Darn!:)

Mark Lawrence.

0 new messages