/// <summary> /// Visits the int value node. /// </summary> /// <returns>An ISemanticCheckValue.</returns> /// <param name="node">Node.</param> public ISemanticCheckValue VisitIntValueNode(IntValueNode node) { // return a copy of the node IntValueNode newNode = new IntValueNode(node.Value); return(newNode); }
public IExpressionNode CreateDefaultIntValueNode(Token t, IExpressionContainer parent) { IntValueNode node = new IntValueNode(SemanticAnalysisConstants.DEFAULT_INTEGER_VALUE, t); parent.AddExpression(node); return(node); }
public IExpressionNode CreateIntValueNode(Token t, IExpressionContainer parent) { int value = StringUtils.parseToInt(t.Value); IntValueNode node = new IntValueNode(value, t); parent.AddExpression(node); return(node); }
/// <summary> /// Checks the static semantic constraints of an IntValueNode. /// </summary> /// <returns>An ISemanticCheckValue.</returns> /// <param name="node">Node.</param> public ISemanticCheckValue VisitIntValueNode(IntValueNode node) { // This is not a statement so it needs not to be actually checked here. // So, we pass it to the TypeCheckerVisitor instead. return(node.Accept(this.typeChecker)); }
/// <summary> /// Visits the int value node. /// </summary> /// <returns>the node itself.</returns> /// <param name="node">Node.</param> public ISemanticCheckValue VisitIntValueNode(IntValueNode node) { // Here, the node itself is the evaluation we're looking for. // Value nodes implement the ISemanticCheckValue interface. return(node); }
/// <summary> /// Visits the int value node. /// </summary> /// <returns>An ISemanticCheckValue.</returns> /// <param name="node">Node.</param> public ISemanticCheckValue VisitIntValueNode(IntValueNode node) { // let the evaluator evaluate this node return(node.Accept(evaluator)); }