The Artima Developer Community
Sponsored Link

Python Buzz Forum
NABA Compiler

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Fabiano Weimar dos Santos

Posts: 104
Nickname: xiru
Registered: Nov, 2003

Fabiano Weimar dos Santos is a brazilian Plone, Zope and Python developer.
NABA Compiler Posted: Dec 6, 2003 7:16 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Fabiano Weimar dos Santos.
Original Post: NABA Compiler
Feed Title: [Xiru].org
Feed URL: http://xiru.org/blog/search_rss?path=/Xiru/blog
Feed Description: [Xiru].org - Fabiano Weimar dos Santos' Website. Usefull information about xiru's projects, Plone and Zope community and Python hacks.
Latest Python Buzz Posts
Latest Python Buzz Posts by Fabiano Weimar dos Santos
Latest Posts From [Xiru].org

Advertisement

In the begging of this week, I "finished" a compiler prototype. I called it NABA, a worst version of a Java compiler. NABA is written in Python and It's not made to be a real compiler. For me, It's some kind of "prof of concepts". However, the code could be very usefull for "educational" use.

NABA have a lexical parser written using regular expressions. That part of the code is very clean and robust (my favorite part). The sintatic and semantic parser was written manually, without any "yacc" like tool. It is a recursive implementation based on a ambiguous grammar. However, the code is clear and very well organized. The semantic actions and type verification are made using an interesting approach, based on dynamic lookheads between recursion calls and an object tree to represent the symbols escopes.

At least for now, I don't want to finish this project. I'm publishing the code to make it avaliable for everyone. If you like it, use it to create your own code or for simple inspiration. Make a compiler is not a trivial task, but with a code snipted it could be more interesting and funny.

The source is avaliable for download here.

Read: NABA Compiler

Topic: Bootstrapping a web hosting service Previous Topic   Next Topic Topic: Test test...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use