Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Requests and Feedback

ZirToken

A community discussion post from the original code:zIRON forum.

Replies

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt
i guess i could add a function to return the declared variable type string value.

i think it is good idea so , if the var type is string and found something like that

char var[1024];
H_strcpy(var,'geust');
Let  myvar = 'welcome' + var + 'here ..' 

and if it is digital so ziron will handle it.

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria

i have re-updated the package, i've added 2 new pf functions

Ziron_GetID - this function can be called when the current token type is a variable.

and

Ziron_GetVarTypeString - pass the id to this function and it will return the string value of the data's type.

let me know...

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

can i use something like this

 Ziron_ExpectNextToken(zironVar or zironLocalVar);

http://www.freewebs.com/ogremagic/index.htm

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt
      eax = Ziron_GetID();
      ecx = Ziron_GetVarTypeString(eax); 
      Ziron_ShowMessage(ecx);    

very nice , now we need something like 'strcmp in C' to compare the returned value from Ziron_GetVarTypeString against variables such as int32 char ....etc

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria

no, but i plan to add something to accept more types at a later time, for now you can just do:

eax = Ziron_GetNextToken();
case (eax) {
   state zirVar:
   state zirLocalVar:
   state zirLocalParam:
      break;
   default:
      FatalError('Unexpected token ....
      return true;
}
//since it did not return we know it had to be one of the 3 :)

//rest of code here.
Colin admin
Posts
928
Threads
49
Location
Bulgaria
now we need something like 'strcmp in C' to compare the returned value from Ziron_GetVarTypeString against variables such as int32 char ....etc

good idea, i will get with that :)

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

can i check variable type only by Ziron_GetID ?

http://www.freewebs.com/ogremagic/index.htm

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

i mean something like enum , so we can check returned value of Ziron_GetID against enum.

http://www.freewebs.com/ogremagic/index.htm