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

📄 directionnode.java

📁 是有关解释器的.用JAVA编写.可以解释一般的JAVA程序.
💻 JAVA
字号:
class DirectionNode extends EvaluatableNode
{   
	String vDirectionType;
  
	static DirectionNode parserDirection(Environment env,Scanner s) throws ParserException, ScannerException
	{   
		String tmpDirectionType= null;
	
		if(mIsDirection(s))
	     {
			tmpDirectionType=matchIdentifier(s);	
	     }
		
		return new DirectionNode(tmpDirectionType);
	}
	
	static boolean mIsDirection(Scanner s)throws ScannerException
	{   
		return isIdentifierToken(s,"North")||isIdentifierToken(s,"West")||isIdentifierToken(s,"South")||isIdentifierToken(s,"East");	    
	}
	
	DirectionNode(String aDirectionType)
	{
		vDirectionType=aDirectionType;
	}
	
	String format(int indent)
	{
		return vDirectionType.toUpperCase();
	}
	Value evaluate(Environment env) throws InterpreterException 
	{
		return new DirectionValue(vDirectionType);
	}
	//type checker returns true
}

⌨️ 快捷键说明

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