📄 unit1.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#ifndef DEBUG_PRINT_TOKEN
#define DEBUG_PRINT_TOKEN
#endif/*DEBUG_PRINT_TOKEN*/
#include "calc_flex.c"
#include "calc_yacc.c"
//---------------------------------------------------------------------------
long g_LabCount = 0;
void zzlabel(char *s)
{
sprintf(s, "%04d", g_LabCount ++);
}
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
FILE *asout = NULL;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
this->Memo1->Lines->SaveToFile("temp_i.txt");
yyin = fopen("temp_i.txt", "r+");
yyout = fopen("temp_o.txt", "w+");
asout = fopen("uasm_o.txt", "w+");
//while(yylex());
yyparse();
fclose(yyin);
fclose(yyout);
fclose(asout);
this->Memo2->Clear();
this->Memo2->Lines->LoadFromFile("temp_o.txt");
this->Memo3->Clear();
this->Memo3->Lines->LoadFromFile("uasm_o.txt");
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -