Skip navigation

For the first version of the implemented language, I’ve decided for it to be rather C-like (as already stated). For this version, there is only one function, main. The initial main is laid out as follows:

int main(void){}

I’ve also thought about

void main(void){}

and instead of having a return statement use a global “exit(0),” I pretty much ruled this possibility out.

I removed the “int argc, char** argv” for now… too much trouble to mess with.
Now, the rest of the usable syntax is:
Types:
* long
* ulong -unsigned long
* llong -long long
* ullong -unsigned long long
* short
* ushort -unsigned short
* char
* uchar -unsigned char
* byte -unsigned char with some special properties
* float
* double
Other Terminals:
* ‘+’ -addition
* ‘-’ -subtraction
* ‘*’ -multiplication, pointer op also… but will through a syntax error for now
* ‘/’ -division
* ‘%’ -modulo
* ‘++’ -increment
* ‘–’ -decrement
* ‘(‘ -grouping expressions
* ‘)’
* ‘=’
Miscellaneous:
* exit(x)
* print(x)
Type Specifications:
* [0-9]+ -integer
* 0(x|X)[0-9A-Fa-f]+ -hex integer
* [0-7]+(o|O) -octal integer
* [0-1]+(b|B) -binary
* [0-9]*’.’[0-9]+(f|F) -float
* [a-fA-F_]+[0-9a-fA-F_]* -id

As you can see this is a fairly sparse lexicon for now. There are character constants and string literals (the string literals being of no use for now). If you’ll notice, the octal specification is it ends in an ‘o’ I did this because I like having the ability to place as many ’0′s in front of my base 10 integers as I wish.

-cQuaid

Advertisement

6 Comments

  1. Cool story, cQ.

  2. I think you should’ve considered Visual Basic as well. :P

    • Surely you’re joking, but I’m glad you still check my blog… you should stop by the irc channel on occasion as well!

  3. Lol, I am afraid that you will catch me and not let me go if I go to IRC… Hehe, damn, I will only take introductory Java course this semester maybe. Hopefully, I’ll C++ and Advanced Java next year unless what that old geezer said comes true. (Holy Loch Ness Monster, Oct. 21 == judgment day) *sadface*

    • I wont force you to stay, but I haven’t had too many interesting people to talk to on IRC anymore. It gets a bit sad having to see so many interesting people come and go. Many of the older denizens that were around for quite a while have started to wander off. So, I’d appreciate you dropping by every once in a while. (Due to work, I tend to get on somewhere between 18:00-00:00 GMT-6).

  4. :)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.