Beispiel #1
0
        /// <summary>
        /// Visits the bool value node.
        /// </summary>
        /// <returns>An ISemanticCheckValue.</returns>
        /// <param name="node">Node.</param>
        public ISemanticCheckValue VisitBoolValueNode(BoolValueNode node)
        {
            // return a copy of the node
            BoolValueNode newNode = new BoolValueNode(node.Value);

            return(newNode);
        }
Beispiel #2
0
        public IExpressionNode CreateDefaultBoolValueNode(Token t, IExpressionContainer parent)
        {
            BoolValueNode node = new BoolValueNode(SemanticAnalysisConstants.DEFAULT_BOOL_VALUE, t);

            parent.AddExpression(node);

            return(node);
        }
Beispiel #3
0
        public IExpressionNode CreateBoolValueNode(Token t, IExpressionContainer parent)
        {
            bool          value = StringUtils.parseToBoolean(t.Value);
            BoolValueNode node  = new BoolValueNode(value, t);

            parent.AddExpression(node);

            return(node);
        }
Beispiel #4
0
 /// <summary>
 /// Checks the static semantic constraints of a BoolValueNode.
 /// </summary>
 /// <returns>An ISemanticCheckValue.</returns>
 /// <param name="node">Node.</param>
 public ISemanticCheckValue VisitBoolValueNode(BoolValueNode 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));
 }
Beispiel #5
0
 /// <summary>
 /// Visits the bool value node.
 /// </summary>
 /// <returns>the node itself.</returns>
 /// <param name="node">Node.</param>
 public ISemanticCheckValue VisitBoolValueNode(BoolValueNode node)
 {
     // Here, the node itself is the evaluation we're looking for.
     // Value nodes implement the ISemanticCheckValue interface.
     return(node);
 }
Beispiel #6
0
 /// <summary>
 /// Visits the bool value node.
 /// </summary>
 /// <returns>An ISemanticCheckValue.</returns>
 /// <param name="node">Node.</param>
 public ISemanticCheckValue VisitBoolValueNode(BoolValueNode node)
 {
     // let the evaluator evaluate this node
     return(node.Accept(evaluator));
 }