示例#1
0
 public RealEqualWarning(SemanticOperator @operator, List <Word> runs, bool isEqual)
     : base(@operator, runs)
 {
     this.Text = isEqual
                     ? Strings.RealEquationIsNotRecommendedUseFabsLessEpsilon
                     : Strings.RealEquationIsNotRecommendedUseFabsGreaterEpsilon;
 }
 protected MissingDeclarationError(SemanticOperator @operator, List <Word> items,
                                   SemanticOperator missingOperator, string member)
     : base(@operator, items)
 {
     MissingOperator = missingOperator;
     Member          = member;
 }
示例#3
0
 public NotApplicableOperatorTypes(SemanticOperator @operator, Token operation,
                                   string firstType, string secondType)
     : base(@operator, operation.Words)
 {
     Operation = operation;
     Text      = string.Format(Strings.OperationIsNotAppliedToTypes, Operation.Text, firstType, secondType);
 }
示例#4
0
 private void AddUsages(SemanticOperator @operator)
 {
     if (@operator is INameable nameable)
     {
         SemanticItem.AddUsages(nameable, RightOperand.Token);
     }
 }
 public UndeclaredSubprogram(SemanticOperator @operator, List <Word> items, string name)
     : base(@operator, items, name)
 {
     Text = string.IsNullOrEmpty(Name)
         ? Strings.InputSubprogramName
         : string.Format(Strings.SubprogramIsNotDeclared, Name);
 }
示例#6
0
 public UndeclaredRecord(SemanticOperator @operator, List <Word> items, string name)
     : base(@operator, items, name)
 {
     Text = string.IsNullOrEmpty(Name)
         ? Strings.InputTypeName
         : string.Format(Strings.TypeIsNotDeclared, Name);
 }
示例#7
0
        public IndexHasIncorrectType(SemanticOperator @operator, List <Word> items,
                                     string formalType, string actualType)
            : base(@operator, items)
        {
            FormalType = formalType;
            ActualType = actualType;

            Text = string.Format(Strings.IndexHasIncorrectType, FormalType, ActualType);
        }
        public IncorrectArgumentCount(SemanticOperator @operator, List <Word> items, int actualCount, int formalCount)
            : base(@operator, items)
        {
            Function    = items.Last();
            ActualCount = actualCount;
            FormalCount = formalCount;

            Text = string.Format(Strings.FunctionTakesIncorrectParametersCount, Function.Text, FormalCount, ActualCount);
        }
        public ArgumentHasIncorrectType(SemanticOperator @operator, List <Word> items,
                                        string name, string formalType, string actualType)
            : base(@operator, items)
        {
            ParameterName = name;
            FormalType    = formalType;
            ActualType    = actualType;

            Text = string.Format(Strings.ParameterHasTypeActualType, ParameterName, FormalType, ActualType);
        }
示例#10
0
        public IncorrectIndexesCount(SemanticOperator @operator, List <Word> items,
                                     int formalParamsCount, int actualParamsCount)
            : base(@operator, items)
        {
            Array             = items.Last();
            FormalParamsCount = formalParamsCount;
            ActualParamsCount = actualParamsCount;

            Text = string.Format(Strings.ArrayHasIncorrectIndexesCount, Array.Text, ActualParamsCount, FormalParamsCount);
        }
示例#11
0
        public SemanticFind(SemanticOperator @operator, List <Word> items)
        {
            Operator = @operator;
            Words    = items;
            if (Operator.Number == 0)
            {
                Operator.Tree.Root.CalculateNumber();
            }

            Line = Operator.Number;
        }
示例#12
0
        private static void FindMember(SemanticOperator @operator)
        {
            if (@operator is IField)
            {
                _members.Add(@operator);
            }

            if (@operator.Next != null)
            {
                FindMember(@operator.Next);
            }
        }
示例#13
0
 public IncorrectOutputType(SemanticOperator @operator, List <Word> items, string type)
     : base(@operator, items)
 {
     if (type == SyntaxNames.Type)
     {
         Text = Strings.ImpossibleToOutputType;
     }
     else if (type == Strings.Subprogram)
     {
         Text = Strings.ImpossibleToOutputProcedure + SyntaxNames.Call;
     }
 }
