CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 131 users online: 10 members, 97 guests and 24 bots.
Members: chickendude, HOMER-16, nsg, ordelore, rcfreak0, shundra9, tifreak8x.
Bots: Spinn3r (2), Magpie Crawler (3), Googlebot (19).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
    » Goto page 1, 2  Next
» View previous topic :: View next topic  
Author Message
Zaphod Beeblebrox


Member


Joined: 11 Mar 2007
Posts: 153

Posted: 15 Aug 2009 07:31:15 pm    Post subject: Ti-Basic Extension

I am working on a program that in essence makes it easier to program TI-Basic on the computer. You write a program and then run it through a "compiler" on the calculator, which makes changes to an output file. The output file is then the ultimately run file. The compiler has 5 different options (at the moment) that can be turned on or off. They are:

* Comments - Anything after // is removed.
* Whitespace - Anywhite space outside of quotes is removed. This allows one to indent as often as one chooses on the computer without worrying about removing the indents.
* For-each - I am not exactly sure how I will implement this but I plan to add for-each loop capability for lists, matrices, strings and possibly even programs.
* Optimizer - A basic optimizer, not incredibly smart, but takes care of some basic stuff.
* Preprocessor - A C-style text preprocessor. I have only two commands implemented for this -DEF and -INC. DEF does basic text replacing. For example if one did -DEF != ≠. This would allow the person to use != wherever they wanted in the program. INC allows inclusion of another program inside their own. All it does is copy the code into the program, allowing for inclusion of any code or DEF statements inside that code.

I also intend to add plug-in support for additional compiler options. BTW, I am aware that "compiler" is the wrong term, but its the only one I could think of in this context. So I'm hoping that you guys might have some ideas for additional compiler options that you would like.
_________________
Project Status:
- Lunar IDE 1 - 100% | Done
- Lunar IDE 2 - 60% | Finishing unfinished bits
Back to top
Eeems


Super-Expert


Joined: 22 Jan 2009
Posts: 832
Location: Edmonton, Alberta

Posted: 15 Aug 2009 07:50:02 pm    Post subject:

I'm thinking that parser is the better term, looks like a good idea though, I'd love to see it
_________________
Back to top
Glenn


Expert


Joined: 16 Jan 2006
Posts: 557
Location: virginia

Posted: 16 Aug 2009 11:18:51 am    Post subject:

I believe that you used the better term in one of your features, preprocessor. I think this looks cool, I will have to look at it when it is published.
_________________



Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55751
Location: Earth, Sol, Milky Way

Posted: 16 Aug 2009 01:40:06 pm    Post subject:

Preprocessor is indeed the correct term. As someone who has written a compiler from scratch (you know, one that turns C code into an x86 binary executable by way of x86 assembly in Linux), it pains me to hear a set of replacements and somewhat intelligent macros being called a compiler. With that said, this sounds like a very fun project, and I look forward to seeing how it progresses. How does SourceCoder fit into this? Smile
_________________


Back to top
Glenn


Expert


Joined: 16 Jan 2006
Posts: 557
Location: virginia

Posted: 16 Aug 2009 04:46:44 pm    Post subject:

KermMartian wrote:
Preprocessor is indeed the correct term. As someone who has written a compiler from scratch (you know, one that turns C code into an x86 binary executable by way of x86 assembly in Linux), it pains me to hear a set of replacements and somewhat intelligent macros being called a compiler. With that said, this sounds like a very fun project, and I look forward to seeing how it progresses. How does SourceCoder fit into this? Smile


You wrote a compiler??? why??? Is it available on the net?

Zaphod Beeblebrox I forgot to ask, is this a program on calc or on comp?
_________________



Back to top
Ultimate Dev'r


Join us on #cemetech-vaporware


Joined: 16 Mar 2005
Posts: 7297

Posted: 16 Aug 2009 06:52:59 pm    Post subject:

