Ejemplo n.º 1
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser,
 /// when the expected type does not match the given type of the variable of function.
 /// </summary>
 public SequenceParserException(String varOrFuncName, String expectedType, String givenType)
 {
     VariableOrFunctionName = varOrFuncName;
     ExpectedType           = expectedType;
     GivenType = givenType;
     Kind      = SequenceParserError.TypeMismatch;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, when the function
 /// with the given name does not exist or input or output parameters do not match.
 /// </summary>
 /// <param name="paramBindings">The parameter bindings of the function invocation.</param>
 /// <param name="errorKind">The kind of error.</param>
 /// <param name="badParamIndex">The index of a bad parameter or -1 if another error occurred.</param>
 public SequenceParserException(InvocationParameterBindings paramBindings, SequenceParserError errorKind, int badParamIndex)
 {
     Kind           = errorKind;
     Name           = paramBindings.Name;
     NumGivenInputs = paramBindings.Arguments.Length;
     BadParamIndex  = badParamIndex;
     ClassifyDefinitionType(paramBindings);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser,
 /// when an operator is not available for the supplied types.
 /// </summary>
 public SequenceParserException(String varOrFuncName, String leftType, String rightType, String expression)
 {
     VariableOrFunctionName = varOrFuncName;
     LeftType   = leftType;
     RightType  = rightType;
     Expression = expression;
     Kind       = SequenceParserError.OperatorNotFound;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, when the rule/sequence/procedure/function
 /// with the given name does not exist.
 /// </summary>
 public SequenceParserException(String name, DefinitionType defType, SequenceParserError errorKind)
 {
     Name          = name;
     DefType       = defType;
     Kind          = errorKind;
     NumGiven      = -1;
     BadParamIndex = -1;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, when the rule/sequence/procedure/function
 /// with the given name does not exist or input or output parameters do not match.
 /// </summary>
 /// <param name="invocation">The rule/sequence/procedure/function invocation.</param>
 /// <param name="errorKind">The kind of error.</param>
 /// <param name="badParamIndex">The index of a bad parameter or -1 if another error occurred.</param>
 public SequenceParserException(Invocation invocation, int numGiven, SequenceParserError errorKind, int badParamIndex)
 {
     Kind = errorKind;
     Name = invocation.Name;
     if (invocation is RuleInvocation)
     {
         Action = SequenceBase.GetAction((RuleInvocation)invocation);
     }
     NumGiven      = numGiven;
     BadParamIndex = badParamIndex;
     ClassifyDefinitionType(invocation, out DefType);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, when the rule or sequence
 /// with the given name does not exist or input or output parameters do not match.
 /// </summary>
 /// <param name="paramBindings">The parameter bindings of the rule/sequence invocation.</param>
 /// <param name="errorKind">The kind of error.</param>
 /// <param name="badParamIndex">The index of a bad parameter or -1 if another error occurred.</param>
 public SequenceParserException(InvocationParameterBindingsWithReturns paramBindings, SequenceParserError errorKind, int badParamIndex)
 {
     Kind = errorKind;
     Name = paramBindings.Name;
     if (paramBindings is RuleInvocationParameterBindings)
     {
         Action = ((RuleInvocationParameterBindings)paramBindings).Action;
     }
     NumGivenInputs  = paramBindings.Arguments.Length;
     NumGivenOutputs = paramBindings.ReturnVars.Length;
     BadParamIndex   = badParamIndex;
     ClassifyDefinitionType(paramBindings);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser,
 /// when the filter with the given name can't be applied to the rule of the given name
 /// or when the pattern of the rule of the given name does not contain an entity of the given name.
 /// </summary>
 /// <param name="ruleNameOrMatchClassName">Name of the rule or match class.</param>
 /// <param name="filterNameOrEntityName">Name of the filter which was mis-applied or name of the entity which is not conained in the rule.</param>
 /// <param name="errorKind">The kind of error.</param>
 public SequenceParserException(String ruleNameOrMatchClassName, String filterNameOrEntityName, SequenceParserError errorKind)
 {
     if (errorKind == SequenceParserError.FilterError ||
         errorKind == SequenceParserError.MatchClassError ||
         errorKind == SequenceParserError.MatchClassNotImplementedError ||
         errorKind == SequenceParserError.FilterParameterError)
     {
         FilterName = filterNameOrEntityName;
     }
     else
     {
         EntityName = filterNameOrEntityName;
     }
     Name = ruleNameOrMatchClassName;
     Kind = errorKind;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser,
 /// when the filter with the given name can't be applied to the rule of the given name
 /// or when the pattern of the rule of the given name does not contain an entity of the given name.
 /// </summary>
 /// <param name="ruleName">Name of the rule.</param>
 /// <param name="filterNameOrEntityName">Name of the filter which was mis-applied or name of the entity which is not conained in the rule.</param>
 /// <param name="errorKind">The kind of error.</param>
 public SequenceParserException(String ruleName, String filterNameOrEntityName, SequenceParserError errorKind)
 {
     if (errorKind == SequenceParserError.FilterError)
     {
         FilterName = filterNameOrEntityName;
     }
     else if (errorKind == SequenceParserError.FilterParameterError)
     {
         FilterName = filterNameOrEntityName;
     }
     else
     {
         EntityName = filterNameOrEntityName;
     }
     Name = ruleName;
     Kind = errorKind;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, when the function
 /// with the given name does not exist or input or output parameters do not match.
 /// </summary>
 /// <param name="paramBindings">The parameter bindings of the function invocation.</param>
 /// <param name="errorKind">The kind of error.</param>
 public SequenceParserException(InvocationParameterBindings paramBindings, SequenceParserError errorKind)
     : this(paramBindings, errorKind, -1)
 {
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, when the rule with the
 /// given name does not exist or input or output parameters do not match, or a method was called on a type not supporting this.
 /// </summary>
 /// <param name="ruleName">Name of the rule or sequence or variable.</param>
 /// <param name="errorKind">The kind of error.</param>
 public SequenceParserException(String name, SequenceParserError errorKind)
 {
     Name = name;
     Kind = errorKind;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser,
 /// when the expected type does not match the given type of the variable of function.
 /// </summary>
 public SequenceParserException(String varOrFuncName, String expectedType, String givenType)
 {
     VariableOrFunctionName = varOrFuncName;
     ExpectedType = expectedType;
     GivenType = givenType;
     Kind = SequenceParserError.TypeMismatch;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, when the function 
 /// with the given name does not exist or input or output parameters do not match.
 /// </summary>
 /// <param name="paramBindings">The parameter bindings of the function invocation.</param>
 /// <param name="errorKind">The kind of error.</param>
 /// <param name="badParamIndex">The index of a bad parameter or -1 if another error occurred.</param>
 public SequenceParserException(InvocationParameterBindings paramBindings, SequenceParserError errorKind, int badParamIndex)
 {
     Kind = errorKind;
     Name = paramBindings.Name;
     NumGivenInputs = paramBindings.Arguments.Length;
     BadParamIndex = badParamIndex;
     ClassifyDefinitionType(paramBindings);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser,
 /// when an operator is not available for the supplied types.
 /// </summary>
 public SequenceParserException(String varOrFuncName, String leftType, String rightType, String expression)
 {
     VariableOrFunctionName = varOrFuncName;
     LeftType = leftType;
     RightType = rightType;
     Expression = expression;
     Kind = SequenceParserError.OperatorNotFound;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, when the function
 /// with the given name does not exist or input or output parameters do not match.
 /// </summary>
 /// <param name="paramBindings">The parameter bindings of the function invocation.</param>
 /// <param name="errorKind">The kind of error.</param>
 public SequenceParserException(InvocationParameterBindings paramBindings, SequenceParserError errorKind)
     : this(paramBindings, errorKind, -1)
 {
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, when the rule with the
 /// given name does not exist or input or output parameters do not match, or a method was called on a type not supporting this.
 /// </summary>
 /// <param name="ruleName">Name of the rule or sequence or variable.</param>
 /// <param name="errorKind">The kind of error.</param>
 public SequenceParserException(String name, SequenceParserError errorKind)
 {
     Name = name;
     Kind = errorKind;
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser,
 /// when the filter with the given name can't be applied to the rule of the given name
 /// or when the pattern of the rule of the given name does not contain an entity of the given name.
 /// Allows to give a suggestion string hinting the user at a possible solution.
 /// </summary>
 /// <param name="ruleName">Name of the rule.</param>
 /// <param name="filterNameOrEntityName">Name of the filter which was mis-applied or name of the entity which is not conained in the rule.</param>
 /// <param name="errorKind">The kind of error.</param>
 /// <param name="suggestion">A suggestion to display to the user.</param>
 public SequenceParserException(String ruleName, String filterNameOrEntityName, SequenceParserError errorKind, String suggestion)
     : this(ruleName, filterNameOrEntityName, errorKind)
 {
     Suggestion = suggestion;
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, 
 /// when the filter with the given name can't be applied to the rule of the given name
 /// or when the pattern of the rule of the given name does not contain an entity of the given name.
 /// </summary>
 /// <param name="ruleName">Name of the rule.</param>
 /// <param name="filterNameOrEntityName">Name of the filter which was mis-applied or name of the entity which is not conained in the rule.</param>
 /// <param name="errorKind">The kind of error.</param>
 public SequenceParserException(String ruleName, String filterNameOrEntityName, SequenceParserError errorKind)
 {
     if(errorKind == SequenceParserError.FilterError)
         FilterName = filterNameOrEntityName;
     else if(errorKind == SequenceParserError.FilterParameterError)
         FilterName = filterNameOrEntityName;
     else
         EntityName = filterNameOrEntityName;
     Name = ruleName;
     Kind = errorKind;
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, when the rule or sequence 
 /// with the given name does not exist or input or output parameters do not match.
 /// </summary>
 /// <param name="paramBindings">The parameter bindings of the rule/sequence invocation.</param>
 /// <param name="errorKind">The kind of error.</param>
 /// <param name="badParamIndex">The index of a bad parameter or -1 if another error occurred.</param>
 public SequenceParserException(InvocationParameterBindingsWithReturns paramBindings, SequenceParserError errorKind, int badParamIndex)
 {
     Kind = errorKind;
     Name = paramBindings.Name;
     if(paramBindings is RuleInvocationParameterBindings)
         Action = ((RuleInvocationParameterBindings)paramBindings).Action;
     NumGivenInputs = paramBindings.Arguments.Length;
     NumGivenOutputs = paramBindings.ReturnVars.Length;
     BadParamIndex = badParamIndex;
     ClassifyDefinitionType(paramBindings);
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Creates an instance of a SequenceParserException used by the SequenceParser, when input or output parameters do not match
 /// for the rule/sequence/procedure/function.
 /// </summary>
 /// <param name="invocation">The rule/sequence/procedure/function invocation.</param>
 /// <param name="errorKind">The kind of error.</param>
 public SequenceParserException(Invocation invocation, int numGiven, SequenceParserError errorKind)
     : this(invocation, numGiven, errorKind, -1)
 {
 }