production.java

来自「SkipOOMiniJOOL教学语言的编译器前端」· Java 代码 · 共 74 行

JAVA
74
字号
package edu.ustc.cs.minijool.parser.ast;import java.util.Iterator;import java.util.List;/** * @author manu_s * */public class Production extends DPASTNode {		/**	 * the name on the LHS of the production	 */	private SimpleName prodName;		/**	 * list of possible right-hand sides	 */	private List /* of RightHandSide */ rightHandSides;		public Production(SimpleName prodName, List refs) {		this.prodName = prodName;		this.rightHandSides = refs;	}		    /**     * @return     */    public SimpleName getProdName() {        return prodName;    }    /**     * @return     */    public List getRightHandSides() {        return rightHandSides;    }    /**     * @param name     */    public void setProdName(SimpleName name) {        prodName = name;    }    /**     * @param list     */    public void setRightHandSides(List list) {        rightHandSides = list;    }    /* (non-Javadoc)     * @see edu.berkeley.cs164.parser.ast.DCASTNode#accept(edu.berkeley.cs164.parser.ast.DCVisitor)     */    public void accept(DPVisitor v) {    	boolean visitChildren = v.visit(this);    	if (visitChildren) {    		getProdName().accept(v);    		for (Iterator iter = getRightHandSides().iterator(); iter.hasNext();) {                RightHandSide n = (RightHandSide) iter.next();                n.accept(v);            }    	}    }}

⌨️ 快捷键说明

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