Sunday, April 27, 2014

how to combine lexer and parser into project ? c# extension project. sample of codes included.

#include <stdlib.h>

#include <iostream>

#include <string>



using namespace std;

int main()

{

int j = 0;

for (int i = 1; i < 20; i++)

{

int s = i;

if (s < 10)

{

cout << "0" << s << ":";

}

else

{

cout << s << ":";

}

while (i <= 10){

for (j = 1; j <= 20 - i; j++)

{

cout << " ";

}

for (j = 1; j <= 2 * i - 1; j++)

{

if (j % 2 == 0)

{

cout << "-";

}

else

{

cout << "*";

}

}

break;

}

while (i > 10){

for (j = 20 - i; j < 20; j++)

{

cout << " ";

}

for (j = 1; j <= ((20 - i) * 2) - 1; j++)

{

if (j % 2 == 0)

{

cout << "-";

}

else

{

cout << "*";

}

}

break;

}

cout << endl;

}

string test = "Diamond Has Been Printed";


string tester = "i am testing this project..."


cout << endl << test << tester;

cin.get();

return 0;

}


No comments:

Post a Comment