Register | Login
Forum Index > Requests and Feedback > ZirToken
Author Message
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[570] - posted: 2011-11-10 16:51:42

sorry , does Ziron detect thsose symbols & && || |

i got that error

[325,30]: Unknown Identifier "71" in [basic.zir]
Code:
taAndSym:

Code:
eax = Ziron_GetNextToken(); 
              case (eax) {
                    taAndSym:
                    state zirComma:
                        Ziron_GetNextToken(); 
                        H_strcpy(@str1,Ziron_GetStringValue());   
                        H_strjoin(@buf, ' H_strcat(@' , @var, ', \'' , @str1, '\');' );
                        break;
                    // remove ';' if found     
                    state zirSemi_Colon:
                        //Ziron_ShowMessage('found ;'); 
                        break; 
                   /*
                    state zirFunction:   
                        Ziron_ShowMessage('found func'); 
                        break;  
                   */
                    default:
                        Ziron_FatalError('Expected "+" or "&" or ";"');
                        return true;       
                }


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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[571] - posted: 2011-11-10 17:07:53
& = zirAndSym
&& = taDoubleAndSym
| = taPipe
|| = taDoublePipe

i see your error - i sugest you check your code more often before posting it....

Code:
case (eax) {
                    taAndSym:
                    state zirComma:


you are missing state... your out outputing the value of taAndSym - btw i've fixed this and changed them to zirAndSym. I sugest you change the framework file and replace ta to zir, ta is old test prefix.

ps:
Code:
           case (eax) {
                    state zirAndSym:
                    state zirComma:


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[572] - posted: 2011-11-10 20:48:17

ok , now it works good.

1- Ziron_RegisterUFunction & Ziron_CallUFunc , how can i make use of them.

2- is there a way to detect a function call in let expression , something like this
Code:
function dummy()
{
  global char d = ' there';  
  Eax=@d;
}


Let Name = 'hello ' , dummy()



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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[573] - posted: 2011-11-10 21:00:20
detecting a function call is

Code:
zironProc


not zirFunction... zirFunction is the keyword 'function'

as for UFunc yes you can use them.

Code:
  const sc_code = '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; }'; 
    Ziron_Execute(@sc_code,H_strlen(@sc_code));


instead of this...

first you will need to save your function id's global scope, so outside of the function, accessible to the callbacks.

Code:
DWord U_strcpy;


and then in init..

Code:
  const sc_code = '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; }'; 
    Ziron_RegisterUFunction(sc_code);


then in your callbacks instead of executing a function call, you use the CallUFunc functions.

so

Code:
 // here we start getting what after '=' 
          Ziron_GetNextToken(); 
          H_strcpy(@str1,Ziron_GetStringValue());

          eax = Ziron_IsNextLineBreak();
          if (!eax) {
              Ziron_GetNextToken(); // remove ';'
           }         
          buf=0;
          H_strjoin(@buf, 'H_strcpy(@' , @var, ', \'' , @str1, '\');' );


this would be something like....

Code:
          // here we start getting what after '=' 
          Ziron_GetNextToken(); 
          H_strcpy(@str1,Ziron_GetStringValue());

          eax = Ziron_IsNextLineBreak();
          if (!eax) {
              Ziron_GetNextToken(); // remove ';'
           }         
          buf=0;
          H_strjoin(@buf, '(', @var, ',', @str1, ')'); //build param string "(par1, par2)"
          Ziron_CallUFunc(U_strcpy, @buf);


Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[574] - posted: 2011-11-10 21:21:08

ok ,i got it now, have a question to make things clear for me

in my code
Code:
 const sc_code = '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; }'; 
    Ziron_Execute(@sc_code,H_strlen(@sc_code));


at execution time it is exist with code, the function H_strcpy is part of code , so when
you type this
Code:
 H_strjoin(@buf, 'H_strcpy(@' , @var, ', \'' , @str1, '\');' );


you just type code that will use the H_strcpy at run time.

does Ziron_RegisterUFunction & Ziron_CallUFunc work the same way ?

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

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[575] - posted: 2011-11-10 21:28:22
yes it is the same except it is nameless so it does not interfere with users code... so if they have a h_strcpy it won't affect it...

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[576] - posted: 2011-11-10 21:29:28

zironProc does not make any difference , ziron does not detect function call .


http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[577] - posted: 2011-11-10 21:30:42

it does not interfere with users code.


very good , you are so smart.

http://www.freewebs.com/ogremagic/index.htm
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 1 user(s) online. 0 member(s) and 1 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd