Changeset 372 in dev for trunk/abdev/BasicCompiler_Common


Ignore:
Timestamp:
Nov 23, 2007, 1:44:13 PM (17 years ago)
Author:
dai_9181
Message:

Foreachステートメントを実装中…

Location:
trunk/abdev/BasicCompiler_Common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/Compile.cpp

    r359 r372  
    139139}
    140140
     141void Compile( const char *source )
     142{
     143    char *temporary = (char *)malloc( lstrlen( source ) + 8192 );
     144    lstrcpy( temporary, source );
     145    int backCp = cp;
     146    MakeMiddleCode( temporary );
     147    ChangeOpcode( temporary );
     148    cp = backCp;
     149    free( temporary );
     150}
     151
    141152void ChangeOpcode(char *Command){
    142153    extern HANDLE hHeap;
     
    337348        case COM_FOR:
    338349            OpcodeFor(Command+2);
     350            break;
     351        case COM_FOREACH:
     352            OpcodeForeach(Command+2);
    339353            break;
    340354        case COM_DO:
  • trunk/abdev/BasicCompiler_Common/Intermediate_Step2.cpp

    r361 r372  
    451451        ComNum=COM_FOR;
    452452    }
     453    else if(lstrcmpi(com,"Foreach")==0){
     454        KillSpaces(Command+i,pam);
     455        ComNum=COM_FOREACH;
     456    }
    453457    else if(lstrcmpi(com,"Next")==0){
    454458        KillSpaces(Command+i,pam);
Note: See TracChangeset for help on using the changeset viewer.