コード例 #1
0
 public override bool Equivalent(ParserType Other)
 {
     if (Other.Typ == ParserTypeEnum.Lambda)
     {
         var OtherLambda = (ParserLambdaType)Other;
         return(InputType.Equivalent(OtherLambda.InputType));
     }
     else if (Other.Typ == ParserTypeEnum.Unknown)
     {
         if ((Other.Flags & (~ParserTypeFlags.Lambda)) == 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
コード例 #2
0
 public override bool Equivalent(ParserType Other)
 {
     if (Other.Typ == ParserTypeEnum.Pair)
     {
         var OtherPair = (ParserProdType)Other;
         return(Left.Equivalent(OtherPair.Left) && Right.Equals(OtherPair.Right));
     }
     else if (Other.Typ == ParserTypeEnum.Unknown)
     {
         if ((Other.Flags & (~ParserTypeFlags.Pair)) == 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }