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; }
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); }
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); }
public UndeclaredRecord(SemanticOperator @operator, List <Word> items, string name) : base(@operator, items, name) { Text = string.IsNullOrEmpty(Name) ? Strings.InputTypeName : string.Format(Strings.TypeIsNotDeclared, Name); }
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); }
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); }
public SemanticFind(SemanticOperator @operator, List <Word> items) { Operator = @operator; Words = items; if (Operator.Number == 0) { Operator.Tree.Root.CalculateNumber(); } Line = Operator.Number; }
private static void FindMember(SemanticOperator @operator) { if (@operator is IField) { _members.Add(@operator); } if (@operator.Next != null) { FindMember(@operator.Next); } }
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; } }
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); } }
public ClassMissingField(SemanticOperator @operator, List <Word> items, SemanticOperator missingOperator, string member) : base(@operator, items, missingOperator, member) { Text = string.Format(Strings.FieldIsNotDeclaredInClass, member, OperatorName); }
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; }
public MultipleDeclaration(SemanticOperator @operator, List <Word> items, string name) : base(@operator, items) { Name = name; Text = string.Format(Strings.NameIsDeclaredMoreThanOnce, Name); }
public IncorrectName(SemanticOperator @operator, List <Word> items, bool isKeyword = false) : base(@operator, items) { Text = isKeyword ? Strings.IdentifierConcursWithKeyword : Strings.IncorrectName; }
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); }
public IncorrectReturnType(SemanticOperator @operator, List <Word> items, string name, string formalType, string actualType) : base(@operator, items) { Text = string.Format(Strings.FunctionReturnsIncorrectType, name, formalType, actualType); }
internal void AddNullOperatorToElseOrElseIf(SemanticOperator newOperator) => Tree.InsertOperatorAsChild(new NullOperator(), newOperator);
public AmbiguousModule(SemanticOperator @operator, List <Word> items, string module) : base(@operator, items) { Text = string.Format(Strings.ModuleWithNameHasDeclared, module, @operator.Tree.Project.Name); }
public ValueUsedAsInput(SemanticOperator @operator, List <Word> items) : base(@operator, items) { Text = Strings.YouCantInputToValueUseVariable; }
public ModuleMissingArray(SemanticOperator @operator, List <Word> items, SemanticOperator missingOperator, string member) : base(@operator, items, missingOperator, member) { Text = string.Format(Strings.ArrayIsNotDeclaredInModule, member, OperatorName); }
public IncorrectSuperClass(SemanticOperator @operator, List <Word> items) : base(@operator, items) { Text = Strings.InheritanceMustBeFromUserClass; }
private static ProcedureType CreateProcedureType(SemanticOperator procedure) => new(procedure.SelectionWord);
public UnfinishedClassUsage(SemanticOperator @operator, List <Word> items) : base(@operator, items) { Text = Strings.YouCantUseUnfinishedClassInDeepCopyMode; }