Monday, December 5, 2011

Short about FON*C


This is update of this blog after some time, so first, I want to tell you what happened with the language I intended to make earlier this year ...  As you can see in my previous post, I intended to make a language that will compile to CIL code. Well, I did it. I made it during the studies at the Faculty of Organizational Sciences under the supervision of my mentor - professor Saša D. Lazarević who gave me a very idea of making the language and great help with language definition and the necessary literature.

The name of the language is FON*C, and it is completely C-like, imperative, strongly typed language made with ANTLR and C#. FON*C is statically typed and has numerous built in types: int, long, bool, char, string, float, file, etc., and user defined types: enums, structs and delegates. It supports following flow control statements: if, switch, for, goto, while and do while. It supports header files, so you can make your own function libraries and include it with #include directive, just like in C. You can pass function arguments by value and by reference, etc...

I will not post the source code of the FON*C compiler here at this time because it became pretty big over the last couple of months, so it might happen that one can't see the forest for the trees.
Instead, int the next post I will show you how to make one much simpler, but complete compiler. When you realize how to do it, you can make bigger and more complex compilers by yourself. All you need then is the idea what to build, and the time to do it.

No comments:

Post a Comment