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;
//
// Column1
//
this->Column1->HeaderText = L"Identifikatorlar";
this->Column1->Name = L"Column1";
//
// Column2
//
this->Column2->HeaderText = L"Maxsus operatorlar";
this->Column2->Name = L"Column2";
//
// Column3
//
this->Column3->HeaderText = L"kalit sozlar";
this->Column3->Name = L"Column3";
//
// Column4
//
this->Column4->HeaderText = L"Operatorlar";
this->Column4->Name = L"Column4";
//
// Column5
//
this->Column5->HeaderText = L"Raqamlar";
this->Column5->Name = L"Column5";
//
// button1
//
this->button1->Location = System::Drawing::Point(153, 482);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(222, 35);
this->button1->TabIndex = 1;
this->button1->Text = L"Hisoblash";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// textBox1
//
this->textBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 18.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->textBox1->ForeColor = System::Drawing::SystemColors::MenuText;
this->textBox1->Location = System::Drawing::Point(12, 12);
this->textBox1->Multiline = true;
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(543, 36);
this->textBox1->TabIndex = 2;
this->textBox1->Text = L"Ichma_ich.cpp";
this->textBox1->Click += gcnew System::EventHandler(this, &Form1::textBox1_Click);
this->textBox1->TextChanged += gcnew System::EventHandler(this, &Form1::textBox1_TextChanged);
//
// label1
//
this->label1->AutoSize = true;
this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 18.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label1->Location = System::Drawing::Point(607, 41);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(81, 29);
this->label1->TabIndex = 3;
this->label1->Text = L"label1";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 18.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label2->Location = System::Drawing::Point(607, 92);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(81, 29);
this->label2->TabIndex = 3;
this->label2->Text = L"label2";
//
// label3
//
this->label3->AutoSize = true;
this->label3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 18.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label3->Location = System::Drawing::Point(607, 143);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(81, 29);
this->label3->TabIndex = 3;
this->label3->Text = L"label3";
//
// label4
//
this->label4->AutoSize = true;
this->label4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 18.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label4->Location = System::Drawing::Point(607, 197);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(81, 29);
this->label4->TabIndex = 3;
this->label4->Text = L"label4";
//
// label5
//
this->label5->AutoSize = true;
this->label5->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 18.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label5->Location = System::Drawing::Point(607, 254);
this->label5->Name = L"label5";
this->label5->Size = System::Drawing::Size(81, 29);
this->label5->TabIndex = 3;
this->label5->Text = L"label5";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(1027, 529);
this->Controls->Add(this->label5);
this->Controls->Add(this->label4);
this->Controls->Add(this->label3);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->button1);
this->Controls->Add(this->dataGridView1);
this->Name = L"Form1";
this->Text = L"Leksik va sintaktik tahlil dasturi";
(cli::safe_cast(this->dataGridView1))->EndInit();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
int search(char lexeme[])
{
int i;
for ( i = 0; i < NUM_ENTRIES; i++)
{
if (strcmp(lexeme,ref_tab[i].name) == 0)
{
strcpy_s(keyM[key],lexeme);
key++;
return ref_tab[i].token;
}
/* else
{
ident++;
}
*/
}
strcpy_s(identM[ident],lexeme);
ident++;
return ID;
}
void output(int num)
{
//printf("\n%d\t%s\t\n",++token_no,out_token[num]);
/* delay(350); */
}
void lexical(char store[], int store_len)
{
int i,j,line=2;
char ch,lexeme[10],next;
for (i = 0; i < store_len;)
{
ch = store[i];
switch(ch)
{
case ' ':
i++;
printf("\tSPACE REMOVED\n");
break;
/* case ' ':
i++;
printf("\tTAB REMOVED\n");
break; */
case '{':
i++;
spM[sp]='{';
sp++;
//output(OB);
break;
case '}':
i++;
spM[sp]='}';
sp++;
//output(CB);
break;
case '(':
i++;
spM[sp]='(';
sp++;
//output(LP);
break;
case ')':
i++;
spM[sp]=')';
sp++;
//output(RP);
break;
case '=':
i++;
spM[sp]='=';
op++;
//output(EQUALTO);
break;
case '<':
i++;
spM[sp]='<';
sp++;
//output(LT);
break;
case '>':
i++;
spM[sp]='>';
sp++;
//output(GT);
break;
case '!':
i++;
spM[sp]='!';
sp++;
//output(NOTEQU);
break;
case '+':
i++;
opM[op][0]='+';
op++;
//output(PLUS);
break;
case '-':
i++;
opM[op][0]='-';
op++;
//output(MINUS);
break;
case '*':
i++;
opM[op][0]='*';
op++;
//output(MUL);
break;
case '/':
i++;
opM[op][0]='/';
op++;
next=store[i];
if(next=='*')
{
i++;
while(store[i]!='*')i++;
i++;
if(store[i]=='/')
// else goto
printf("\n\tComments removed\n");
i++;
}
else if(next=='/')
{
i++;
while(store[i]!='\n')i++;
i++;
printf("\n\tComments removed\n");
}
else{
Do'stlaringiz bilan baham: |