Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Tutorials, Classes and Code

Tutorials, Classes and Code Codes, Software, and Classes for download to our registered members.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-2008, 10:48 PM
G_Morgan G_Morgan is offline
Guru
 
Join Date: Oct 2007
Age: 24
Posts: 388
Rep Power: 10
G_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to all
Default Compiler/Interpreter tutorial - any interest?

My final exam for the first semester is this morning. After that I intend to finish off some work I'm doing wrt compilers and interpreters. I just wanted to see if anyone was interested in a series of tutorials on compilers and interpreters from the perspective of someone who is just understanding how they work (i.e. I remember what bits were 'What?!?' so might take it in a more practical way rather than theoretical).

Note that if I do one it will probably be done either in C or C++ exclusively (I might use other languages to highlight some concepts if I have code already written, like I have a basic scanner written in python to handle the whitespace issue), it would be first of all an interpreter and then taking the parser and adding a code generator to the end of it. It would not be for any existing language (if anything it will be a very narrow subset of C) and the code output will be hopelessly inefficient. There could well be only one data type. The compiler would probably target Linux (though it would be relatively simple to port it to other archs). We would only be using C (or C++) and the standard libraries. No third party libraries for special data structures will be used so we will probably end up implementing a hash table, linked list and a stack at some point.

It's worth considering that even if you have no interest in compilers that it would be (I hope) a good exercise in C, parsers and data structures. While some assembly may be involved in the later stages it will be explained as far as needed.

Anyway, if there's any interest in it just post here. It might take me a month to get together all the stuff I'll need and write the articles.
__________________
Currently bemused by: LLVM.

Last edited by G_Morgan; 01-22-2008 at 10:50 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 01-23-2008, 12:58 AM
v0id's Avatar   
v0id v0id is offline
Super Mod
 
Join Date: Apr 2007
Location: Denmark
Posts: 1,876
Last Blog:
CherryPy(thon)
Rep Power: 23
v0id is a name known to allv0id is a name known to allv0id is a name known to allv0id is a name known to allv0id is a name known to allv0id is a name known to all
Send a message via MSN to v0id
Default

It sounds really nice to me. I was really into compilers and interpreter some years ago, and made some small ones myself. It would be really great to get it refreshed, and learn some more. I can only say; go for it! I'll definitely read them. I'm especially looking forward to the parser-process.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-23-2008, 10:44 AM
WingedPanther's Avatar   
WingedPanther WingedPanther is offline
Super Mod
 
Join Date: Jul 2006
Age: 35
Posts: 1,751
Last Blog:
Game software (GURPS)
Rep Power: 24
WingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to allWingedPanther is a name known to all
Default

I'm interested. I'm looking at making a general tutorial on programming concepts myself. Sort of a pseudocode tutorial.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-10-2008, 08:30 AM
G_Morgan G_Morgan is offline
Guru
 
Join Date: Oct 2007
Age: 24
Posts: 388
Rep Power: 10
G_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to all
Default

I've done the code for the first tutorial on this. Thought I'd upload it early if anyone wants a look. One change is that I've used C++ rather than C*. All the code is MIT/X11 licensed (basically do what you want but don't remove the copyright notice, see the files for more details). All it does so far is take a series of identifiers, integers and some operators and tokenises the stream. All the testing has been done on x86/Linux (Ubuntu specifically). There's no symbol table and no parsing as of yet.

The tutorial to go with this will follow at some point.

*I created a dynamic string struct and library for C but it still didn't look very nice. C++ streams are a god send.

//edit - first version had some bugs. I've fixed it and uploaded.//
Attached Files To view attachments your post count must be 1 or greater. Your post count is 0 momentarily.
__________________
Currently bemused by: LLVM.

Last edited by G_Morgan; 02-10-2008 at 09:00 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-29-2008, 09:30 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Age: 25
Posts: 4,512
Last Blog:
Zend: PHP Security Web...
Rep Power: 50
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default Re: Compiler/Interpreter tutorial - any interest?

I'm interested in as well. This type of tutorial would benefit many people here on the forum trying to learn and understand C/C++.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 03-29-2008, 10:02 AM
G_Morgan G_Morgan is offline
Guru
 
Join Date: Oct 2007
Age: 24
Posts: 388
Rep Power: 10
G_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to allG_Morgan is a name known to all
Default Re: Compiler/Interpreter tutorial - any interest?

Quote:
Originally Posted by Jordan View Post
I'm interested in as well. This type of tutorial would benefit many people here on the forum trying to learn and understand C/C++.
I should be getting to the write up for the first part pretty soon. I've stalled a bit because of piled up work at Uni.

The lecturers quite cleverly decided to avoid the masses of coursework clashes from the end of last semester by giving us every single piece early in the semester. It's not as if the coursework can clash early on instead of later is it...

Anyway should be clear by the end of the week, then I can look at writing up the framework for the lexer and getting on with making it do something useful.
__________________
Currently bemused by: LLVM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-03-2008, 04:08 AM
Chinmoy's Avatar   
Chinmoy Chinmoy is offline
Programming Professional
 
Join Date: Feb 2008
Location: where heaven meets earth
Posts: 301
Rep Power: 5
Chinmoy has a spectacular aura aboutChinmoy has a spectacular aura about
Default Re: Compiler/Interpreter tutorial - any interest?

Sounds great to me! Would love to see something like that..
__________________
God is real... unless declared an integer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial - ListBox, ComboBox & Command button. travy92 VB Tutorials 7 03-11-2008 11:54 AM
Tutorial - An Internet browser! travy92 VB Tutorials 8 02-17-2008 09:10 PM
John's Java Tutorial Index John Java Tutorials 0 01-11-2007 03:05 PM
JSP Tutorial encoder JavaScript and CSS 0 05-26-2006 05:31 AM


All times are GMT -5. The time now is 05:49 PM.

Contest Stats

John ........ 87.50000
dargueta ........ 75.00000
Xav ........ 50.00000
MeTh0Dz ........ 20.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000

Contest Rules

Ads