Glenn wrote:
KermMartian wrote:
Preprocessor is indeed the correct term. As someone who has written a compiler from scratch (you know, one that turns C code into an x86 binary executable by way of x86 assembly in Linux), it pains me to hear a set of replacements and somewhat intelligent macros being called a compiler. With that said, this sounds like a very fun project, and I look forward to seeing how it progresses. How does SourceCoder fit into this? Smile


You wrote a compiler??? why??? Is it available on the net?


Compiler Construction is a common class for EE/CS students.
_________________



Back to top
Glenn


Expert


Joined: 16 Jan 2006
Posts: 557
Location: virginia

Posted: 16 Aug 2009 07:22:02 pm    Post subject:

Oh, I never would have realized that.
_________________



Back to top
Zaphod Beeblebrox


Member


Joined: 11 Mar 2007
Posts: 153

Posted: 16 Aug 2009 09:25:09 pm    Post subject:

The program is a on the calculator (although I suppose I could write one for the computer). However, it is meant to make writing programs on the computer easier. So I have the preprocessor, comments and whitespace have been taken care of. I'm not really up to date on what SourceCoder does, but I think in terms of optimizations it should provided some basic stuff that SourceCoder probably provides. I will post a code sample of input and output code as soon as I get a chance.
_________________
Project Status:
- Lunar IDE 1 - 100% | Done
- Lunar IDE 2 - 60% | Finishing unfinished bits
Back to top
Kllrnohj


/=\ PH34R |\/|3


Joined: 24 May 2005
Posts: 8189

Posted: 16 Aug 2009 10:12:04 pm    Post subject:

Glenn wrote:
You wrote a compiler??? why??? Is it available on the net?


I've wrote a compiler as well. It isn't that hard to make a simple compiler *shrug*

The real question is why you would want it. Kerm's compiler sucks donkey balls compared to GCC, VC++, and the like.
_________________
There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup)
Back to top
elfprince13


OVER NINE THOUSAND!


Joined: 23 May 2005
Posts: 10232
Location: A galaxy far far away......

Posted: 17 Aug 2009 12:18:23 am    Post subject:

Kllrnohj wrote:
I've written a compiler as well.

Or "I wrote," but don't combine the two.

Zaphod: This is a very useful sounding project. You should create a computer version that tokenizes+generates an .8xp as well.
_________________
StickFigure Graphic Productions || VSHI: Vermont Sustainable Heating Initiative


Back to top
Ultimate Dev'r


Join us on #cemetech-vaporware


Joined: 16 Mar 2005
Posts: 7297

Posted: 17 Aug 2009 01:46:22 am    Post subject:

elfprince13 wrote:
Kllrnohj wrote:
I've written a compiler as well.

Or "I wrote," but don't combine the two.


?
_________________



Back to top
swivelgames


Transient Squash


Joined: 27 Sep 2005
Posts: 2345
Location: On the planet called Earth

Posted: 17 Aug 2009 02:33:44 am    Post subject:

Seems like it could be an interesting project to watch grow Smile
Back to top
Glenn


Expert


Joined: 16 Jan 2006
Posts: 557
Location: virginia

Posted: 17 Aug 2009 09:17:16 am    Post subject:

Kllrnohj wrote:
Glenn wrote:
You wrote a compiler??? why??? Is it available on the net?


I've wrote a compiler as well. It isn't that hard to make a simple compiler *shrug*

The real question is why you would want it. Kerm's compiler sucks donkey balls compared to GCC, VC++, and the like.


I was curious about it, I wouldn't necessarily use it but I was curious to see what it was like.
_________________



Back to top
elfprince13


OVER NINE THOUSAND!


Joined: 23 May 2005
Posts: 10232
Location: A galaxy far far away......

Posted: 17 Aug 2009 03:12:57 pm    Post subject:

Ultimate Dev'r wrote:
elfprince13 wrote:
Kllrnohj wrote:
I've written a compiler as well.