示例#14
0
 private void CheckVisibility(SemanticOperator member, string memberName, string classOrModuleName)
 {
     if (member is IHaveVisibility haveVisibility)
     {
         var visibility = haveVisibility.VisibilityWord;
         if (visibility.Equals(SyntaxNames.Private))
         {
             if (!Token.Operator.IsChild(member.FindParent()))
             {
                 GenerateFind(new AccessToPrivateMember(Token.Operator, RightOperand.Words, member, memberName,
                                                        classOrModuleName));
             }
         }
     }
 }
 public IncorrectExpressionType(SemanticOperator @operator, List <Word> runs, string formalType, string actualType)
     : base(@operator, runs)
 {
     if (formalType == SyntaxNames.Boolean)
     {
         Text = string.Format(Strings.BooleanExpressionExceptedGot, actualType);
     }
     else if (formalType == SyntaxNames.Integer)
     {
         Text = string.Format(Strings.IntegerExpressionExpectedGot, actualType);
     }
     else if (formalType == Strings.Subprogram)
     {
         Text = string.Format(Strings.CallExpectedGot, actualType);
     }
 }
示例#16
0
 public ClassMissingField(SemanticOperator @operator, List <Word> items, SemanticOperator missingOperator, string member)
     : base(@operator, items, missingOperator, member)
 {
     Text = string.Format(Strings.FieldIsNotDeclaredInClass, member, OperatorName);
 }
示例#17
0
 public NotArray(SemanticOperator @operator, List <Word> items, string type)
     : base(@operator, items)
 {
     Text = string.Format(Strings.ObjectIsNotArray, type);
 }
 public ValueUsedAsLeftArgument(SemanticOperator @operator, List <Word> items)
     : base(@operator, items)
 {
     Text = Strings.YouCantUseValueToTheLeftOfAssign;
 }
示例#19
0
 public MultipleDeclaration(SemanticOperator @operator, List <Word> items, string name)
     : base(@operator, items)
 {
     Name = name;
     Text = string.Format(Strings.NameIsDeclaredMoreThanOnce, Name);
 }
示例#20
0
 public IncorrectName(SemanticOperator @operator, List <Word> items, bool isKeyword = false)
     : base(@operator, items)
 {
     Text = isKeyword ? Strings.IdentifierConcursWithKeyword : Strings.IncorrectName;
 }
示例#21
0
 public IntegerConstantsDivision(SemanticOperator @operator, List <Word> words)
     : base(@operator, words)
 {
     this.Text = Strings.UseIntegerDivideOperation;
 }
 public UninitializedVariableUsage(SemanticOperator @operator, List <Word> items, string name)
     : base(@operator, items)
 {
     Name = name;
     Text = string.Format(Strings.VariableIsNotInitialized, Name);
 }
示例#23
0
 public IncorrectReturnType(SemanticOperator @operator, List <Word> items,
                            string name, string formalType, string actualType)
     : base(@operator, items)
 {
     Text = string.Format(Strings.FunctionReturnsIncorrectType, name, formalType, actualType);
 }
示例#24
0
 internal void AddNullOperatorToElseOrElseIf(SemanticOperator newOperator)
 => Tree.InsertOperatorAsChild(new NullOperator(), newOperator);
示例#25
0
 public AmbiguousModule(SemanticOperator @operator, List <Word> items, string module)
     : base(@operator, items)
 {
     Text = string.Format(Strings.ModuleWithNameHasDeclared, module, @operator.Tree.Project.Name);
 }
示例#26
0
 public ValueUsedAsInput(SemanticOperator @operator, List <Word> items)
     : base(@operator, items)
 {
     Text = Strings.YouCantInputToValueUseVariable;
 }
示例#27
0
 public ModuleMissingArray(SemanticOperator @operator, List <Word> items,
                           SemanticOperator missingOperator, string member)
     : base(@operator, items, missingOperator, member)
 {
     Text = string.Format(Strings.ArrayIsNotDeclaredInModule, member, OperatorName);
 }
示例#28
0
 public IncorrectSuperClass(SemanticOperator @operator, List <Word> items)
     : base(@operator, items)
 {
     Text = Strings.InheritanceMustBeFromUserClass;
 }
示例#29
0
 private static ProcedureType CreateProcedureType(SemanticOperator procedure)
 => new(procedure.SelectionWord);
 public UnfinishedClassUsage(SemanticOperator @operator, List <Word> items)
     : base(@operator, items)
 {
     Text = Strings.YouCantUseUnfinishedClassInDeepCopyMode;
 }