Join us on Discord!
You can help CodeWalrus stay online by donating here.

[TI-84+CE] ICE Compiler

Started by PT_, March 25, 2016, 08:14:17 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Dream of Omnimaga

I'm happy to see SourceCoder support ICE. I liked SourceCoder since it seemed easier with it to work with the Minus symbol (as in, the smaller -, not the substraction one)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

#346
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:
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:

E37

Very fancy!
What does the det( command do? (in ICE)
  • Consoles, mobile devices and vintage computers owned: Ti83,Ti84!
I've never finished a project, there is always a way to improve!
What's my calc's name? Convert $37 to decimal. Look up that element in the periodic table. Then take the abbreviation of that element and you have it!
Look! A slime!    <(^.^)>

xMarminq_

  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

PT_

det( is the start of a C function, for example det(0 is "Begin", det(5 is "FillScreen" etc.

PT_

I've added SetBASICVar( which... sets a BASIC variable! :D

Download: https://tiplanet.org/forum/archives_voir.php?id=587211

Dream of Omnimaga

OMG does this mean external saves are now supported? O.O Also does it set to real vars?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

Quote from: DJ Omnimaga on May 08, 2017, 06:40:33 PM
OMG does this mean external saves are now supported? O.O Also does it set to real vars?
You can now store integers to the real BASIC variables A-theta :)


_iPhoenix_

#353
That's great, but is the progress bar through the "Successfully compiled" a gif glitch?

EDIT: Perhaps add the ability to edit/read BASIC programs or AppVars (i.e. files), token by token.
EX: editFile(*file*, *token number, from start*, *token to change to*)
EX: readFile(*file*, *token number, from start*)
EX: checkFile(*file*, *token number, from start*, *token to check for*
The last one would return 1 if the token indicated in the specified file was the same as the token to check for.

Perhaps make 'token' byte, even, that would be easier to handle, I'd think (but take what I think with a grain of salt)


  • Calculators owned: Two TI-84+ CE's
Please spam here: https://legend-of-iphoenix.github.io/spam/

"walruses are better than tuxedo chickens, all hail the great :walrii:" ~ me
Evolution of my avatar:

PT_

#354
I'm SUUUUUPPEERRRRR excited to announce this very great news:

https://ice.cemetech.net

It redirects you to a page at Cemetech Learn, where I will put all the needed information, and Tips and Tricks! :D

Dream of Omnimaga

Nice :D. Also I'm happy to see real vars supported. Are their content preserved when entering or exiting an ICE program, though (unlike Pic4)? :P
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

PT_

As long as other BASIC programs don't overwrite them ;) I'm working on GetBASICVar( as well, to eventually get the highscore :D

Dream of Omnimaga

Yeah I was mainly wondering, so that using BASIC code, people can do things like this:

{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z->L1
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

_iPhoenix_

I saw that the program you used had the "getBasicVar()" as a token. Is that due to the fact that you are programming it in C?
  • Calculators owned: Two TI-84+ CE's
Please spam here: https://legend-of-iphoenix.github.io/spam/

"walruses are better than tuxedo chickens, all hail the great :walrii:" ~ me
Evolution of my avatar:

PT_

No, that is because ICE didn't had the possibility to interact with BASIC programs, but now you can.

Time for some quick updates about my C version: I've implemented all the operators, and added code for functions, which work fine, I only need to add them :P Chaining things also work, so the only thing I need to do is doing weird stuff with C functions and get that working :)

Powered by EzPortal