So well, yeah, time for some updates, or whatever you call it. As you might already know, I'm recreating ICE in C to make development faster, and easy add new features. This is coming along very well, I need to say. Currently numbers, variables, operators and parenthesis are supported (still need code for every operator), and more are coming soon. However, I'm running into a huge problem, and that are C functions. They are not like 'normal functions', such as not( and remainder( and so on. For the last type of tokens, I just add code for every possible argument type(s), rather than using the stack, like C functions need. However, this method simply doesn't apply to C functions, as they are supposed to take the input (arguments) from the stack, not registers etc. Thus, with the Shunting Yard Algorithm I'm doing, it is VERY hard to add C functions, and I'm not sure yet how to solve this. Let's take a look at some example:
- Code: Tout sélectionner
det(2,det(15,X+2->X 2 15 X 2 + det( det( X ->
det(2,det(15,X)+2->X 2 15 X det( 2 + det( X ->
det(2,det(15),X+2->X 2 15 det( X 2 + det( X ->
det(2,X+det(15),2->X 2 X 15 det( + 2 det( X ->
det(2,X,2*det(15))+3->X 2 X 2 15 det( * det( 3 + X ->
2*det(15,X)+3->X 2 15 X det( * 3 + X ->
det(2,X+2,1,2,3 2 X 2 + 1 2 3 det(
Left is the input, right is the input in infix notation.
Now let's take my last example. If I just parse them as normal, first the "+" is parsed, so X+2, but since the output isn't used in the next 2 elements (as an operator or function), the output is pushed to the stack, and that is where problems arise,
it should not even parse the +. First 3, then 2, then 1 should be pushed, afterwards X+2 parsed and pushed, then the det( function will be called.
Again, I've no idea how to solve this, and I'm open for any ideas!
Progress: I've added icon and description support: