µ±Ç°Î»ÖãºÊ×Ò³ > ´Ê·¨·ÖÎöÆ÷Éè¼ÆÊµÑ鱨¸æ
Áù¡¢ÊµÑé´úÂ루C#£©
using System;
using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;
using System.Threading.Tasks; using System.Windows.Forms;
namespace ´Ê·¨·ÖÎöÆ÷
{ /*µ¥´Ê·ûºÅ ÖÖ±ðÂë µ¥´Ê·ûºÅ ÖÖ±ðÂë * if 1 ±êʶ·û 40 * else 2 ³£Á¿ 41 * then 3 * 42
* while 4 / 43 * do 5 + 44 * begin 6 - 45 * end 7 > 46 * printf 8 < 47 * main 9 <> 48 * scanf 10 <= 49 * return 11 >= 50 * = 51 * ; * ( * ) * { * } * ++ * -- * ³ö´í·û * # * */
public partial class Form1 : Form {
/*
*³ÉÔ±±äÁ¿ */
String text = \
Char[] text_is;//ÊäÈëÁ÷
int type_code=10;//µ¥´ÊÖÖ±ðÂë int number;//ÕûÐγ£Á¿ int line=1;//ÐкŠint column = 1;//ÁкŠchar ch; int p = 0; String []keyword=new String[]{\\\ public Form1() {
InitializeComponent(); } /*
* ¶ÔÊäÈëÁ÷½øÐвÙ×÷ */
private void readIo() {
52 53 54 55 56 57 58 -1 0 \\
text = \ try {
ch = text_is[p++]; }
catch (Exception) { ; }
/*Ô¤´¦Àí*/ while (ch == ' ') {
ch = text_is[p]; p++; }
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) //±êʶ·û»ò±äÁ¿Ãû¼ì²â {
while ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
{
text = text + ch; ch = text_is[p++]; } p--;
type_code = 40;
for (int i = 0; i< keyword.Length; i++) //±£Áô×Ö¼ì²â if (text==keyword[i]) {
type_code = i + 1; break; } }
else if ((ch >= '0' && ch <= '9')) //Êý×Ö¼ì²â {
if ((text_is[p] >= 'a' && text_is[p] <= 'z') || (text_is[p] >= 'A' && text_is[p] <= 'Z'))
{
while (ch!=' '&&ch!=';'&&ch!='#') {
text = text + ch;
¹²·ÖÏí92ƪÏà¹ØÎĵµ