OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Mar 19, 2024 2:06 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: ExC: Custom programming language
PostPosted: Fri Mar 03, 2017 4:00 pm 
Offline
Member
Member
User avatar

Joined: Mon Sep 12, 2016 10:21 am
Posts: 28
Location: London, UK
Small update; working on creating an AST from a queue of tokens. Each AST component has a parent (except for root) and children, creating a hierachial tree. AST components can also have metadata (this is currently used in functions to store name, return type and access level)

Image

_________________
I'm bored.


Top
 Profile  
 
 Post subject: Re: ExC: Custom programming language
PostPosted: Fri Mar 03, 2017 8:47 pm 
Offline
Member
Member
User avatar

Joined: Sun Dec 25, 2016 1:54 am
Posts: 204
You may wish to look at this...

http://www.antlr.org/

cheers

_________________
Plagiarize. Plagiarize. Let not one line escape thine eyes...


Top
 Profile  
 
 Post subject: Re: ExC: Custom programming language
PostPosted: Sat Mar 04, 2017 4:05 am 
Offline
Member
Member
User avatar

Joined: Mon Sep 12, 2016 10:21 am
Posts: 28
Location: London, UK
Thanks for providing the link, but I'd rather make the parser and such manually, since I don't want to miss out on the experience that I could probably use in the future :p

_________________
I'm bored.


Top
 Profile  
 
 Post subject: Re: ExC: Custom programming language
PostPosted: Fri Mar 10, 2017 3:56 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
Actually, the experience you probably could use in the future would be using parser generators. Bison, ANTLR, Boost.Spirit. If you're writing your own parser, for your own programming language, for your own OS, you're looking at tripple reinvention of the wheel.

Next thing you'll design your own language for programming your own parser for your own different language... and then design your own text editor for programming.... it has to stop at some point. ;-)

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re: ExC: Custom programming language
PostPosted: Fri Mar 10, 2017 4:22 am 
Offline
Member
Member
User avatar

Joined: Mon Sep 12, 2016 10:21 am
Posts: 28
Location: London, UK
Solar wrote:
Actually, the experience you probably could use in the future would be using parser generators. Bison, ANTLR, Boost.Spirit. If you're writing your own parser, for your own programming language, for your own OS, you're looking at tripple reinvention of the wheel.

Next thing you'll design your own language for programming your own parser for your own different language... and then design your own text editor for programming.... it has to stop at some point. ;-)


Yeah lol. I'll probably stop at OS though :p
Reinventing the wheel is kinda fun tho

_________________
I'm bored.


Top
 Profile  
 
 Post subject: Re: ExC: Custom programming language
PostPosted: Sun Mar 19, 2017 4:13 pm 
Offline
Member
Member
User avatar

Joined: Fri Aug 07, 2015 6:13 am
Posts: 1134
Can I create classes and access functions and objects using the dot operator? Does it support operation overloading? Can you use voids (any other function types) with structs? Is there a way to test this language out? Also I really really like its name. Keep working no matter what people say. Sometimes you do stuff because you want to learn something / have fun. My personal opinion is that you should make it more like C# and less like C++. This should be a combo of C and C#.

_________________
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader


Top
 Profile  
 
 Post subject: Re: ExC: Custom programming language
PostPosted: Sat Mar 25, 2017 2:43 pm 
Offline
Member
Member
User avatar

Joined: Mon Sep 12, 2016 10:21 am
Posts: 28
Location: London, UK
octacone wrote:
Can I create classes and access functions and objects using the dot operator? Does it support operation overloading? Can you use voids (any other function types) with structs? Is there a way to test this language out? Also I really really like its name. Keep working no matter what people say. Sometimes you do stuff because you want to learn something / have fun. My personal opinion is that you should make it more like C# and less like C++. This should be a combo of C and C#.


ExC doesn't support classes atm, and pointers are still a big work in progress, so I can't say much there except I do want pointers to be able to point to anything, and to have a fairly legible syntax (originally I was going to do something like "int pointer var = 5;" but then how would it handle pointers to pointers and such). I am working on a way to test the language; the compiler will spit out an assembly-like bytecode which you'll be able to put either into a second compiler (to turn into assembly) or VM (VM is what I've decided to do first since it's more platform independent and I can use it to start testing the language's syntax for real).

_________________
I'm bored.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group