package node.exprNode.primaryNode; import env.*; import type.*; import type.basicType.*; import runEnv.*; import node.exprNode.*; public class ChrNode extends PrimaryNode { private ExprNode expr; public ChrNode( ExprNode expr ) { this.expr = expr; } public String toString() { return "chr( " + expr + " )"; } public Type checkType( Env env ) { Type exprType = expr.checkType( env ); expr = expr.castTo( IntType.type ); type = CharType.type; return type; } public RunValue eval( RunEnv runEnv ) { RunValue value = expr.eval( runEnv ); return new RunValue( ( char ) value.intValue() ); } }