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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

% is zirModSym

! is zirIdent

is zirHash

i forgot to update the framework file also, if you find zirModSym and below place this line

zirDollarSym = 68, // $

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

ok i will test that , thanks.

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

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

one more thing

i am using this to pares Dim

   eax = Ziron_GetNextToken(); 
	
	case (eax) 
	 {
/*********   Dim Var as int32;    **************/      	 
	   state zirAs:
                   .......
                   .......
                 break;
 
/*********   dim k%;    **************/        
          state zirModSym:
                   .......
                   .......
                 break;

          state zirModSym:
/*********   dim k$;    **************/  

snd so on......

so how can i pares a non Token value for example !

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

how do you mean a none token value? if you mean something that is not inside your case select then you can use default

case ...

default:
	Fatal_Error('Unexpected token');
	return true;
}
Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

on , i ment something is not in enum ZirToken such as '!'

also BTW this didnot compile

if(Ziron_IsNextLineBreak())
	 {
	    break;      // check end of line so we end without semicolon
	 } 

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria

Ziron does not support function calls inside of block statements (for now)

eax = Ziron_IsNextLineBreak();
if(eax)
   {
      break;      // check end of line so we end without semicolon
   } 

as for something that is not in zirTokens, you can check from zirIdent

state zirIdent:
	eax = Ziron_GetStringValue();
	eax = myCustomIdentFunc(eax);

	if (eax == ci_Etc) ....

however i will add ! as a value token for update.

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

very good and thank you.

i hope to semulate basic Dim keyWord 100%

so this code work prefectly

program WIN32CUI 'Basic Syntax test';

#include 'console.zir';

function  H_strcpy(Dword dst,src)
{ 
  Eax = dst; 
  Edx = src; 
  push Eax;
  BL =  [Edx]; 
  while ( BL != 0)  
   { 
      [Eax] = BL; 
      Eax++; Edx++; 
      BL =  [Edx]; 
   }  
  [Eax] = 0;
  pop Eax;
} 

eax = 1;
print('eax = ', eax:int, '\r\n');

Dim Var as int32  // not well , in basic there is no semicolon at end of file

DIM Name$;

DIM a AS int32, b AS Dword, c AS char;

dim k%;

Var = 1000;
a = -10;
b = 150;
c = ord('A');
k = -2000;

H_strcpy(@Name , 'Emil');

print('Var = ', Var, '\r\n');
print('a = ', a, '\r\n');
print('b = ', b, '\r\n');
print('c = ');
WriteLnEx(@c,1);
print('k = ', k, '\r\n');
WriteLnEx(@Name,4);

wait_key(nil);
ExitProcess(0);

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

Colin admin
Posts
928
Threads
49
Location
Bulgaria
Dim Var as int32  // not well , in basic there is no semicolon at end of file

you do not need to check for a semi colon which means this would be valid