Exemple #1
0
        public override void Visit(UnaryOperator unaryOperator)
        {
            if (unaryOperator.Operator == Enum.GetName(typeof(Symbol), Symbol.EXCLAMATION))
            {
                unaryOperator.term.Accept(this);

                var boolType = _stateInfo.currentType;

                if (boolType.TypeName != Enum.GetName(typeof(Keyword), Keyword.BOOL).ToLower())
                {
                    throw new Exception("Cannot Apply negation operator to " + boolType.ToString() + " type");
                }
            }
            else
            {
                unaryOperator.term.Accept(this);
            }
        }
Exemple #2
0
 public override void Visit(UnaryOperator unaryOperator)
 {
 }
Exemple #3
0
 public virtual void Visit(UnaryOperator unaryOperator)
 {
 }