⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fileio.java

📁 JAVA的CMM编译器(词法+语法+语义+输出结果)
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package cmm;import java.io.*;import java.util.*;/** * * @author lx */public class FileIO {    public FileIO(){            }    public void writeIns(LinkedList instruc) throws IOException{        PrintWriter  output =            new  PrintWriter(new FileWriter("D:\\Instruc.txt"));                while(!instruc.isEmpty()){            Instruction temp;            temp = (Instruction)instruc.poll();            String ins = temp.getIns().toString();            int lev = temp.getLev();            String a;            if(temp.getFlag()){                a = String.valueOf( temp.getA_r());            }else{                a = String.valueOf(temp.getA_i());            }            output.println(ins +"      "+ lev + "      " + a);        }        output.println("完成目标代码生成!");        output.close();    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -