搜档网
当前位置:搜档网 › 编译原理源代码 target=_blank

编译原理源代码 target=_blank

编译原理源代码
――扫描器


import com.ms.wfc.app.*;
import com.ms.wfc.core.*;
import com.ms.wfc.ui.*;
import com.ms.wfc.html.*;

/**
* This class can take a variable number of parameters on the command
* line. Program execution begins with the main() method. The class
* constructor is not invoked unless an object of type 'Form1' is
* created in the main() method.
*/
public class Form1 extends Form
{
public Form1()
{
// Required for Visual J++ Form Designer support
initForm();

// TODO: Add any constructor code after initForm call
}

/**
* Form1 overrides dispose so it can clean up the
* component list.
*/
public void dispose()
{
super.dispose();
components.dispose();
}

private void Form1_click(Object source, Event e)
{

}
/**
* NOTE: The following code is required by the Visual J++ form
* designer. It can be modified using the form editor. Do not
* modify it using the code editor.
*/
Container components = new Container();
Button button1 = new Button();
Button button2 = new Button();
Label prompt1=new Label();
Label prompt2=new Label();
Edit edit1=new Edit();
Edit edit2=new Edit();
private void button1_cilck(Object v,Event e)
{
int i,j,k=0,m,m1;
char c,d;
char b[]=new char[10000];
String s=new String();
String s1=new String();
String s2=new String();
s2=" ss";
d=s2.charAt(0);
s=edit1.getText();
j=s.length();
for(i=0 ;i{
c=s.charAt(i);
if((c!=d)&&(i==0)&&(('A'>c)||('z'{
b[k]=c;
k++;
for(m=k;m{
b[m]='\t';
}
k=m;
}
if(('A'c))
{
b[k]=c;
k++;
}
else if(i!=0)
{
for(m=k;m{
b[m]='\t';
}
if(c!=d)
{
b[m]=c;
m++;
m1=m;
for(m=m1;m{
b[m]='\t';
}
k=m;
}
else
k=m;
}
}
s1=new String(b);
//s2="sssss\t\t\t\tsssss";
edit2.setText(s1);
}
private void button2_cilck(Object v,Event e)
{
edit2.setText("");
}
private void initForm()
{
this.setBackColor(Color.BROWN);
this.setText("扫描器");
this.setAutoScaleBaseSize(new Point(6, 12));
this.setClientSize(new Point(492, 366));
this.addOnClick(new EventHandler(this.Form1_click));
button1.setLocation(new Point(64, 320));
button1.setSize(new Point(80, 30));
button1.setText("扫描");
button1.addOnClick(new EventHandler(this.button1_cilck));
button2.setLocation(new Point(300, 320));
button2.setSize(new Point(90, 30));
button2.setText("清空扫描结果");
button2.addOnClick(new EventHandler(this.button2_cilck));
prompt1.setLocation(new Point(60, 20));
prompt1.setSize(new Point(100, 20));
prompt1.setText("请输入C语言程序");
prompt2.setLocation(new Point

(320, 20));
prompt2.setSize(new Point(100, 20));
prompt2.setText("扫描结果是");
edit1.setLocation(new Point(10, 40));
edit1.setSize(new Point(200, 260));
edit1.setMultiline(true);
edit1.setScrollBars(ScrollBars.VERTICAL);
edit1.setBorderStyle(BorderStyle.FIXED_3D);
edit2.setLocation(new Point(250, 40));
edit2.setSize(new Point(200, 260));
edit2.setMultiline(true);
edit2.setScrollBars(ScrollBars.VERTICAL);
edit2.setBorderStyle(BorderStyle.FIXED_3D);
edit2.setReadOnly(true);
this.setNewControls(new Control[] {button1,button2,prompt1,prompt2,edit1,edit2});
}

/**
* The main entry point for the application.
*
* @param args Array of parameters passed to the application
* via the command line.
*/
public static void main(String args[])
{
Application.run(new Form1());
}
}


小组成员:周徐,孙瑜,华鸿川,杨杰,田旭
周徐: 20019045
孙瑜: 20019055
华鸿川:20019114
杨杰: 20019109
田旭: 20019119
小组成员:周徐,孙瑜,华鸿川,杨杰,田旭

小组成员:周徐,孙瑜,华鸿川,杨杰,田旭



相关主题