Or "I wrote," but don't combine the two.


?


He said "I've wrote," which is fairly failtastic, coming from our most anal grammar nazi. I was pointing out to him that "I have written" or "I wrote" would both be correct, but "I have wrote" would not. Mixing tenses == fail.
_________________
StickFigure Graphic Productions || VSHI: Vermont Sustainable Heating Initiative


Back to top
Ultimate Dev'r


Join us on #cemetech-vaporware


Joined: 16 Mar 2005
Posts: 7297

Posted: 17 Aug 2009 03:17:20 pm    Post subject:

elfprince13 wrote:
Ultimate Dev'r wrote:
elfprince13 wrote:
Kllrnohj wrote:
I've written a compiler as well.

Or "I wrote," but don't combine the two.


?


He said "I've wrote," which is fairly failtastic, coming from our most anal grammar nazi. I was pointing out to him that "I have written" or "I wrote" would both be correct, but "I have wrote" would not. Mixing tenses == fail.


BTW where is the Grammar Nazi? Can he come out and play? Smile
_________________



Back to top
Kllrnohj


/=\ PH34R |\/|3


Joined: 24 May 2005
Posts: 8189

Posted: 18 Aug 2009 12:48:37 am    Post subject:

elfprince13 wrote:
He said "I've wrote," which is fairly failtastic, coming from our most anal grammar nazi. I was pointing out to him that "I have written" or "I wrote" would both be correct, but "I have wrote" would not. Mixing tenses == fail.


The only thing failtastic in this thread is your memory...
_________________
There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup)
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55751
Location: Earth, Sol, Milky Way

Posted: 18 Aug 2009 08:22:40 am    Post subject:

Kllrnohj, I bet mine was more complex than yours. Smile I supported the full C99 standard, except for some strangeness with typedefs that would have made my parser three times as complex as it was, and would also technically break my hierarchical, modular model. It even did some rudimentary optimization to minimize the use of temp registers. Smile
_________________


Back to top
Kllrnohj


/=\ PH34R |\/|3


Joined: 24 May 2005
Posts: 8189

Posted: 18 Aug 2009 09:29:03 am    Post subject:

KermMartian wrote:
Kllrnohj, I bet mine was more complex than yours. Smile I supported the full C99 standard, except for some strangeness with typedefs that would have made my parser three times as complex as it was, and would also technically break my hierarchical, modular model. It even did some rudimentary optimization to minimize the use of temp registers. Smile


I was a real man and made my owner grammar spec rather than steal one Razz (it was also a high level language inspired by Python)

But yes, yours does sound more complex (well, more complete, anyway) - then again, I did mine just while I was in class (and I never took any classes on compilers Wink ). Was yours a single pass or did you do it properly (tokenize, grammar check, AST, etc...)? Did you use any tools (lex/yacc, etc..)?
_________________
There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup)
Back to top
elfprince13


OVER NINE THOUSAND!


Joined: 23 May 2005
Posts: 10232
Location: A galaxy far far away......

Posted: 18 Aug 2009 10:00:44 pm    Post subject:

Kllrnohj wrote:

The only thing failtastic in this thread is your memory...


I like how you didn't even bother checking your own post to see if I was right or not.


_________________
StickFigure Graphic Productions || VSHI: Vermont Sustainable Heating Initiative


Back to top
Ultimate Dev'r


Join us on #cemetech-vaporware


Joined: 16 Mar 2005
Posts: 7297

Posted: 18 Aug 2009 10:08:52 pm    Post subject:

elfprince13 wrote:
Kllrnohj wrote:

The only thing failtastic in this thread is your memory...


I like how you didn't even bother checking your own post to see if I was right or not.



Nice circle Good Idea
_________________



Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page 1, 2  Next
» View previous topic :: View next topic  
Page 1 of 2 » All times are GMT - 5 Hours

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.048627 seconds.