摘要:
1: package compiler; 2: 3: /** 4: * 采用全局变量sym来存储符号码,并用全局变量id和num来传递语义值 5: * 6: * @author jiangnan 7: * 8: */ 9: public class Symbol { 10: 11: //各类符号码 12: ... 阅读全文
摘要:
1: package compiler; 2: 3: import java.io.BufferedReader; 4: import java.io.FileNotFoundException; 5: import java.io.FileReader; 6: import java.util.Arrays; 7: 8: public cla... 阅读全文
摘要:
1: package compiler; 2: 3: import java.io.IOException; 4: import java.util.BitSet; 5: 6: /** 7: * 语法分析器。 这是PL/0分析器中最重要的部分, 在语法分析的过程中嵌入了语法错误检查和目标代码生成。 8: * 9: * @author... 阅读全文
摘要:
1: package compiler; 2: 3: import java.io.BufferedWriter; 4: import java.io.FileWriter; 5: 6: /** 7: * 组织输入输出接口 8: * 9: * @author jiangnan 10: */ 11: public class... 阅读全文
摘要:
1: package compiler; 2: 3: /** 4: * //虚拟机指令 5: * 6: * @author jiangnan 7: * 8: */ 9: public class Pcode { 10: 11: public Pcode(int f, int l, int a) { 12: ... 阅读全文
摘要:
1: package compiler; 2: 3: import java.io.BufferedReader; 4: import java.io.BufferedWriter; 5: import java.io.IOException; 6: import java.util.Arrays; 7: import java.util.logging.Level; 8: import java.util.logging.Logger; 9: 10: /** 11: * 类P-code代码解释器(含代码生成函数) 12:... 阅读全文
摘要:
1: package compiler; 2: 3: import java.io.BufferedWriter; 4: 5: public class Err { 6: 7: public int errCount = 0; 8: public static final String[] errInfo = new Str... 阅读全文
摘要:
1: /* 2: * To change this license header, choose License Headers in Project Properties. 3: * To change this template file, choose Tools | Templates 4: * and open the template in the ed... 阅读全文