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

📄 function.java

📁 北航编译原理课程设计成果——一个扩充的C0文法编译器
💻 JAVA
字号:
package cn.edu.buaa.scse.liyi.compile.types;

import java.util.LinkedList;
import java.util.TreeMap;
import java.util.Vector;

/**
 * 
 * @author liyi
 */
public class Function
{
	public static final int R_VOID=0;
	public static final int R_INT=1;
	
	private int retype;
	private String name;
	
	private Vector<Constant> constant=null;
	private Vector<String> parameter=null;
	private Vector<String> variable=null;
	
	private LinkedList<Quaternion> quaterList=null;
	
	private TreeMap<String,Integer> pmap=null;			//参数表
	private TreeMap<String,Integer> vmap=null;			//变量表
	
	/**
	 * 函数类构造方法
	 * @param retype
	 * @param name
	 */
	public Function(int retype,String name)
	{
		this.name=name;
		this.retype=retype;
		
		this.constant=new Vector<Constant>();
		this.parameter=new Vector<String>();
		this.variable=new Vector<String>();
		
		this.quaterList=new LinkedList<Quaternion>();
		
		this.pmap=new TreeMap<String,Integer>();
		this.vmap=new TreeMap<String,Integer>();
	}

	public void setRetype(int retype)
	{
		this.retype=retype;
	}
	public int getRetype()
	{
		return retype;
	}

	public void setName(String name)
	{
		this.name=name;
	}
	public String getName()
	{
		return name;
	}
	
	public void setConst(Vector<Constant> constant)
	{
		this.constant=constant;
	}
	public Vector<Constant> getConst()
	{
		return constant;
	}
	
	public void setPara(Vector<String> parameter)
	{
		this.parameter=parameter;
	}
	public Vector<String> getPara()
	{
		return parameter;
	}

	public void setVar(Vector<String> variable)
	{
		this.variable=variable;
	}
	public Vector<String> getVar()
	{
		return variable;
	}

	public void setQuaterList(LinkedList<Quaternion> quaterList)
	{
		this.quaterList=quaterList;
	}
	public LinkedList<Quaternion> getQuaterList()
	{
		return quaterList;
	}

	public void setPmap(TreeMap<String,Integer> pmap)
	{
		this.pmap=pmap;
	}
	public TreeMap<String,Integer> getPmap()
	{
		return pmap;
	}

	public void setVmap(TreeMap<String,Integer> vmap)
	{
		this.vmap=vmap;
	}
	public TreeMap<String,Integer> getVmap()
	{
		return vmap;
	}
	
}

⌨️ 快捷键说明

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