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.

Geek Culture / Take on C ; (And all the great links on Compiliers)

Author
Message
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 27th Jan 2004 05:05 Edited at: 27th Jan 2004 05:05
I really don't know how useful this will be for anyone. Although, I've spent most the day searching the internet for these topics, so I might as well save you some time as well.

Some URL's:

Teaches on Lex & YaCC
http://dinosaur.compilertools.net/

Tutorial on Programming a Compilier on C
http://compilers.iecc.com/crenshaw/


Some Book Links:

Writing Compiliers and Interpreters
http://www.amazon.com/exec/obidos/tg/detail/-/0471113530/ref=pd_bxgy_text_1/102-8676814-4432937?v=glance&s=books&st=*

Sams Teach Yourself C in 21 Days
http://www.amazon.com/exec/obidos/tg/detail/-/0672324482/102-8676814-4432937?v=glance

Modern Compilier Design
http://www.amazon.com/exec/obidos/tg/detail/-/0471976970/qid=1049947481/sr=8-1/ref=sr_8_1/102-8676814-4432937?v=glance&s=books&n=507846

Game Scripting Mastery
*I highly recommend this book from the description and previous experince from the Preimer Press Series*
http://www.amazon.com/exec/obidos/ASIN/1931841578/qid%3D1049947504/sr%3D11-1/ref%3Dsr%5F11%5F1/102-8676814-4432937

Construting Language Processors for Little Languages
http://www.amazon.com/exec/obidos/tg/detail/-/0471597546/ref=pd_bxgy_text_1/102-8676814-4432937?v=glance&s=books&st=*

Complete Book of C Programming
http://www.amazon.com/exec/obidos/tg/detail/-/0130960934/qid=1075167258/sr=1-17/ref=sr_1_17/102-8676814-4432937?v=glance&s=books

Compiliers (Better known as the DRAGON BOOK)
http://www.amazon.com/exec/obidos/ASIN/0201100886/qid%3D1049840066/sr%3D2-1/ref%3Dsr%5F2%5F1/102-8676814-4432937

C Programming for the Absolute Begginner
http://www.amazon.com/exec/obidos/tg/detail/-/1931841527/qid=1075167258/sr=1-15/ref=sr_1_15/102-8676814-4432937?v=glance&s=books
-------------------------
-------------------------

