Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 22nd, 2011, 11:57 AM
Rhymer Rhymer is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2011
Posts: 7 Rhymer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 49 m 44 sec
Reputation Power: 0
Other Language - Develope structure for Procedural Language

Hi all,

I like to write simple games and one-trick pony apps in VB6 for fun. I finally finished (almost all debugged) a chess program (with no AI though). I designed a spreadsheet with 26 cols x 99 rows and quite a few other middling sized apps. Now I want to try my hand at creating an interpreted procedural language that will be quite similar to BASIC/VB itself though not window based, just text output. I have no plans to make a compiler.
I am considering the structure which we all know is wise to do before just jumping in and start coding. My first question is when I read the source code can I assign all procs, funcs and dimmed vars in one pass or is it better to do a double scan so that routines referenced but not yet defined will be assigned on the second pass?

In order to support scope, I plan to have in my program these variables:
Code:
  Dim Proc(name$, Value, required vars as type, optional vars as type, n)
  Dim Func(name$, Value, optional vars as type, return as type, n)
  Dim StringVar(name$, Value, in use, n)
  Dim IntegerVar(name$, Value, in use, n)
  Dim LongVar(name$, Value, in use, n)
  Dim BooleanVar(name$, Value, in use, n)
  Dim SingleVar(name$, Value, in use, n)
  Dim DoubleVar(name$, Value, in use, n)

with an element in the array to indicate a source variable is in use. So if a sub uses variable J and calls another sub that also uses J, I need both J's to be independent. What I think will work is to prefix the user's variable with the current sub's name and search the appropriate array data type for an empty slot (not in use) and assign it there.
I hope to support the 'Static' keyword so that when found in a proc or func I will not unassign the variables but 'let it ride'.
I do not plan to convert to tokens at this time, maybe later. I love straight ASCII.
I do not plan to support graphics.
User arrays I plan to allocate dynamically or can't I. Maybe I will have to have some 'dummy' 1,2,3 element arrays and redim them at runtime using:
Code:
  Dim 1Array1()
  Dim 1Array2()
  Dim 1Array3()
  Dim 1Array4()
  Dim 2Array1(,)
  Dim 2Array2(,)
  Dim 3Array1(,,)

along with another internal array that matches the user's array name with the dummy array I am using.
I do not plan to support Date or Time functions/formats other than Date$ and Time$. Usually on larger projects I like to get important features established then fall into 'Creeping featuritus' mode... meaning add more capability later. I know I have bit off quite a lot in this endeavor. I may even be able to make it work Haha.

Thanks for any suggestions on my approach in structuring this program.

Rhymer

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Other Language - Develope structure for Procedural Language

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap