Go to Post It would be a (relatively) level* playing field *...though it seems like the actual field will be anything but level. - Jacob Bendicksen [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Spotlight this post!  
Unread 29-11-2001, 19:17
kiracofe8 kiracofe8 is offline
Registered User
#1317 (Digital Fusion)
Team Role: Engineer
 
Join Date: Nov 2001
Location: Columbus, OH
Posts: 30
kiracofe8 will become famous soon enough
Coincidentally, I got frustrated with PBASIC last year, so one night when I was bored I wrote a PBASIC preprocessor. It has nested If-then-else constructs, as well as do-while loops. I meant to post it here, but I never got around to it. You can take a look at it if you want. The source code is at:

http://www.cis.ohio-state.edu/~kiracofe/epbc-src.tgz

A linux binary is available at

http://www.cis.ohio-state.edu/~kiracofe/epbc-bin.tgz

It's written in straightforward C++, so it should compile in MS Visual C++ although I've never tried it. Note that you'll need lex if you want to modify the lexer. If there is interest, I'll try to get some Windows binaries available. Just e-mail me at kiracofe.8@osu.edu.

As far as the structure of the compiler goes, it's pretty straightforward. I use lex to tokenize the input stream. I wrote the parser myself instead of using yacc (or bison or whatever) b/c the language was so simple, I figured this would be easier. Everything is implemented using C++ virtual functions. This makes the writing of nested constructs very easy. (e.g. we can call a function to output a statement without having to worry about what kind of statement it is, since each statement class knows how to "output itself"). Once you understand the BNF of the language (included in the README), the structure of the code should make sense, I hope...

If you have any comments, questions, or suggestions, let me know...
__________________
/* Daniel */
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PBASIC ARCTAN function Greg Ross Programming 14 11-05-2003 12:28
Obscure PBASIC for RoboEmu rbayer Programming 1 28-03-2003 23:57
PBasic 2.5 vs. 2.0 Anthony Kesich Programming 6 09-02-2003 22:06
emulationFIRST (aka PBasic emulator) Matt Leese Programming 5 30-06-2002 12:06
PBASIC Loop Speed? archiver 2001 3 23-06-2002 23:46


All times are GMT -5. The time now is 09:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi