|
||||||
| Tutorials Programming Tutorials - Post your tutorials here! |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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. Last edited by G_Morgan; 01-22-2008 at 11:50 PM. |
| Sponsored Links |
|
|
|
|||||
|
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 Programming is a branch of mathematics. |
|
|||
|
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.// Last edited by G_Morgan; 02-10-2008 at 10:00 AM. |
|
|||||
|
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 The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages! |
| Sponsored Links |
|
|
|
|||
|
Quote:
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 Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tutorial - An Internet browser! | travy92 | VB Tutorials | 9 | 11-30-2008 05:01 PM |
| Tutorial - ListBox, ComboBox & Command button. | travy92 | VB Tutorials | 9 | 07-06-2008 12:48 AM |
| John's Java Tutorial Index | John | Java Tutorials | 0 | 01-11-2007 04:05 PM |
| JSP Tutorial | encoder | JavaScript and CSS | 0 | 05-26-2006 06:31 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |