LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-03-2008, 04:38 AM   #1
Virtual Circuit
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 66

Rep: Reputation: 15
I'm looking for a open source BASIC Interpreter


I'm interested in Compiler science, and computer graphics.
My requirement is a very simple BASIC compiler/Interpreter, with graphic support. Clean code so I can look inside and understand how it works. Afterwards I want to make my own compiler for an embedded 8052 project.

I've been warned not to use lex and yacc, because "quote they generate a large finite state machine that some have gone insane trying to debug." However in a book I read those were the utilities used.

Any suggestions, a long time ago I used Apple BASIC and MS QBASIC. It would be nice if I there was a large depository of sample programs too.

Thanks so much
 
Old 04-03-2008, 04:42 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
many many hits on google, did you try there first?

http://www.thefreecountry.com/compilers/basic.shtml
 
Old 04-03-2008, 08:11 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Agreed... this has been implemented to-death.

And if Steve Wozniak can build a complete tiny-BASIC in less than 2 kilobytes of 6502 assembler-code, you can do it too.
 
Old 04-03-2008, 11:00 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
The Puppy Linux project has been using a version of basic -gtkbasic forked from wxbasic -for a lot of different purposes the last couple of years. It might be good to check it out since it is still being worked on and they have lots of programs that are using it.
 
Old 04-04-2008, 06:36 AM   #5
Virtual Circuit
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 66

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by sundialsvcs View Post
Agreed... this has been implemented to-death.

And if Steve Wozniak can build a complete tiny-BASIC in less than 2 kilobytes of 6502 assembler-code, you can do it too.
I've searched google and browsed the web, I still can't find what I need. I found a few Apple II emulators, either the source was not available or just way to messy. The graphics rendering was scary.

I'm searching now for:
Steve Wozniak 6502 BASIC
Bill Gates Altari BASIC
looking for original ROM and emulator to run it in.

Any suggestions?
 
Old 04-04-2008, 06:50 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
that's wasn't anything like what you've asked for. you asked for a basic interpreter not an emulator...
 
Old 04-04-2008, 08:23 AM   #7
Virtual Circuit
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 66

Original Poster
Rep: Reputation: 15
Give me the chance to clarify

I spoke of emulator, because I would need one to run the apple basic interpreter for apple basic. Are any of you using any apple II e emulators on your linux box?

My ultimate goal is to create a c listing for a simple interpreter for embedded systems. Some mixed-signal system-on-chip microcontrollers have more memory and speed than an Altair or Apple ][ e. At the cost of about $20

I spent several hours searching for Bill Gates's Altair BASIC and Steve Wozniak's 6502 BASIC source code, I was unable to find what I was looking for. I did find many broken links and much interesting history. I ended with the assumption that if I did find the source code it probably would be in assembly and not in the C language. I also reviewed http://www.thefreecountry.com/compilers/basic.shtml and still don't see anything I can use.

I need my listing to be in ANSI C, so I can port it to any platform, almost all chips support an ANSI C tool chain. When done the CLI I/O will probably be to and from a serial port.

I tried searching for keywords combinations such as BASIC lex yacc. Is there a depository for computer languages written with compiler generation utilities such as flex/yacc. Because thats what I really need.

As I mentioned before I wanting graphic capability, that is still second priority to core functions. And since they aren't any well known standards for graphics hardware for cheap embedded systems, this requirement was probably ahead of mentioning.

Thanks
 
Old 04-04-2008, 12:17 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Mole basic is defined in terms of a yacc grammar, albeit with a lot of supporting C code. Did you overlook it at http://www.thefreecountry.com/compilers/basic.shtml? I gave it a spin a while back and was able to modify it to add some special-purpose features without a lot of grief (target host was Linux).
--- rod.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
basic Open source c++ IRC bot. xconspirisist Linux - Software 9 05-14-2010 09:52 PM
BASIC interpreter for RedHat 9.0? WindsorKnot Linux - Software 3 02-23-2007 10:31 PM
LXer: Open Source Mono Gets Visual Basic LXer Syndicated Linux News 0 02-21-2007 06:31 PM
LXer: Open-source alternative offers basic protection LXer Syndicated Linux News 0 05-14-2006 05:03 AM
is there a BASIC interpreter/compiler? needforspeed Programming 4 05-01-2005 02:47 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration