Leksik va sintaksis tahlil


this->dataGridView1->Name = L"dataGridView1"



Yüklə 253,22 Kb.
səhifə7/9
tarix10.05.2023
ölçüsü253,22 Kb.
#110396
1   2   3   4   5   6   7   8   9
7-laboratoriya

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();




    1. }

    2. #pragma endregion




    1. int search(char lexeme[])

    2. {

    3. int i;




    1. for ( i = 0; i < NUM_ENTRIES; i++)

    2. {

    3. if (strcmp(lexeme,ref_tab[i].name) == 0)

    4. {

    5. strcpy_s(keyM[key],lexeme);

    6. key++;

    7. return ref_tab[i].token;

    8. }

    9. /* else

    10. {

    11. ident++;

    12. }

    13. */




    1. }

    2. strcpy_s(identM[ident],lexeme);

    3. ident++;

    4. return ID;

    5. }




    1. void output(int num)

    2. {

    3. //printf("\n%d\t%s\t\n",++token_no,out_token[num]);

    4. /* delay(350); */

    5. }




    1. void lexical(char store[], int store_len)

    2. {

    3. int i,j,line=2;

    4. char ch,lexeme[10],next;




    1. for (i = 0; i < store_len;)

    2. {




    1. ch = store[i];

    2. switch(ch)

    3. {

    4. case ' ':

    5. i++;




    1. printf("\tSPACE REMOVED\n");

    2. break;

    3. /* case ' ':

    4. i++;




    1. printf("\tTAB REMOVED\n");

    2. break; */

    3. case '{':

    4. i++;

    5. spM[sp]='{';

    6. sp++;

    7. //output(OB);

    8. break;

    9. case '}':

    10. i++;

    11. spM[sp]='}';

    12. sp++;

    13. //output(CB);

    14. break;

    15. case '(':

    16. i++;

    17. spM[sp]='(';

    18. sp++;

    19. //output(LP);

    20. break;

    21. case ')':

    22. i++;

    23. spM[sp]=')';

    24. sp++;

    25. //output(RP);

    26. break;

    27. case '=':

    28. i++;

    29. spM[sp]='=';

    30. op++;

    31. //output(EQUALTO);

    32. break;

    33. case '<':

    34. i++;

    35. spM[sp]='<';

    36. sp++;

    37. //output(LT);

    38. break;

    39. case '>':

    40. i++;

    41. spM[sp]='>';

    42. sp++;

    43. //output(GT);

    44. break;

    45. case '!':

    46. i++;

    47. spM[sp]='!';

    48. sp++;

    49. //output(NOTEQU);

    50. break;

    51. case '+':

    52. i++;

    53. opM[op][0]='+';

    54. op++;

    55. //output(PLUS);

    56. break;

    57. case '-':

    58. i++;

    59. opM[op][0]='-';

    60. op++;

    61. //output(MINUS);

    62. break;

    63. case '*':

    64. i++;

    65. opM[op][0]='*';

    66. op++;

    67. //output(MUL);

    68. break;




    1. case '/':

    2. i++;

    3. opM[op][0]='/';

    4. op++;

    5. next=store[i];

    6. if(next=='*')

    7. {

    8. i++;

    9. while(store[i]!='*')i++;

    10. i++;

    11. if(store[i]=='/')

    12. // else goto

    13. printf("\n\tComments removed\n");

    14. i++;

    15. }

    16. else if(next=='/')

    17. {

    18. i++;

    19. while(store[i]!='\n')i++;

    20. i++;

    21. printf("\n\tComments removed\n");

    22. }


    1. else{

    2. opM[op][0]='"\"';

    3. op++;

    4. }

    5. //output(DIV);

    6. break;





    1. Yüklə 253,22 Kb.

      Dostları ilə paylaş:
  • 1   2   3   4   5   6   7   8   9




    Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
    rəhbərliyinə müraciət

    gir | qeydiyyatdan keç
        Ana səhifə


    yükləyin