To be fair, its an interpreter, not a compiler. Compilers require even more code and even more time.
Thanks for all the links though, I'll check them all out.
Type: Posts; User: patrink
To be fair, its an interpreter, not a compiler. Compilers require even more code and even more time.
Thanks for all the links though, I'll check them all out.
I started working on a small programming language as a spare time project and I have created most of the functions (for input, output, variables, etc) except for the first step (ie, parsing the...
After 2 cups of coffee I finally got it working. I've just been working on ways to error handle it, but that's another story for another time.
Again, thanks for your help.
This is quite embarrassing on my part that its right on the wikipedia page...I need more coffee.
hrmm...am I really that tired that I thought * and + are right associative? That basically solves everything. Thanks.
The only problem now is I don't know how to deal with the + because it is right associative and it has the lowest precedence. Everything else works otherwise.
According to wikipedia:
either o1...
I'm having a little trouble implementing the operator part of the shunting-yard algorithm.
It seems very straight forward, but every implementation I do, it doesn't seem to work as intended.
...
Thanks for the help. I'm actually thinking to do this in C++, as stacks are already implemented there, and a try catch statement won't hurt.
I wanted to make a Reverse Polish Notation calculator which would take in an input such as:
(1 + 2 * 3) ^ 4 + 5 * (6 + 2)
turn it into Reverse Polish Notation in the order of operations:
1 2 3...
Thanks for all the input. I realized I'd get criticized for misusing malloc (and not freeing) as much as I did, but in the beginning I needed it. As it stands so far, I can see why "int n = (int)...
This is not a question per se, but instead asking for help to fix a proof-of-concept program.
I wanted to do arithmetic on large numbers, but 32 bits aren't quite big enough, so I created a...
if you want to code how to calculate large numbers you will have to do one of two things:
1.) Invest some time looking for Binary-coded decimal (BCD) code in C, and how to use it.
2.) Create...
I don't know much about the GDI, but I heard it can take screenshots so I attempted to find a bit of code to do so. Problem is, after alot of debugging, I still have no idea why it isn't working.
...
Thanks for the reply. But after a few hours of googling (because not only did I want to take a screenshot, but save it too), and messing with a bit of code, I managed to put this all...
at Quzah, I was just wondering if any shorter way has been made....I know there are a few windows functions which make it easier...but to be honest, I'm still an amateur, I don't know exactly which...
I have a a short question. I want to be able to take a screenshot of the desktop, without manually pressing print screen and save it to a file.
Most of the resources that I have searched to do...
you can use sys/timeb.h's timeb struct. If sys/timeb.h is unavailable, you can use Windows.h's SYSTEMTIME. Just replace "struct timeb" with "SYSTEMTIME" and "ftime" with "GetSystemTime". Then replace...
Just a tip, scanf separates strings when it encounters a space or newline (and maybe something else, correct me if I'm wrong)
typing in:
char Variable1[80], Variable2[80], Variable3[80];
...
Hey everyone, I have a few questions regarding creating my own scripting language.
I'm having a bit of trouble when it comes to tokenizing the file (ie, the lexical analyzer). My first version,...
Yeah...sorry about that, I like to complicate things more than they should be.
__BUFR is initialized in
int String(char *__BUFR[], int __CHARS, int __SIZOF, int __CAPS)
It (should) point to...
I've been working on a way to create a random generator for ints and chars, but eventually I gave up and started working on a way to make what was already available (rand() from cstdlib).
I made...
The code you wrote needs to be refined a bit first before we get to the if statements.
First of all, there is an extra left curly bracket above "int i" and one below "int div = 3", those should...
I've been having a little problem with grabbing a word from a file then checking it using an if statement to see if it is true or not.
when the code reaches the "printf("Line = ...." it prints out...
the atoi function in the stdio header file can return an int from a char then you can just add it up. You could try something like this:
int sumfunc(int x, char y){
z = x + atoi(y) /*...
I'm with CommonTater, two files should be used. here is some code that will read, find and replace, then remove the input file and rename the output file to the input.
Disclaimer: i haven't tested...