ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.