提交 ae8be178 编写于 作者: U u014427391

changes log

上级 19589bd2
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>lexer</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
文件已添加
image/save.png

1013 字节

package com.lexer;
import java.util.ArrayList;
/**
* 封装进行词法分析的方法
* 1~20号为关键字,用下标表示,i+1就是其机器码;21~40号为操作符,用下标表示,i+21就是其机器码;41~60号为分界符,
* 用下标表示,i+41就是其机器码;用户自定义的标识符,其机器码为51;常数的机器码为52;不可以识别的标识符,其机器码为0
*/
public class Analyze {
//关键字
private String keyword[]={"int","long","char","if","else","for","while","return","break","continue",
"switch","case","default","float","double","void","struct","static","do","short"};
//运算符
private String operator[]={"+","-","*","/","%","=",">","<","!","==","!=",">=","<=","++","--","&","&&","||","[","]"};
//分界符
private String delimiter[]={",",";","(",")","{","}","\'","\"",":","#"};
public Analyze() {
}
/**
* 判断是否是数字
*/
public boolean isDigit(char ch){
if(ch>='0'&&ch<='9'){
return true;
}else{
return false;
}
}
/**
* 判断是否是字母的函数
*/
public boolean isLetter(char ch){
if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')){
return true;
}else{
return false;
}
}
/**
* 判断是否由两个运算符组成
*/
public boolean isTwoOperator(String str,char ch){
char lc;
int flag=0;
if(str.length()>1||str.length()==0){//字符数大于2和无字符的情况
return false;
}else{//字符数等于2的情况
lc=str.charAt(str.length()-1);
if(ch=='='&&(lc=='>'||lc=='<'||lc=='='||lc=='!')){
}else if(ch=='+'&&lc=='+'){
}else if(ch=='-'&&lc=='-'){
}else if(ch=='|'&&lc=='|'){
}else if(ch=='&'&&lc=='&'){
}else{
return false;//否就返回false
}
return true;//其它符号的情况都返回true
}
}
/**
* 获取关键字的机器码
*/
public int getKeywordOpcodes(String str){
int i;
for(i=0;i<keyword.length;i++){
if(str.equals(keyword[i]))
break;
}
if(i<keyword.length){
return i+1;//返回关键字的机器码
}else{
return 0;
}
}
/**
* 获取操作符的机器码
*/
public int getOperatorOpcodes(String str){
int i;
for(i=0;i<operator.length;i++){
if(str.equals(operator[i]))
break;
}
if(i<operator.length)
return i+21;//返回操作符的机器码
else
return 0;
}
/**
* 获取分界符的机器码
*/
public int getDelimiterOpcodes(String str){
int i;
for(i=0;i<delimiter.length;i++){
if(str.equals(delimiter[i]))
break;
}
if(i<delimiter.length)
return i+41;//返回分界符的机器码
else
return 0;
}
/**
* 判断字符是否可以识别
*/
public boolean isIdent(String str){
char ch;
int i;
for(i=0;i<str.length();i++){
ch=str.charAt(i);
//非数字串的情况和非由英文字母组成的字符串
if((i==0&&!isLetter(ch))||(!isDigit(ch)&&!isLetter(ch))){
break;
}
}
if(i<str.length()){
return false;
}else{
return true;
}
}
/**
*
* 预处理函数
*/
public String preFunction(String str){
String ts="";
int i;
char ch,nc;
//这里的i<str.length()-1
for(i=0;i<str.length()-1;i++){
ch=str.charAt(i);
nc=str.charAt(i+1);
if(ch=='\n'){//如果字符是换行符,将\n换成$
ch='$';
ts=ts+ch;
}else if(ch==' '||ch=='\r'||ch=='\t'){
if(nc==' '||nc=='\r'||ch=='\t'){
continue;//连续' '或者'\t'或者'\r'的情况,直接跳过
}else{
ch=' ';//一个' '或者'\t'或者'\r'的情况,将这些字符换成' '
ts=ts+ch;
}
}else{
ts=ts+ch;//将字符连起来
}
}
//
ch=str.charAt(str.length()-1);
if(ch!=' '&&ch!='\r'&&ch!='\t'&&ch!='\n'){
ts=ts+ch;
}
return ts;
}
/**
* 将字符串分成一个个单词,存放在数组列表
*/
public ArrayList<Word> divide(String str){
ArrayList<Word> list=new ArrayList<Word>();
String s="";
char ch;
int i;
int row=1;
for(i=0;i<str.length();i++){
ch=str.charAt(i);
if(i==0&&ch==' ')//字符串的第一个字符
continue;
if(ch==' '){//' '或者'\t'或者'\r'的情况
if(s!=""){
list.add(new Word(row, s));
s="";//置空
}else{
continue;
}
}else if(isDigit(ch)||isLetter(ch)){
if(s==""||isDigit(s.charAt(s.length()-1))||isLetter(s.charAt(s.length()-1))){
s = s + ch;
}else{
list.add(new Word(row, s));
s = "";
s=s + ch;
}
}else{
if(isTwoOperator(s, ch)){//两个运算符的情况
s = s + ch;
}else{
if(s==""&&ch!='$'){
s = s + ch;
}else if(s==""&&ch=='$'){//若检测到$符号,就换行
row++;//行数加一
}else{
list.add(new Word(row, s));
s = "";
if(ch!='$'){
s=s + ch;
}else{
row++;
}
}
}
}
}
if(s!=""){
list.add(new Word(row, s));
}
return list;
}
/**
* 判断字符串是数字串,单个字符,还是一个字符串
*/
public int check(String str){
char ch;
ch=str.charAt(0);
if(ch>='0'&&ch<='9'){
return 1;//数字串
}
if(str.length()==1)
return 2;//单个字符
else
return 3;//一个字符串
}
/**
*
* 检查字符串是否为数字串,返回其机器码
*/
public int checkDigit(String str){
int i;
char ch;
for(i=0;i<str.length();i++){
ch=str.charAt(i);
if(ch>'9'||ch<'0')
break;
}
if(i<str.length()){
return 0;//不可识别的情况
}else{
return 52;//常数
}
}
/**
*
* 检查字符串是否为单个字符,返回其机器码
*/
public int checkChar(String str){
if(getOperatorOpcodes(str)!=0){//操作符
return getOperatorOpcodes(str);
}else if(getDelimiterOpcodes(str)!=0){//分界符
return getDelimiterOpcodes(str);
}else if(isIdent(str)){
return 51;//用户自定义标识符的机器码
}else{
return 0;//不可以被识别的标识符,机器码为0
}
}
/**
*
* 检查字符串是否为字符串,返回其机器码
*/
public int checkString(String str){
if(getOperatorOpcodes(str)!=0){//操作符
return getOperatorOpcodes(str);
}else if(getKeywordOpcodes(str)!=0){//关键字
return getKeywordOpcodes(str);
}else if(isIdent(str)){
return 51;//用户自定义标识符的机器码
}else{
return 0;//不可以被识别的标识符,机器码为0
}
}
}
package com.lexer;
import java.awt.*;
import java.awt.datatransfer.*;
import java.awt.event.*;
import java.io.*;
import java.lang.reflect.Array;
import java.util.ArrayList;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
/**
*
* 词法分析器界面类
*/
public class LexerFrame extends JFrame implements ActionListener{
private JMenuBar menuBar;
private JToolBar toolBar;
private JMenu fileMenu;
private JMenu editMenu;
//词法分析菜单
private JMenu lexerMenu;
private JMenu helpMenu;
private JMenuItem openMenuItem;
private JMenuItem saveMenuItem;
private JMenuItem exitMenuItem;
private JMenuItem cutMenuItem;
private JMenuItem copyMenuItem;
private JMenuItem pasteMenuItem;
private JMenuItem clearMenuItem;
// 词法分析器菜单项
private JMenuItem lexerMenuItem;
private JMenuItem helpMenuItem;
private JMenuItem aboutMenuItem;
private JButton openButton;
//保存按钮
private JButton saveButton;
//词法分析按钮
private JButton lexerButton;
private JButton cutButton;
private JButton copyButton;
private JButton pasteButton;
private JButton clearButton;
private JButton exitButton;
// 分隔面板
private JSplitPane splitPane;
//左右面板
private JPanel leftPanel,rightPanel;
//文件内容文本域
private JTextArea fileContentTextArea;
//分析内容
private JTextArea analysisContentTextArea;
//表格
private JTable table;
//表格模型
private DefaultTableModel model;
//控制台文本域
private JTextArea consoleTextArea;
//滚动面板
private JScrollPane scrollPane1;
private JScrollPane scrollPane2;
private JScrollPane scrollPane3;
Analyze analyze=new Analyze();
String title[]={"行","标识符","机器码"};
String values[][]={};
/**
* 创建菜单栏
*/
public void createMenu(){
menuBar = new JMenuBar();
//菜单
fileMenu = new JMenu("文件");
editMenu = new JMenu("编辑");
lexerMenu = new JMenu("词法分析");
helpMenu = new JMenu("帮助");
//菜单项
ImageIcon openIcon=new ImageIcon("../lexer/image/open.png");
openMenuItem = new JMenuItem("打开",openIcon);
openMenuItem.addActionListener(this);
ImageIcon saveIcon=new ImageIcon("../lexer/image/save.png");
saveMenuItem = new JMenuItem("保存",saveIcon);
saveMenuItem.addActionListener(this);
ImageIcon exitIcon=new ImageIcon("../lexer/image/exit.png");
exitMenuItem = new JMenuItem("退出",exitIcon);
exitMenuItem.addActionListener(this);
ImageIcon cutIcon=new ImageIcon("../lexer/image/cut.png");
cutMenuItem = new JMenuItem("剪切",cutIcon);
ImageIcon copyIcon=new ImageIcon("../lexer/image/copy.png");
copyMenuItem = new JMenuItem("复制",copyIcon);
ImageIcon pasteIcon=new ImageIcon("../lexer/image/paste.png");
pasteMenuItem = new JMenuItem("黏贴",pasteIcon);
ImageIcon clearIcon=new ImageIcon("../lexer/image/clear.png");
clearMenuItem = new JMenuItem("清除",clearIcon);
clearMenuItem.addActionListener(this);
ImageIcon lexerIcon=new ImageIcon("../lexer/image/lexer.png");
lexerMenuItem = new JMenuItem("词法分析器",lexerIcon);
lexerMenuItem.addActionListener(this);
ImageIcon helpIcon=new ImageIcon("../lexer/image/help.png");
helpMenuItem = new JMenuItem("帮助",helpIcon);
helpMenuItem.addActionListener(this);
ImageIcon aboutIcon=new ImageIcon("../lexer/image/lexer.png");
aboutMenuItem = new JMenuItem("关于",aboutIcon);
aboutMenuItem.addActionListener(this);
//添加菜单项到菜单
fileMenu.add(openMenuItem);
fileMenu.add(saveMenuItem);
fileMenu.add(exitMenuItem);
editMenu.add(cutMenuItem);
editMenu.add(copyMenuItem);
editMenu.add(pasteMenuItem);
editMenu.add(clearMenuItem);
lexerMenu.add(lexerMenuItem);
helpMenu.add(helpMenuItem);
helpMenu.add(aboutMenuItem);
//添加菜单到菜单栏
menuBar.add(fileMenu);
menuBar.add(editMenu);
menuBar.add(lexerMenu);
menuBar.add(helpMenu);
//设置菜单栏
setJMenuBar(menuBar);
}
/**
* 创建工具栏
*/
public void createToolBar(){
toolBar=new JToolBar();
//工具栏上的按钮
openButton=new JButton(new ImageIcon("image/open.png"));
saveButton=new JButton(new ImageIcon("image/save.png"));
lexerButton=new JButton(new ImageIcon("image/lexer.png"));
cutButton=new JButton(new ImageIcon("image/cut.png"));
copyButton=new JButton(new ImageIcon("image/copy.png"));
pasteButton=new JButton(new ImageIcon("image/paste.png"));
clearButton=new JButton(new ImageIcon("image/clear.png"));
exitButton=new JButton(new ImageIcon("image/exit.png"));
//添加事件监听器
openButton.addActionListener(this);
saveButton.addActionListener(this);
lexerButton.addActionListener(this);
cutButton.addActionListener(this);
copyButton.addActionListener(this);
pasteButton.addActionListener(this);
clearButton.addActionListener(this);
exitButton.addActionListener(this);
//添加按钮到工具栏
toolBar.add(openButton);
toolBar.add(saveButton);
toolBar.add(lexerButton);
toolBar.add(cutButton);
toolBar.add(copyButton);
toolBar.add(pasteButton);
toolBar.add(clearButton);
toolBar.add(exitButton);
}
/**
* 打开文件
*/
public void openFile(){
JFileChooser fileChooser=new JFileChooser("打开文件");
int isOpen=fileChooser.showOpenDialog(null);
fileChooser.setDialogTitle("打开文件");
if(isOpen==JFileChooser.APPROVE_OPTION){
String path=fileChooser.getSelectedFile().getPath();
fileContentTextArea.setText(readFromFile(path));
}
}
/**
* 读取文件
*/
public String readFromFile(String path){
File file=new File(path);
String s=null;
try {
FileInputStream fin=new FileInputStream(file);
int length=fin.available();
byte arr[]=new byte[length];
int len=fin.read(arr);
s=new String(arr,0,len);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return s;
}
/**
* 保存文件
*/
public void saveFile(){
JFileChooser fileChooser=new JFileChooser("保存文件");
int isSave=fileChooser.showSaveDialog(this);
fileChooser.setDialogTitle("保存文件");
String selectFileName="";
if(isSave==JFileChooser.APPROVE_OPTION){
File file=fileChooser.getSelectedFile();
selectFileName=fileChooser.getName(file);
if(selectFileName.length()>0){
if(!selectFileName.endsWith(".txt")){
selectFileName=selectFileName.concat(".txt");
}
file=fileChooser.getCurrentDirectory();
file=new File(file.getPath().concat(File.separator).concat(selectFileName));
if(file.exists()){
int i=JOptionPane.showConfirmDialog(this, "文件已经存在,是否覆盖?");
if(i!=JOptionPane.YES_OPTION){
return;
}
}
try {
file.createNewFile();
FileWriter out=new FileWriter(file);
out.write(fileContentTextArea.getText());
out.close();
JOptionPane.showMessageDialog(this, "保存成功!");
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* 剪切
*/
public void doCut(){
fileContentTextArea.cut();
}
/**
* 复制
*/
public void doCopy(){
int dot1,dot2;
dot1=fileContentTextArea.getSelectionStart();
dot2=fileContentTextArea.getSelectionEnd();
if(dot1!=dot2){
fileContentTextArea.copy();
JOptionPane.showMessageDialog(null, "复制成功!");
}
}
/**
* 黏贴
*/
public void doPaste(){
//调用系统剪切板
Clipboard clipboard=getToolkit().getSystemClipboard();
Transferable content=clipboard.getContents(this);
try {
if(content.getTransferData(DataFlavor.stringFlavor) instanceof String){
fileContentTextArea.paste();
}
} catch (UnsupportedFlavorException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 清除文本框内容
*/
public void doClear(){
fileContentTextArea.setText(null);
}
/**
* 词法分析
*/
public void doTokenizing(){
consoleTextArea.setText(null);
ArrayList<Word> wlist=new ArrayList<Word>();
ArrayList<Unidentifiable> ulist=new ArrayList<Unidentifiable>();
String s,ts,str;
Word word;
int i;
int opcodes=-1;
int errorNum=0;
int count=0;
s=fileContentTextArea.getText();
if(s.length()>1){
ts=analyze.preFunction(s);
wlist=analyze.divide(ts);
values=new String[wlist.size()][3];
while(wlist.size()>0){
word=(Word)wlist.remove(0);
str=word.getWord();
i=analyze.check(str);
switch (i) {
case 1:
opcodes=analyze.checkDigit(str);
break;
case 2:
opcodes=analyze.checkChar(str);
break;
case 3:
opcodes=analyze.checkString(str);
break;
}
if(opcodes==0){
Unidentifiable u=new Unidentifiable(word.getRow(), str);
ulist.add(u);
errorNum++;
}
values[count][0]=String.valueOf(word.getRow());
values[count][1]=str;
values[count][2]=String.valueOf(opcodes);
count++;
}
//更新表格内容
DefaultTableModel model=(DefaultTableModel)table.getModel();
while(model.getRowCount()>0){
model.removeRow(model.getRowCount()-1);
}
model.setDataVector(values,title);
table=new JTable(model);
consoleTextArea.append("共有"+errorNum+"处错误!"+"\n");
while (ulist.size()>0) {
int r;
String string;
Unidentifiable uni=ulist.remove(0);
r=uni.getRow();
string=uni.getWord();
consoleTextArea.append("第"+r+"行:"+"错误,"+string+"\n");
}
}else{
int j;
j=JOptionPane.showConfirmDialog(this, "请输入程序!");
if(j!=JOptionPane.YES_OPTION){
return;
}
}
}
/**
* 打开使用说明书
*/
public void doHelp(){
try {
Runtime.getRuntime().exec("cmd /c start "+System.getProperty("user.dir")+"\\doc\\help.doc") ;
} catch (IOException e1) {
e1.printStackTrace();
}
}
/**
* 关于
*/
public void showAbout(){
JDialog dialog=new JDialog();
dialog.setTitle("词法分析器 ");
JLabel label=new JLabel(" 基于Java的C语言词法分析器");
dialog.add(label);
dialog.setVisible(true);
dialog.setSize(250, 160);
dialog.setResizable(false);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = dialog.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
dialog.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
}
/**
* 退出
*/
public void doExit(){
int isExit=JOptionPane.showConfirmDialog(this, "您真的要关闭词法分析器?");
if(isExit==JOptionPane.YES_OPTION){
System.exit(0);
}else{
return;
}
}
/**
* 点击事件
*/
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource()==openMenuItem){
openFile();
}else if(e.getSource()==saveMenuItem){
saveFile();
}else if(e.getSource()==exitMenuItem){
doExit();
}else if(e.getSource()==cutMenuItem){
doCut();
}else if(e.getSource()==copyMenuItem){
doCopy();
}else if(e.getSource()==pasteMenuItem){
doPaste();
}else if(e.getSource()==clearMenuItem){
doClear();
}else if(e.getSource()==lexerMenuItem){
doTokenizing();
}else if(e.getSource()==helpMenuItem){
doHelp();
}else if(e.getSource()==aboutMenuItem){
showAbout();
}else if(e.getSource()==openButton){
openFile();
}else if(e.getSource()==saveButton){
saveFile();
}else if(e.getSource()==lexerButton){
doTokenizing();
}else if(e.getSource()==cutButton){
doCut();
}else if(e.getSource()==copyButton){
doCopy();
}else if(e.getSource()==pasteButton){
doPaste();
}else if(e.getSource()==clearButton){
doClear();
}else if(e.getSource()==exitButton){
doExit();
}
}
/**
* 构造方法
*/
public LexerFrame(){
setTitle("词法分析器 版本 V 1.0");
Image logo=Toolkit.getDefaultToolkit().getImage("../lexer/image/lexer.png");
setIconImage(logo);
//创建菜单栏
createMenu();
//创建工具栏
createToolBar();
//左面板
leftPanel=new JPanel();
fileContentTextArea=new JTextArea(60,60);
fileContentTextArea.setFont(new Font("隶书",Font.BOLD,12));
scrollPane1=new JScrollPane(fileContentTextArea);
scrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
scrollPane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane1.getViewport().add(fileContentTextArea);
scrollPane1.getViewport().setPreferredSize(new Dimension(300,530));
leftPanel.add(scrollPane1);
//右面板
rightPanel=new JPanel();
rightPanel.setLayout(new BorderLayout());
//分析后的内容放在表格里
model=new DefaultTableModel(values,title);
table=new JTable(model);
scrollPane2=new JScrollPane(table);
scrollPane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane2.getViewport().add(table);
scrollPane2.getViewport().setPreferredSize(new Dimension(100,100));
//控制台
consoleTextArea = new JTextArea(100,100);
consoleTextArea.setFont(new Font("隶书",Font.BOLD,12));
scrollPane3=new JScrollPane(consoleTextArea);
scrollPane3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane3.getViewport().add(consoleTextArea);
scrollPane3.getViewport().setPreferredSize(new Dimension(300,100));
//添加到右部面板
rightPanel.add("Center",scrollPane2);
rightPanel.add("South",scrollPane3);
//创建一个分隔面板
splitPane=new JSplitPane();
//左面板
splitPane.setLeftComponent(leftPanel);
//右面板
splitPane.setRightComponent(rightPanel);
add("North",toolBar);
add("Center",splitPane);
//设置运行时窗口的位置
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
setLocation((screenSize.width - frameSize.width) / 6, (screenSize.height - frameSize.height) / 6);
setSize(800,600);
setResizable(false);
setVisible(true);
}
/**
* 主方法
* @param args
*/
public static void main(String[] args) {
new LexerFrame();
}
}
package com.lexer;
/**
*
* JavaBean类
* 不可以识别的标识符
*/
public class Unidentifiable {
//不可以识别的标识符行
int row;
//获取到的不可以识别的标识符
String word;
public Unidentifiable(int row,String word){
this.row=row;
this.word=word;
}
public int getRow() {
return row;
}
public void setRow(int row) {
this.row = row;
}
public String getWord() {
return word;
}
public void setWord(String word) {
this.word = word;
}
}
package com.lexer;
/**
*
* 可以识别的标识符
*/
public class Word {
//标识符所在的行
private int row;
//获取到的标识符
private String word;
public Word(int row,String word){
this.row=row;
this.word=word;
}
public int getRow() {
return row;
}
public void setRow(int row) {
this.row = row;
}
public String getWord() {
return word;
}
public void setWord(String word) {
this.word = word;
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册