Not sure how much this will help anyone.(Sure would've helped me 4 hours ago )

Let me know if there are any must have books for learning C.
Share experiences, advice, etc.

(Disclaimer)
This is in no way me advertising against DarkBasic or the Game Creators. This is a post with links on learning C, and rare books on building Compiliers. I understand it may offend TGC members, and I will not be offended if this topic is taken down.

A book? I hate book. Book is stupid.
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 27th Jan 2004 05:09
Interesting. I was thinking about researching these very topics.

Thanks yellow. You've saved me a ton of time.
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 27th Jan 2004 05:59
Quote: "This is in no way me advertising against DarkBasic or the Game Creators."


lol, im learning c (slowly yet surly, dont really have the time now) i know JAVA fairly well. but i still use DB more that anything, i think it's funner, and i really dont think its just "childs play" or anything...no offence taken yellow

nice job on looking it will be helpful now i must take a run to the library

Great Knight
22
Years of Service
User Offline
Joined: 25th Feb 2003
Location:
Posted: 27th Jan 2004 06:28
lol I will add on to your list.
tutorial from this person
http://www.brackeen.com

http://www.brackeen.com/home/vga/index.html

Links from his site I found.
http://brand107.home.comcast.net/pc-gpe/
http://pages.infinit.net/jstlouis/3dbhole/


When you get a chance check out the posts on his forums. If you think some posts are bad here lol.

AMD Atherlon 2400+ XP, 380 DDr memeory, ATI Radeon 9000 64 DDR, Windos XP home edition.
-----------------------And a Katana.
las6
22
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Finland
Posted: 27th Jan 2004 10:54
http://www.bloodshed.net/

Keyboard not detected. Press F1 to continue.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Jan 2004 10:56
@Yellow, the crenshaw tutorials are in Pascal, although they are easy enough for anyone to follow really.

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 27th Jan 2004 13:51 Edited at: 27th Jan 2004 13:52
@IanM- Whoops guess that one slipped. Still might help someone out.

@Darwin- Nope I don't think DB is child's play either. Although I've been interested in building a compilier for a couple months now, I think C is better fit than DBP.(DBP still is the best for fast and quality game development)



@Neophyte- Glad I could help.

@las6 and Great_Knight- Good Good, add as many links as you'd like.

@All

Add any good tutorials for C, compiliers, interpeters, theory, etc. here.



A book? I hate book. Book is stupid.
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th Jan 2004 14:51 Edited at: 2nd Apr 2011 15:54
Expression Evaluation. This is simple example of expression evaluation, the core of compiler design. While the example has been kept simplistic, you can easily expand upon this.

The same principal behind this, is how Play Basic and yes even DBpro work.

http://www.pbcode.underwaredesign.com

MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 27th Jan 2004 15:57
Thanks for posting that link uwdesign. I remember one of my posts back on LLRGT when you first lead me to it.

It's what has gotten me started on compilier design.



A book? I hate book. Book is stupid.
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th Jan 2004 18:05 Edited at: 11th Aug 2010 22:00
Erm, that example was written primarily for you, as well as little exercise to help alpha test http://www.PlayBASIC.com

There's some interesting links there, while I wish i'd found those a couple of years ago, oh well. Anyway, while it seems to be huge task writing a compiler, these days i've come to see it as a pretty trivial task. It's purely a logical problem.

Anyway, to get started writing your compiler, you only need a hand full of routines. The most difficult of which, logically, is the expression evaluation, but that's covered above. The other parts are dead easy.

Assuming the compiler is token based. Then the parser is entirely based around a central function that converts the next bit of source code into a token/offset, creatively called GET_TOKEN. This means we have one central processing loop identifying the main tokens (commands). All tokens are trapped here. These tokens represent either the language core structural commands, like IF/THEN/ For/NExt declarations et, while, which are handled manually. While anything else falls through to be evaluated as a command. If it's unknown after that, then the user typed something stupid


repeat

Token=GetNextToken()


if token=Token_if
Call the tokenize expression function. This function reads all the following tokens into the token buffer, then attempts to resolve the expression back to a single resulting token. IF there's only one token left, after called the eval expression function, then dump out the code for this comparison.
Next, Check for a THEN token.. If no then. It's must bean IF/ENDIF or IF/ELSE/ENDIF
Continue
endif


if token=token_goto
grab the next token. Check if it's a label token. If it is, then insert the code for the goto/label address.
contiune
endif

etc etc

If the token is not of the above, we'll check if it's a command token. All commands, like every else have unique token identifier. The commands would be placed in a table. Thus you either search/ or index the table to check what inputs and data types the command has. The evaluate the following expression, you call the resolve expression function.

.cont:
until EndofSource


The main change occurs within expression evaluation function. Since the language is not always going to be dealing with known values/strings, operations between variables need be resolved as operational tokens such as ADD/SUB/MUTL/Div/Compares etc. So rather than replace the resulting token with the known answer, a temp variable is generated and thus inserted in the place of the expunged operation and variables. So thus the temp variable carries forward in the expression as normal. Since the evaluation is done order of precedence, we end with a list of instructions that solve this expression.

The only other thing is how variables are handled. In Play Basic all variable casting, and a numbers of other operations, occur with the get_token function. This make everything above it, so much easier !. Thus when get token sees the next string characters are alphanumeric, first it checks those to the command table. If it's not found as a command We can then assume it's a variable, and thus check if it's within the variable table. This table is just stack of variables found to date. The table has certain flags about each variable, like it's scope, it's type. The check routine returns the Index of this variable within he table. But, If it's unknown the routine adds it's to the end of the list, and returns the newly created index.

If you revisit the evaluate expression example, you'll notice that before, constant values were represented as a token called "Token_Constant" plus a secondary value, that being the actual value. So to represent variables, we'd create a token called say "Token_Variable" and rather than store it's value (since it's unknown at compiler time), it's accompanying value is the variables index within the variable table.


Believe it or not, you now have enough basics to turn the above evaluation example into a simple compiler.. have fun

MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 28th Jan 2004 21:00 Edited at: 28th Jan 2004 21:05
Yup compilier design is one of those things that definitly takes planning. Thinking about ordering some of those books myself.

Would be kinda fun just to get a basic language going.

Also, that book on Script Mastery could prove useful for DB(P) users.(not necessarily the code, but the theory of design)

Any more thoughts or opionions on the subject?



[EDIT] I'm also looking for any good resource sites for general C and C++, whether related to gaming or not.

A book? I hate book. Book is stupid.
Represent
21
Years of Service
User Offline
Joined: 24th Dec 2003
Location:
Posted: 28th Jan 2004 21:23
I am learning C++ and got a free compiler called Quincy97. I think C++ is way better then standard C.

Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 31st Jan 2004 06:58
@Yellow

I found some more links on compiler construction that you might be interested in.

This ones is a fairly extensive list of parsers:
http://www.thefreecountry.com/programming/compilerconstruction.shtml

And another one on Programming Grammers half of which appear to be C or C++ based.
http://www.thefreecountry.com/sourcecode/grammars.shtml

On a similar note:

Linkers!

If you are writting a compiler or something yellow then some info on linkers could be quite helpful.

Heres what appears to be the complete draft of a book dedicated to linkers and loaders:
http://www.iecc.com/linker/

Here is a free linker with source code and documentation included. It appears to be formally a commerical product so its quality is probably up there over other free linkers with source on the net. Might be a good example of how a professional linker is written. However, it is for MSDOS and is quite old.
http://www.devoresoftware.com/freesource/wlsrc.htm

Here is another free linker. It appears to be much more up to date then the warplink and hence more relevent.
http://alink.sourceforge.net/

Another linker with source. This one claims to be Ten times faster than MS Link. Definately worth a look. It is DOS linker though.
http://www.sudleyplace.com/

Thats all I've managed to find for now. I'll post later if I can get more. This is some very interesting stuff.
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 31st Jan 2004 18:58
Thank you Neophyte.

Looks like I'll be very busy for the next couple months.

Basically I'm thinking of building a simple language and compilier that will read basic math operators. UWDesign has already got me started, and now I'm thinking about stepping up towards C.

Will definitly be a long(years) term project, and just something on the side for me to mess with.

