Esempio n. 1
0
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     if (Left == null)
     {
         cmm.CompileError("require-expression", this);
     }
     if (Right == null)
     {
         cmm.CompileError("require-expression", this);
     }
 }
Esempio n. 2
0
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     if(Right != null && Right is RightPipeline)
     {
         cmm.CompileError("not-collide-assign", this);
     }
     if (Left != null && Left is RightPipeline)
     {
         cmm.CompileError("not-collide-assign", this);
     }
     base.CheckSemantic(cmm);
 }
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     foreach (Token v in ErrorToken)
     {
         if (v.TokenType == TokenType.OtherString)
         {
             cmm.CompileError("invalid-token", v);
         }
         else
         {
             cmm.CompileError("error-token", v);
         }
     }
 }
Esempio n. 4
0
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     if (CallRoutine is ErrorRoutineSymbol && !TypeSymbol.HasAnyErrorType(Left.ReturnType, Right.ReturnType))
     {
         cmm.CompileError("impossible-calculate", this);
     }
 }
Esempio n. 5
0
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     if (CallRoutine is ErrorRoutineSymbol && !TypeSymbol.HasAnyErrorType(Exp.ReturnType))
     {
         cmm.CompileError("undefined-monadic-operator", this);
     }
 }
Esempio n. 6
0
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     if (CallRoutine is ErrorRoutineSymbol)
     {
         cmm.CompileError("undefined-monadic-operator", this);
     }
 }
Esempio n. 7
0
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     foreach (var v in Values)
     {
         if (BaseType != v.ReturnType)
         {
             cmm.CompileError("disagree-array-type", this);
         }
     }
 }
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     foreach (Element v in this)
     {
         if (v == null)
         {
             cmm.CompileError("require-expression", this);
             continue;
         }
     }
 }
Esempio n. 9
0
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     if (OverLoad.IsUndefined)
     {
         cmm.CompileError("undefined-identifier", this);
         return;
     }
     if (AccessSymbol.IsStaticMember && !ContainClass(AccessSymbol.GetParent<ClassSymbol>(), Access.ReturnType))
     {
         cmm.CompileError("undefined-identifier", this);
         return;
     }
     if (IsConnectCalls || !IsExecutionLocation)
     {
         return;
     }
     //todo より適切なエラーメッセージを出す。
     switch (Match.Result)
     {
         case CallMatchResult.NotCallable: cmm.CompileError("not-callable", this); break;
         case CallMatchResult.UnmatchArgumentCount: cmm.CompileError("unmatch-overload-count", this); break;
         case CallMatchResult.UnmatchArgumentType: cmm.CompileError("unmatch-overload-type", this); break;
         case CallMatchResult.UnmatchGenericCount: cmm.CompileError("unmatch-generic-count", this); break;
         case CallMatchResult.UnmatchGenericType: cmm.CompileError("unmatch-generic-type", this); break;
         case CallMatchResult.AmbiguityMatch: cmm.CompileError("ambiguity-match", this); break;
     }
     if (AccessSymbol.Attribute.HasAnyAttribute(AttributeType.Private) && !HasCurrentAccess(AccessSymbol.GetParent<ClassSymbol>()))
     {
         cmm.CompileError("not-accessable", this);
     }
     if (AccessSymbol.Attribute.HasAnyAttribute(AttributeType.Protected) && !HasCurrentAccess(AccessSymbol.GetParent<ClassSymbol>()))
     {
         cmm.CompileError("not-accessable", this);
     }
     if (AccessSymbol.IsInstanceMember && ModifyTypeSymbol.HasContainModify(Access.ReturnType, ModifyType.Typeof))
     {
         cmm.CompileError("not-accessable", this);
     }
     if (AccessSymbol.IsStaticMember && !ModifyTypeSymbol.HasContainModify(Access.ReturnType, ModifyType.Typeof))
     {
         cmm.CompileError("not-accessable", this);
     }
 }
Esempio n. 10
0
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     if(CallReturnType is GenericSymbol)
     {
         return;
     }
     if (Block.IsInline)
     {
         var ret = Block[0];
         if (CallReturnType != ret.ReturnType)
         {
             cmm.CompileError("disagree-return-type", this);
         }
     }
     else
     {
         var ret = Block.FindElements<ReturnStatement>();
         foreach (var v in ret)
         {
             if (CallReturnType != v.Exp.ReturnType)
             {
                 cmm.CompileError("disagree-return-type", this);
             }
         }
     }
 }
Esempio n. 11
0
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     if (ReturnType is UnknownSymbol)
     {
         cmm.CompileError("require-type", this);
     }
 }
Esempio n. 12
0
 private BigInteger Parse(string text, out int count, out int b, CompileMessageManager cmm = null)
 {
     b = CheckPrefix(ref text);
     count = 0;
     BigInteger number = 0;
     foreach (char v in text)
     {
         if (v == '_')
         {
             continue;
         }
         checked
         {
             number *= b;
             int temp = ToNum(v);
             if (temp >= b)
             {
                 if (cmm != null)
                 {
                     cmm.CompileError("number-parse-error", this);
                 }
                 return 0;
             }
             number += temp;
             count++;
         }
     }
     return number;
 }
Esempio n. 13
0
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     foreach (var v in InheritAccess)
     {
         var dt = v.OverLoad.FindDataType();
         if (!(dt.Type is ClassSymbol))
         {
             cmm.CompileError("not-datatype-inherit", this);
         }
     }
     foreach(var v in Block)
     {
         if(!v.IsConstant)
         {
             cmm.CompileError("not-constant-expression", v);
         }
     }
 }
Esempio n. 14
0
 internal override void CheckSemantic(CompileMessageManager cmm)
 {
     if(IsConnectPipeline)
     {
         return;
     }
     switch (Match.Result)
     {
         case CallMatchResult.NotCallable: cmm.CompileError("not-callable", this); break;
         case CallMatchResult.UnmatchArgumentCount: cmm.CompileError("unmatch-overload-count", this); break;
         case CallMatchResult.UnmatchArgumentType: cmm.CompileError("unmatch-overload-type", this); break;
         case CallMatchResult.UnmatchGenericCount: cmm.CompileError("unmatch-generic-count", this); break;
         case CallMatchResult.UnmatchGenericType: cmm.CompileError("unmatch-generic-type", this); break;
         case CallMatchResult.AmbiguityMatch: cmm.CompileError("ambiguity-match", this); break;
     }
     if (IsImmutableCall && !IsConstructorLocation && !(Access is VariantDeclaration))
     {
         cmm.CompileError("not-mutable", this);
     }
     //todo 副作用のある関数を呼べないようにする。
     if (IsFunctionLocation && CallRoutine is PropertySymbol)
     {
         cmm.CompileError("forbit-side-effect", this);
     }
     if (IsCalculate && CalculateCallScope is ErrorRoutineSymbol)
     {
         cmm.CompileError("impossible-calculate", this);
     }
 }