Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / How to make a compiler using db ? - i have an idea...

Author
Message
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 28th Dec 2005 19:58
as i tolled already i`m good at c++ , and i studied assembling for some time , and i did a LOT of research on how to make a compiler in assembling or java virtual machine or so...

First you need to make a line parser (make it to read lines , and look for parameters)
then you need to make when it find parametres it converts them onto code found from engine for your language and..............
i`m realy working on a free compiler now , but i found a simple way to make a simple line parser in db . here it is.


IT`S MADE LIKE A ENGINE SO YOU CREATE YOUR OWN LANGUAGE IN IT , BELIVE ME ITS SIMPLE TO CREATE YOUR LANGUAGE IN IT...

here`s the code :


i make free 3d models , then you tell me some stuff about usseles posts and then something heppen...
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 28th Dec 2005 20:08
You really should learn how to do for/next loops and arrays next.


Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 28th Dec 2005 20:27
no it woudn`t do , belive me i don`t know ANY way that can help , if you do (i guess you do) please EXPLAIN to me how can i make a use of it in my compiler above ?

i make free 3d models , then you tell me some stuff about usseles posts and then something heppen...
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 28th Dec 2005 20:48 Edited at: 28th Dec 2005 20:52
The only part I can see right off the bat is


But that looks like it is completely different variables, so you might not be able to make good use of the for/next here

The part that for/next could fix (as far as I could see) is this small portion of code:

change that to


Other than that, great start, but, isn't kind of pointless to make a DB compiler using DB? Wouldn't you rather do it in C++ or something else?

Halo Man
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location:
Posted: 28th Dec 2005 20:54 Edited at: 28th Dec 2005 20:56
You didn't really need to use any for-next loops, it just would have saved a few lines. You did a good job still

Current Project: Fireworks Creator
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 28th Dec 2005 20:59
I realize, but I just wanted to show you could use for/next, but it only saved a 2 lines, 8 out of 10.

But, does anyone else feel it is kind of "pointless" to make a DB compiler....in DB?

Halo Man
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location:
Posted: 28th Dec 2005 21:01
Well, if your making a compiler of the exact same commands, yeah it is. But i thought he was just demonstrating a way to make a line parsor thingy.

Current Project: Fireworks Creator
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 28th Dec 2005 21:01
When you want to hold information you put it in an array... to repeat a line several times you use a for/next loop.




master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 28th Dec 2005 21:14
Making a DB created DB compiler is very pointless because it's running the same language using the same language when you could just get the real DB compiler and save loading time. A C++ compiler makes more sense

Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 28th Dec 2005 21:14
are you sure db classic has all that your talking about ??? (i`m not)
and as i sad i`m working on a compiler , NOT IN DB , i just wanted to show and explain some thing about line parsing , becouse a couple of months before i realy was desperate to know how those things work...

i make free 3d models , then you tell me some stuff about usseles posts and then something heppen...
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 28th Dec 2005 21:16
and i wasn`t making a db compiler , db was the language just for example so you can find your way throo , i didn`t menth it to have it , i made it as "ENGINE" so you make your own simple programming language in it.

i make free 3d models , then you tell me some stuff about usseles posts and then something heppen...
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 29th Dec 2005 00:02
anyways this could be used to make a simple translation program that can do translation for simple commands from some other language , or whatever i never seen anyone posted much on this subject...

i make free 3d models , then you tell me some stuff about usseles posts and then something heppen...
new programmer
19
Years of Service
User Offline
Joined: 20th Dec 2005
Location: right behind you.
Posted: 29th Dec 2005 05:49
makea a useful compiler for like smpleBASIC or something in CPP then make it open-source. really, it could be useful
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 29th Dec 2005 09:50
Quote: "are you sure db classic has all that your talking about ??? (i`m not)"


Are you talking to me? Surely you've done for/loops and arrays in C++.


Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 29th Dec 2005 11:24
Quote: "Surely you've done for/loops and arrays in C++.
"

i know , i did , but when i started some of your soruce codes as examples of its usage , it didn`t work in my db lite..........

Quote: "makea a useful compiler for like smpleBASIC or something in CPP then make it open-source. really, it could be useful "

Yes , i am working on that sort of compiler , first im making its engine , download my game pack 1 and there i put 2 examples of my engine features (i first need to make engine ,then a compiler and ide (working enviroment). For now , i just started , but i might end up with something good...
(i use assembly now , i learned some of it , donwloaded lot`s of tutorials , and i`m getting into that stuff - its not so much harded then when i first started with c++ (becouse i have more programming expirience i guess...))

i make free 3d models , then you tell me some stuff about usseles posts and then something heppen...
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 29th Dec 2005 11:40
Yeah , but that compiler will be very complex to make becouse i want to write a full engine that will look professionaly like dark basic (i mean it will have something like that options) - but that will take me 2,3 years in best case , it`s hard to do thing alone .......

so i figured i can for you just make a simple one (like simple basic) i won`t use c++ for it (i don`t need to) , nider assembling (i don`t need to , maby for some dll functions , but that`s only a little). and if someone want`s to help , mail me , or contact me on my web site - foruns

i make free 3d models , then you tell me some stuff about usseles posts and then something heppen...
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 29th Dec 2005 12:27
Well a Scripting Engine for DB, that had DB styled code would be a great idea and a lot more natural for Db users.

Anyway, I actually had a crack at it a few year back, but it was never really finnished off. A demo of language was to be used a Robot wars game written in DB.

Anyway for those who are interested here's a link to that project

Kyruss II - Demo

Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 29th Dec 2005 12:51
Quote: "Well a Scripting Engine for DB, that had DB styled code would be a great idea and a lot more natural for Db users.
"


hm....that`s not so easy to make in db...

i make free 3d models , then you tell me some stuff about usseles posts and then something heppen...
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 29th Dec 2005 21:56
Quote: "i know , i did , but when i started some of your soruce codes as examples of its usage , it didn`t work in my db lite.........."


You're still using Darkbasic Lite? You have like 100 projects going at once and you won't even buy Darkbasic?!?!

You really need to just break down and spend a little cash if you really want to make games with Darkbasic. Unfortunately the whole world doesn't have Darkbasic installed on their computer so not everybody is going to be able to run your great programs unless it's in an .exe.


Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 29th Dec 2005 22:01
i will buy db ofcourse , but i`m not sure on should i buy db or dbpro electronic/??????? - i`m not sure if i will have a use of those extra db pro`s features .


You sad it can use windows gui , so do you think i could make an ide for dark basic , using dbpro??

master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 29th Dec 2005 22:23
It would still be slow, and basically the same thing would be wrong (with what I explained). Not to sound like a broken record, but, C++ is a really good language to make the compiler in. Or the user could just get the real DB

Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 29th Dec 2005 22:27
i`m talking about an ide for db . i would like to make it to have "compile" option , but i don`t know how.,..

master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 29th Dec 2005 22:29
An ide in DBP? Or an ide written in C++?

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 29th Dec 2005 22:32 Edited at: 29th Dec 2005 22:40
If you wanna make a compiler in darkbasic and not scripting.. That would be hard.. Not only do you have to make a compiler, you would also have to make it convert the code into machine code... And alot more... And I myself have no idea of how you would make that in darkbasic In c++ the compiler compiles out varius of files.. And the object files are the files containing the machine code. Then we got some other files, some files stores debugger information in database files etc.. Theres alot in a compiler, and I got a book about it all, thought I cannot remember all the files hehe So making a compiler would not be possible in darkbasic I think.

Free Particle Engine For dbpro :
here
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 29th Dec 2005 22:45
Quote: "i`m talking about an ide for db . i would like to make it to have "compile" option , but i don`t know how.,.."


It kinda sounds like you only want to make your own compiler because you don't want to buy Darkbasic and continue to use Darkbasic Lite which does not allow compiling.

I sure hope i'm wrong.


Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 29th Dec 2005 23:16
NO YOU... i just want to make my ide for dark basic has "compile" option , not CREATE EXE OPTION , you know like RUN (to see what you made) and COMPILE (to check syntax for errors , and highlight possible ones...)

@The Nerd

yes , i know .... i read alot about compiler making myself , alot...

The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 29th Dec 2005 23:26 Edited at: 29th Dec 2005 23:26
If you've read so much about it, then why do you even try to make a compiler in DarkBasic...

just a thought.

Free Particle Engine For dbpro :
here
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 30th Dec 2005 00:16
c:\program files\dark basic software\dark basic\compiler.html

Everything you'll need to know.

Support the AAANJL by doing nothing! Visit teh site below..
new programmer
19
Years of Service
User Offline
Joined: 20th Dec 2005
Location: right behind you.
Posted: 30th Dec 2005 01:54
man, is lite like $19.99?? lol then DB is only $30.00 i think more. i can't remember cus i got "DarkBASIC free for schools" offer.
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 30th Dec 2005 02:12


i sort of am making a engine rountime in db , but not the whole thing

Login to post a reply

Server time is: 2025-05-23 00:30:16
Your offset time is: 2025-05-23 00:30:16