#include "stdafx.h" #include #include #include "common.h" void StepCompileProgress(void){ extern HWND hMainDlg; PostMessage(GetDlgItem(hMainDlg,IDC_PROGRESS),PBM_STEPIT,0,0); } void AddSourceCode(char *buffer){ char *temp; temp=(char *)HeapAlloc(hHeap,0,lstrlen(buffer)+8192); lstrcpy(temp,buffer); //エスケープシーケンス設定 SetEscapeSequenceFormat(temp); //コマンド対応 ChangeCommandToCode(temp); //最後尾に貼り付け compiler.GetObjectModule().GetCurrentSource().Addition( temp ); HeapDefaultFree(temp); } void OutputExe(void){ extern HANDLE hHeap; extern char *basbuf; extern int ErrorNum; extern BOOL bStopCompile; extern HWND hMainDlg; int i3; char temp2[MAX_PATH]; // 開始時刻を記録 DWORD beforeTickCount = GetTickCount(); //プログレスバーの設定 PostMessage(GetDlgItem(hMainDlg,IDC_PROGRESS),PBM_SETRANGE,0,MAKELPARAM(0,6)); PostMessage(GetDlgItem(hMainDlg,IDC_PROGRESS),PBM_SETSTEP,1,0); //"中断" SetDlgItemText(hMainDlg,IDOK,STRING_STOP); //中断フラグを初期化 bStopCompile=0; //サブシステムのタイプ extern unsigned short TypeOfSubSystem; TypeOfSubSystem=IMAGE_SUBSYSTEM_WINDOWS_GUI; //プログラムをファイルから読み込む extern char SourceFileName[MAX_PATH]; compiler.GetObjectModule().SetCurrentSourceIndex( compiler.GetObjectModule().GetSources().size() ); compiler.GetObjectModule().GetSources().push_back( BasicSource() ); if( !compiler.GetObjectModule().GetCurrentSource().ReadFile( SourceFileName ) ){ SetError(201,SourceFileName,-1); goto EndCompile; } //イメージベースの設定 extern DWORD ImageBase; if(compiler.IsDll()) ImageBase=0x10000000; else ImageBase=0x00400000; extern BOOL bError; if(bError||bStopCompile) goto EndCompile; ////////////////////////// // 中間コードの生成を開始 extern BOOL bClipCompileView; //"最適化中..." CompileMessage(STRING_COMPILE_OPTIMIZING); //カッコを相互チェック(ダブルクォートチェックチェックを含む) CheckParenthesis(basbuf); if(bError||bStopCompile) goto EndCompile; //コンパイルダイアログのプログレスバーを上げる StepCompileProgress(); //ディレクティブ DirectiveCheck(); //Next命令語を正規表現に変換 //NextCommandFormat(basbuf); //エスケープシーケンス設定 SetEscapeSequenceFormat(basbuf); //Def命令語をFunction命令語に変換 DefCommandFormat(basbuf); //すべてのIf命令語をブロック形式に変換 IfCommandFormat(basbuf); //対になる命令語を相互チェック //CheckPareCommand(); if(bError||bStopCompile) goto EndCompile; //コンパイルダイアログのプログレスバーを上げる StepCompileProgress(); //重複エラー情報管理のメモリを確保 extern char **SynonymErrorWords; extern int SynonymErrorNum; SynonymErrorNum=0; SynonymErrorWords=(char **)HeapAlloc(hHeap,0,1); ChangeCommandToCode(basbuf); //重複エラー情報管理のメモリを解放 for(i3=0;i3