Changeset 348 for cpp/frams/vm
- Timestamp:
- 04/09/15 23:51:28 (10 years ago)
- Location:
- cpp/frams/vm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/vm/framscript.l
r335 r348 115 115 int len=src.len(); 116 116 SString ret((len*11)/10+10); 117 const char*t= (const char*)src;117 const char*t=src.c_str(); 118 118 while(len>0) 119 119 { -
cpp/frams/vm/framscript.y
r345 r348 467 467 {trctx.err->printf("%s can't be iterated\n",str($4)); return 1;} 468 468 if ($4.objname) 469 trctx.out->printf("move %s.iterator,m[--m0]\n", (const char*)$4.getString());469 trctx.out->printf("move %s.iterator,m[--m0]\n",$4.getString().c_str()); 470 470 else 471 471 trctx.out->printf("move s%d,m1\nmove [m1].\"iterator\",m[--m0]\n",0); … … 662 662 663 663 | OBJNAME ':' IDENT {$$.constant=0; $$.ident=0; 664 trctx.out->printf("push %s:%s\n", (const char*)$1.getString(),665 (const char*)$3.getString());664 trctx.out->printf("push %s:%s\n",$1.getString().c_str(), 665 $3.getString().c_str()); 666 666 trstack.adjust(-1); 667 667 } … … 688 688 trstack.adjust(-1);} 689 689 else if (globalOk($1)) 690 { trctx.out->printf("push @%s\n%s @%s\n", (const char*)$1.getString(),691 $2.getInt()?"inc":"dec", (const char*)$1.getString());690 { trctx.out->printf("push @%s\n%s @%s\n",$1.getString().c_str(), 691 $2.getInt()?"inc":"dec",$1.getString().c_str()); 692 692 trstack.adjust(-1);} 693 693 else {badVariable($$,$1); return 1;} … … 697 697 if (!handleAssignOp($$,$1,$3,assign_op_names[$2.getInt()])) 698 698 if (globalOk($1)) {SString t="@"; t+=$1.getString(); 699 handleAssignOp2($$, (const char*)t,$3,assign_op_names[$2.getInt()],0,1);}699 handleAssignOp2($$,t.c_str(),$3,assign_op_names[$2.getInt()],0,1);} 700 700 else { badVariable($$,$1); return 1; } 701 701 } … … 895 895 if ($3.constant) 896 896 { 897 handleAssignOp2($$, (const char*)t,$5,assign_op_names[$4.getInt()],0,1);897 handleAssignOp2($$,t.c_str(),$5,assign_op_names[$4.getInt()],0,1); 898 898 } 899 899 else … … 902 902 t=$1.getString();t+=".[m1]"; 903 903 trctx.out->printf("move s0,m1\n",str($1)); 904 handleAssignOp2($$, (const char*)t,$5,assign_op_names[$4.getInt()],sp,0);904 handleAssignOp2($$,t.c_str(),$5,assign_op_names[$4.getInt()],sp,0); 905 905 if (sp) {trctx.out->printf("inc m0\n"); trstack.adjust(1);} 906 906 } … … 1008 1008 | FUNCTION IDENT 1009 1009 { trctx.emitLine(); $$.constant=0; $$.ident=0; SString t=":"; t+=$1.getString(); $$.setString(t); 1010 trctx.out->printf("push :%s\n", (const char*)$2.getString());1010 trctx.out->printf("push :%s\n",$2.getString().c_str()); 1011 1011 trstack.adjust(-1); 1012 1012 } … … 1053 1053 {sp=1; trctx.out->printf("move s1,m1\n");} 1054 1054 t="[m1]."; t+=str($3); 1055 handleAssignOp2($$, (const char*)t,$5,assign_op_names[$4.getInt()],sp,0);1055 handleAssignOp2($$,t.c_str(),$5,assign_op_names[$4.getInt()],sp,0); 1056 1056 if (sp) {trctx.out->printf("inc m0\n");trstack.adjust(1);} 1057 1057 } … … 1295 1295 SString ret((len*11)/10+10); 1296 1296 ret+='\"'; 1297 const char*t= (const char*)s;1297 const char*t=s.c_str(); 1298 1298 while(len>0) 1299 1299 { … … 1464 1464 SymTabEntry* found=trstack.globals.find(var.getString()); 1465 1465 if (found) return true; 1466 return framscriptIsGlobalName(var.getString() );1466 return framscriptIsGlobalName(var.getString().c_str()); 1467 1467 } 1468 1468 … … 1539 1539 else if (globalOk(var)) 1540 1540 { 1541 trctx.out->printf("push @%s\n", (const char*)var.getString());1541 trctx.out->printf("push @%s\n",var.getString().c_str()); 1542 1542 trstack.adjust(-1); 1543 1543 return true;
Note: See TracChangeset
for help on using the changeset viewer.