(I'll also be stopping by Borders Bookstore to pick up a couple of those books tomorrow. )



A book? I hate book. Book is stupid.
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 31st Jan 2004 20:22
@yellow

"Thank you Neophyte. "

You're welcome.

This may be over kill for what you are planning but I've found some good free c interpreters that may help you.

UPS seems to be quite the impressive debugger. Its a source level debugger that has its own built in C interpreter that you might want to check out. Unfortuneately, it doesn't run under windows. Just every other OS under the sun. Anyway, its open source so you might want to take a peek.http://www.concerto.demon.co.uk/UPS/

There is also CInt which is another interpretor that I found that also comes with source code. This one can run under Windows too.
http://root.cern.ch/root/Cint.html

"UWDesign has already got me started, and now I'm thinking about stepping up towards C."

Yeah, UWDesign's comments have gotten me to thinking about building my own compiler for a little language of choice myself. I was actually toying with the idea before I found this thread, but since then I'm definately going to take the plunge and try it out for myself.

Anyway, thanks for the links that you supplied yourself as they've given me the motivation to actually get started.
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 1st Feb 2004 01:50
Np

I wouldn't be surprised if you already had this, but I'll post the flipCode links anyway.

http://www.flipcode.com/tutorials/tut_scr01.shtml
http://www.flipcode.com/tutorials/tut_scr02.shtml
http://www.flipcode.com/tutorials/tut_scr03.shtml
http://www.flipcode.com/tutorials/tut_scr04.shtml
http://www.flipcode.com/tutorials/tut_scr05.shtml
http://www.flipcode.com/tutorials/tut_scr06.shtml
http://www.flipcode.com/tutorials/tut_scr07.shtml
http://www.flipcode.com/tutorials/tut_scr08.shtml
http://www.flipcode.com/tutorials/tut_scr09.shtml

Worth a good read for anyone, even if they don't understand the source code.



A book? I hate book. Book is stupid.
Preston C
22
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 1st Feb 2004 01:59
I cannot believe no one posted this link for C++ OpenGL tutorials!

http://nehe.gamedev.net/

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 1st Feb 2004 19:10
@Preston Chanderton

"I cannot believe no one posted this link for C++ OpenGL tutorials!"

Well, we kind or were talking about Compilers and the lot.
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 16th Feb 2004 06:36
Just bought the book "Compiliers Principles,Techniques, and Tools" today from my local Borders.(Also, got an excellent book to teach me PHP/MySQL, but that's off topic )

Finally starting to figure out what uwdesign was talking about in his tutorial. Even though I've only read the first 20+ pages, I'm getting a good feel.

If anything, just the few diagrams I've seen of how a compilier works has made the book a good buy.

-------------------------
I know this topic was kinda dead, but I'll keep updating my progress and let you know if I get anything working.



A book? I hate book. Book is stupid.
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 16th Feb 2004 08:48
@yellow

"I know this topic was kinda dead, but I'll keep updating my progress and let you know if I get anything working."

Cool. I'll be interested to hear about whatever you get working.

I myself am working on a compiler and am working on the syntax checking part of it as I speak. The language in question is Basic4GL, which is a free interpreted basic that allows access to opengl 1.1. Its a pretty neat little language and the documents on the syntax are thorough enough that I won't have any trouble with any vagueries.

I've toyed with the idea of actually porting the compiler over to darkbasic once its done as all of the basic things necessary to get this thing running with B4GL cover what is needed to get DBP dlls and the lot working with it. Of coarse, its a bit too earlier to get cocky about porting it to DBP, but the idea is very tantalizing as certain compiler features that aren't implemented could be implemented if I built my own compiler.

But thats just my ego speaking. Whether I can pull something like that off is all a matter of how well the B4GL compiler works and I haven't gotten even halfway through that one yet.

Anyway, If you need any resources on the .exe file format, or .dlls, or .libs, or even low-level optimization techniques just post as I have been collecting quite a few resources on these subjects, and I must say they weren't all that easy to find. Some of them I happened across by sheer chance.
Martyn Pittuck
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 16th Feb 2004 09:59
Not sure if it has been mentioned, but borland now do BuilderX which is the latest incarnation of their free command line tools.

Come with IDE and downloadable addon that allows u to visually create a GUI suing the wxWindows API/Libaries (Which is cool)

About 350MB for builderX and 200 for Preview. But looks to be a C/C++ Compiler, although mainly C++.

Whats so good about living anywho?
Preston C
22
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 16th Feb 2004 14:49
Quote: "Well, we kind or were talking about Compilers and the lot. "


Oh, I thought this was C and C++ discussion as well

Cheers,
Preston


Intel Celeron 1.3 Ghrz 512MB Ram NVIDIA GeForceFX 5200 128MB
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 16th Feb 2004 16:12 Edited at: 16th Feb 2004 16:12
@Preston

Not a problem at all Preston. Although the topic is primarily on Compiliers, there definitly comes a part when OpenGL will come into play.

@Martyn Pittuck

I'll check out Borland later today and see what it's all about.

@Neophyte

Any resources would be great. Basic4GL sounds very great and a port over to DBP would be very interesting.

At the moment, I've got uwdesign's tutorial half working in darkbasic pro. I just need to figure out how I wanna go about recognizing commands and building a GUI.

--------------
Well, I'll keep reading up, and hopefully post some screenshots withing a month or two.



A book? I hate book. Book is stupid.
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 16th Feb 2004 22:08
@Preston

I don't know how interested in OGL you are, but Basic4GL has several of the nehe tutorials converted to it. So if you're interested in OGL you might want to give it a look. It certainly would be easier to learn OGL in a BASIC syntax than a C style one.

http://www.basic4gl.net/

@Yellow

"Any resources would be great."

Okay, here it goes.

For the PE file format(Portable Executable. .exes basically) you're going to need several tutorials as I haven't found any of the tutorials out there(and they are few and far between) to be clear enough to be used by itself. I use 4 different sources for my info on the PE file format.

Source 1: Iczelion's PE tutorials
http://win32asm.cjb.net/

This is the first one that I found and it isn't too bad though the examples are in MASM as that is a assembly langauge site.

Source 2: LUEVELSMEYER's Description
http://spiff.tripnet.se/~iczelion/files/pe1.zip

This is the main tut I use and can be found at the bottom of the first tutorial in Iczelion's series. Its pretty good, but it leaves out stuff about the dos stub(i think) and is a little sparse in areas.

Source 3: Tool Interface Standards
http://x86.ddj.com/intel.doc/tools.htm

This is probably the least used tut out of the 4 as it is really sparse on the info it gives out. However, it does provide a visual reference and that may be helpful as you work your way through Source 2.

Source 4: MSDN Magazine

I found this while searching for one of the references listed at the bottom of Source 2. Its the Feburary 2002 edition for Part 1 and March 2002 edition for Part 2.

Part 1:
http://msdn.microsoft.com/msdnmag/issues/02/02/PE/default.aspx

Part 2:
http://msdn.microsoft.com/msdnmag/issues/02/03/PE2/default.aspx

Although it doesn't really go into as much depth as Source 2, some of the figuares that are attached to both parts are priceless as the fill in the gaps missing in Source 2, and better explain certain parts then anything else I've encountered.

It also comes with a improved version of PEDUMP free to download. Source code included!

Speaking of pe examiners, there is a program called PEBrowse that I find to be quite usefull in learning the structure of the PE file format. You can find it here(Note: I'm talking about PEBrowse, NOT PEBrowse Interactive. The former is what you want while the latter is a debugger)http://www.smidgeonsoft.com

You'll probably also need a hex viewer in the beginning to make sense of things. I use HexCMP 2. There isn't any paticular reason why I use it, it is just the first free Hex viewer I came across that is of decent quality. You can find a free trail version of it here: http://www.fairdell.com/

Well, that covers .exes and .dlls(they both use the same format: pe!). .Libs I haven't really found any good resources on other the ones listed above, but I really haven't develed into them as much as .exes and by extension, .dlls yet.

As for software optimization, I found a really good resource by accident while I was browsing the menuetOS site that someone posted a link to earlier.

http://www.agner.org/assem/

That site is a godsend for software optimizers. I've learned quite a bit from his How to Optimise for Pentiums pdf that is very up to date.

Also, the links at the bottom of the page are proving to be useful as well as I managed to find a few of intel's volumes on their microprocessors that are bound to be a gold mine of info.

There are two volumes that I found that really described the Opcodes pretty good. They also describe what those obsure acronyms I keep running into mean like imm and rel32. I found that pretty handy.

Volume 2 a. Instruction Set reference A - M.
http://developer.intel.com/design/pentium4/manuals/253666.htm
Just go to the bottom of the page to where it says US ftp server and click there. It'll start downloading the pdf.

Volume 2 b. Instruction Set reference N - Z.
http://developer.intel.com/design/pentium4/manuals/253667.htm
The second half of the above volume. Same instructions apply for d/ling it.

There is a third volume off that site that deals with System programming that seems to be quite interesting. I haven't really got into it yet, but I'm pretty sure that it will come in handy later when I'm trying to write the assembler portion of my compiler.

Volume 3 System Programming Guide
http://developer.intel.com/design/pentium4/manuals/253668.htm

That's about all I have for now. I haven't really begun searching for resources on optimizing for AMD processors yet so I'll probably do that next.

Hope these resources help.
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 17th Feb 2004 23:38
Wow, thanks for all the nice finds Neophyte.

I'll get back to you in a week once I finish reading all those articles.

(Also, have been slowed in progress because I'm learning PHP/MySQL.)

Anyone else still reading, there's tons of links out there so post them.



A book? I hate book. Book is stupid.
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 19th Feb 2004 01:08
Well I found some resources on AMD optimatization that I'd like to share.

Here is one on porting 3DNOW instructions. You mentioned earlier that you were working on a compiler for a math oriented language(I think) so you might find it useful for use these instructions.
http://www3pub.amd.com/products/cpg/athlon/techdocs/pdf/22621.pdf


Here is one on general AMD processor optimization:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22007.pdf

I haven't looked into these too much, but I'm sure they will turn out to be pretty useful(I have an Athlon XP after all ).
UnderLord
21
Years of Service
User Offline
Joined: 2nd Aug 2003
Location:
Posted: 19th Feb 2004 02:05
now if i woulda had that C stuff a couple years ago it'd do me wonders....but i got bord with C to much coding for me

The search continues.
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 19th Feb 2004 05:59
why isnt this sticky? there's some nice stuff in here.

waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 19th Feb 2004 07:49
http://flatassembler.net/

although this is not C++ or how to make a compiler....
I think this is cool because of the docs.
Also, the use of multipart macros basically lets
you invent your own language on the fly.

internet gaming group
current project http://home.comcast.net/~norman.perry/Archon.html
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 19th Feb 2004 08:13
I've heard about FASM before, but I never really checked in to it. I didn't realize that it had interesting docs though. I'm going to give this a look later when I have the time.

Thanks for bringing that to my attention waffle.
Martyn Pittuck
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 19th Feb 2004 10:05
anyone else had a chance to look @ builderX by borland???

Whats so good about living anywho?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Feb 2004 14:11
I've downloaded it, but haven't had a chance to really try/test it yet

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 19th Feb 2004 23:56
Index on scripting languages:
http://www.gamedev.net/reference/list.asp?categoryid=76#118
Not 100% compiler related, but there's some good articles on adding scripting languages to game engines.(Same Principles could be applied to your DBP games!)

Briefing on Compilers
http://www.flipcode.com/tfiles/henry02.shtml
Very General info. on types of copilers.

Also want to make sure that this image is seen.

http://www.flipcode.com/tutorials/layout.jpg

A book? I hate book. Book is stupid.
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 20th Feb 2004 01:43
@yellow

Thanks for the links. I'm surprised that that image follows my plans so closely too. In fact, it is identical to what I had planned.

I take it that means that I'm on the right track.
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 21st Feb 2004 08:50 Edited at: 21st Feb 2004 08:51
@Everyone

Just thought I'd post this as I've just hit a milestone. I now have basic syntax checking for variables that are dimed and simple expressions.

i.e. something like this will now be evaluated fully.


My syntax checker can support an arbitrary number of variables dimmed with a comma i.e. dim a,b,c,d which is eqivalent to:


I also have variable checking and variable type checking working with those as well. By variable checking I mean checking an expression to see if the variables it uses have been declared(Basic4GL is an Option Explicit langauge. All variables are explictly dimmed and if a variable isn't it will cause a syntax error). By variable type checking I mean that if a known variable is found it also checks to see if its appropriate type symbol is found just after it. If it doesn't find it it will throw a syntax error.

i.e. Something like this is correct:


While something like this will throw an error:


My expression checker will handle an arbitrary amount of operators as well so you could do something like:

and it will be handled without a problem.

And did I mention that my lexer can handle expressions with no spaces in them?


The above is the same as this to the Syntax checker thanks to my lexer:


Anyway, exciting stuff for me. The code I have worked out now is expandable and will handle much more complex expressions quite easily.

I'm still a ways away from generating actual machine code, but I'm one big step closer to achieving that goal.
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 21st Feb 2004 09:13
Hey hey, anyone heard of CodeWarrior? Is it any good?

MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 5th Mar 2004 04:03
I've been to Codewarrior's homepage, but can't say I've ever used it nor heard anything about it. I suppose it's a decent tool though.



(I Can't let this topic die just yet? )
--------------------
Updates:

Still reading through the book Compiliers, Principles and Design.
Might have to re-read after I've read it once before I start working on anything. It's an excellent book that I recommend to anyone, just a lot for me to take in at one moment.

A book? I hate book. Book is stupid.
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 5th Mar 2004 08:12
@yellow

"I Can't let this topic die just yet?"

Neither can I.

With regards to my project, I haven't progressed much further than my last post. I've managed to fix several major bugs with my parsing routines but that is about it codewise. I've been trying to plan ahead with the design of my intermediate langauge and I've come to the conclusion that I'm going to have to write my own custom linked list routines to handle it(PureBasic's linkedlists are referenced by name, like DBPro's arrays are, and I need something that can be referenced by ordinal instead).

This looks like it is going to be a lot of work, but I think I'll manage.

Oh, and I found another excellent resource. This one is on compiler optimization and is shaping up to be quite usefull. Here is the site: http://www.nullstone.com/htmls/category.htm

Hope you find it usefull.
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 8th Mar 2004 02:12
Another nice find Neophyte.

(In fact, you've had so many nice finds I created a favorites folder with your name on it with the links.)



A book? I hate book. Book is stupid.
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 8th Mar 2004 06:09
@yellow

"Another nice find Neophyte."

Thanks.

"(In fact, you've had so many nice finds I created a favorites folder with your name on it with the links.)"

Sweet!

I'll see if I can dig up anything else later on. Though I think I'll be hard pressed to do so. I'm running out of links to find!
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 8th Mar 2004 20:53
i've decided to try and leard c++, i've downloaded dev-c++ from bloodshed and it's ide seems pretty good but i would like some simple code to try it out, i have the dx9sdk (no idea why i downloaded it) but the samples don't compile, can someone please post or email the equivilemt of ' print "hello" ' in c++ so i can test it

http://www.larinar.tk
AMD athlon thoroughbred 2200, 512Mb ram, 40Gb HD, ati saphire radeon 9600 atlantis w/128mb ddr ram, good creative-labs soundcard, cd-rw + dvd drives.
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 8th Mar 2004 22:14
Check out Curved Basic for C++ tutorials.



A book? I hate book. Book is stupid.
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 9th Mar 2004 01:14
k, will do, thanks yellow, (i hope to get a book soon)

http://www.larinar.tk
AMD athlon thoroughbred 2200, 512Mb ram, 40Gb HD, ati saphire radeon 9600 atlantis w/128mb ddr ram, good creative-labs soundcard, cd-rw + dvd drives.
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 9th Mar 2004 01:28
i can't even get the first program tut to work, even after i remove all the notations, it stops and says there is an error at the open function "{" i'm going to try another compiler+ide, any recomendatons?

http://www.larinar.tk
AMD athlon thoroughbred 2200, 512Mb ram, 40Gb HD, ati saphire radeon 9600 atlantis w/128mb ddr ram, good creative-labs soundcard, cd-rw + dvd drives.
Lord Ozzum
21
Years of Service
User Offline
Joined: 29th Oct 2003
Location: Beyond the Realms of Death
Posted: 9th Mar 2004 02:07
Hello World:

good luck

and a merry f*kking Christmas to you, @$$hole...
If I offend you, the Government is putting me through electric sleep, sorry!
mm0zct
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: scotland-uk
Posted: 16th Mar 2004 23:12
bump, i think this should stay in the first page, very useful even if it's not stricktly db related, it could be useful for writing dlls and plugins.

http://www.larinar.tk
AMD athlon thoroughbred 2200, 512Mb ram, 40Gb HD, ati saphire radeon 9600 atlantis w/128mb ddr ram, good creative-labs soundcard, cd-rw + dvd drives.
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 16th Mar 2004 23:50
I agree.

(I'll bump it once a month so it'll at least stay alive. )

Recently started learning OpenGL, and continue progressing through C++. Dragon Book has got me stumped a little, so I'm taking a break for the time being.

For those of you who like to look through books like me.
http://www.compilerconnection.com/books/books.htm

An extensive list of about 15 books on compiler construction,design,practice, and theory.



A book? I hate book. Book is stupid.
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 21st Mar 2004 21:40
Extensive list of compilers:

http://www.compilers.net/Dir/Free/Compilers/Basic.htm

Just started working on a small language with PureBasic. Am going to try to get basic math operators working along with some sort of print command and then work from there.



A book? I hate book. Book is stupid.
Neophyte
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 24th Mar 2004 11:14
A minor update:

In pursuit of a decent description of the file format for MS libraries, I stumbled across an offical description of the windows pe(.exe) file format and COFF file format. Its a word document in a .zip file and it appears to be the mother load of info that I've been looking for for quite some time.

It can be found here, hidden at some remote part of a site I've never heard of:
http://www.microsoft.com/whdc/hwdev/hardware/PECOFF.mspx

Hopefully, this will provide a better reference to the PE file format than the (brief and incomplete)tutorials that I posted earlier.
MikeS
Retired Moderator
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 26th Mar 2004 02:41 Edited at: 26th Mar 2004 02:42
Interesting, I'll add it to my Neophyte favorites folder.

Just wanted to show off some of my progess. I have a working IDE which will run any of my commands, except I'm having problems reloading the source to be viewed on the IDE again, so for now I just have to open up the .txt file and copy and paste it back into the IDE after exiting. (Should easily be fixed though.)

I've decided to use PureBasic for the time being, because I like how easy it is to create and use its gadgets. I might consider porting what I have over to DarkBasic Pro, or perhaps have a go at C/C++.

It's just an interpreter, nothing to get to excited about. Once I get this into a nice stable language (getting variables,arrays,functions,file commands,etc.), I'll try to mess around with OpenGL and get 3D graphics. Then, after all that, I'll probably just restart and try to get the executables into machine code so it runs faster.


(Ignore the Error at line 3. It just does that when it has nothing else to compile. Easily fixable, but I'm not worrying about it at this moment.)

Enjoy!



[edit] Currently no shots of the IDE yet, sorry!

A book? I hate book. Book is stupid.

Login to post a reply

Server time is: 2025-06-02 10:21:27
Your offset time is: 2025-06-02 10:21:27