O’zbekiston
Download 3.06 Mb.
|
BOZOROV OG’ABEK labaratoriya7
getchar();
return 0; 103. } Dastur natijasi: Daturning to’liq matni:
#define WHILE 11 #define IF 12 #define ELSE 13 #define CONTINUE 14 #define BREAK 15 #define DEFAULT 16 #define CASE 17 #define GOTO 18 #define SWITCH 19 #define OB 20 #define CB 21 #define LP 22 #define RP 23 #define EQUALTO 24 #define LT 25 #define GT 26 #define PLUS 27 #define MINUS 28 #define MUL 29 #define DIV 30 #define COLON 31 #define SCOLON 32 #define TERNARY 33 #define COMMA 34 #define PLINE 35 #define CARAT 36 #define DIGIT 37 #define ID 38 #define OSB 39 #define CSB 40 #define HSH 41 #define PER 42 #define MAIN 43 #define VOID 44 #define NOTEQU 45 #define AND 46 #define BSH 47 #define DQ 48 #define SQ 49 #define DOT 50 #define INCLUDE 51 #define SPACE 52 #define TAB 53 #define NUM_ENTRIES 54 int token_no=0,key=0,ident=0,sp=0,op=0,digit=0; char keyM[100][100],identM[100][100],spM[10000],opM[100][100],digitM[1000]; using namespace std; struct table 65) { char name[25]; int token; 68) }; struct table ref_tab[NUM_ENTRIES] = { {"int", INT}, {"char", CHAR}, {"float", FLOAT}, {"long", LONG}, {"double", DOUBLE}, {"struct", STRUCT}, {"printf", PRINTF}, 77) {"do", DO}, 78) {"while", WHILE}, 79) {"if", IF}, {"else", ELSE}, {"continue", CONTINUE}, {"break", BREAK}, {"default", DEFAULT}, {"case", CASE}, {"goto", GOTO}, {"switch", SWITCH}, 87) {"{", OB}, 88) {"}", CB}, 89) {"(", LP}, 90) {")", RP}, 91) {"=", EQUALTO}, 92) {"<", LT}, 93) {">", GT}, 94) {"+", PLUS}, 95) {"-", MINUS}, 96) {"*", MUL}, 97) {"/", DIV}, 98) {":", COLON}, 99) {";", SCOLON}, 100) {"?", TERNARY}, 101) {",", COMMA}, 102) {"|", PLINE}, 103) {"^", CARAT}, 104) {"[", OSB}, 105) {"]", CSB}, 106) {"#", HSH}, 107) {"%", PER}, {"main", MAIN}, {"void", VOID}, 110) {"!=", NOTEQU}, 111) {"&", AND}, 112) {"\\",BSH}, 113) {"\"",DQ}, 114) {"'", SQ}, 115) {"include",INCLUDE}, 116) }; 117) char out_token[NUM_ENTRIES+1][40]= 118) { 119) " ", "INT", "CHAR", "FLOAT", "LONG", "DOUBLE", "STRUCT", "PRINTF", "SCANF", "FOR", 129) "DO", 130) "WHILE", 131) "IF", "ELSE", "CONTINUE", "BREAK", "DEFAULT", "CASE", "GOTO", "SWITCH", 139) "{", 140) "}", 141) "(", 142) ")", 143) "=", 144) "<", 145) ">", 146) "+", 147) "-", 148) "*", 149) "/", 150) ":", 151) ";", 152) "?", 153) ",", 154) "|", 155) "^", 156) "DIGIT", 157) "ID", 158) "[", 159) "]", 160) "#", 161) "%", "MAIN", "VOID", 164) "!=", 165) "&", 166) "\\", 167) "\"", 168) "'", 169) ".", 170) "INCLUDE" 171) }; namespace Leksik_analizator { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// /// Summary for Form1 /// public ref class Form1 : public System::Windows::Forms::Form 183) { public: Form1(void) 186) { 187) InitializeComponent(); 188) // 189) //TODO: Add the constructor code here 190) // 191) } protected: /// /// Clean up any resources being used. /// ~Form1() 197) { 198) if (components) 199) {200) delete components; 201) } 202) } private: System::Windows::Forms::DataGridView^ dataGridView1; protected: private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column1; private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column2; private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column3; private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column4; private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column5; private: System::Windows::Forms::Button^ button1; private: System::Windows::Forms::TextBox^ textBox1; private: System::Windows::Forms::Label^ label1; private: System::Windows::Forms::Label^ label2; private: System::Windows::Forms::Label^ label3; private: System::Windows::Forms::Label^ label4; private: System::Windows::Forms::Label^ label5; private: /// /// Required designer variable. /// System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// void InitializeComponent(void) 228) { this->dataGridView1 = (gcnew System::Windows::Forms::DataGridView()); this->Column1 = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn()); this->Column2 = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn()); this->Column3 = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn()); this->Column4 = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn()); this->Column5 = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn()); this->button1 = (gcnew System::Windows::Forms::Button()); this->textBox1 = (gcnew System::Windows::Forms::TextBox()); this->label1 = (gcnew System::Windows::Forms::Label()); this->label2 = (gcnew System::Windows::Forms::Label()); this->label3 = (gcnew System::Windows::Forms::Label()); this->label4 = (gcnew System::Windows::Forms::Label()); this->label5 = (gcnew System::Windows::Forms::Label()); (cli::safe_cast >dataGridView1))->BeginInit(); this->SuspendLayout(); 244) // 245) // dataGridView1 246) // this->dataGridView1->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode:: AutoSize; this->dataGridView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(5) {this->Column1, this->Column2, this->Column3, this->Column4, this->Column5}); this->dataGridView1->Location = System::Drawing::Point(12, 54); this->dataGridView1->Name = L"dataGridView1"; this->dataGridView1->Size = System::Drawing::Size(543, 422); this->dataGridView1->TabIndex = 0; 254) // 255) // Column1 256) // this->Column1->HeaderText = L"Identifikatorlar"; this->Column1->Name = L"Column1"; 259) // 260) // Column2 261) // this->Column2->HeaderText = L"Maxsus operatorlar"; this->Column2->Name = L"Column2"; 264) // 265) // Column3 266) // this->Column3->HeaderText = L"kalit sozlar"; this->Column3->Name = L"Column3"; 269) // 270) // Column4 271) // this->Column4->HeaderText = L"Operatorlar"; this->Column4->Name = L"Column4"; 274) // 275) // Column5 276) // this->Column5->HeaderText = L"Raqamlar"; this->Column5->Name = L"Column5"; 279) // 280) // button1 281) // this->button1->Location = System::Drawing::Point(153, 482); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(222, 35); Download 3.06 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling