예제 #1
0
파일: TypeVisitor.cs 프로젝트: Ryuuke/Ryu
        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);
            }
        }
예제 #2
0
 public override void Visit(UnaryOperator unaryOperator)
 {
 }
예제 #3
0
 public virtual void Visit(UnaryOperator unaryOperator)
 {
 }