Exemplo n.º 1
0
 public static void AssertListCount(this StepSyntaxList syntaxList, int count)
 {
     if (syntaxList.Values.Count != count)
     {
         ReportError($"Expected list to contain {count} items but it contained {syntaxList.Values.Count}", syntaxList);
     }
 }
Exemplo n.º 2
0
 public static void AssertListCount(this StepSyntaxList syntaxList, int minCount, int maxCount)
 {
     if (syntaxList.Values.Count < minCount || syntaxList.Values.Count > maxCount)
     {
         ReportError($"Expected list to contain between {minCount} and {maxCount} items but it contained {syntaxList.Values.Count}", syntaxList);
     }
 }
Exemplo n.º 3
0
        public static double GetRealValueOrDefault(this StepSyntaxList syntaxList, int index, double defaultValue)
        {
            if (index < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(index));
            }

            if (index < syntaxList.Values.Count)
            {
                return(syntaxList.Values[index].GetRealVavlue());
            }
            else
            {
                return(defaultValue);
            }
        }
Exemplo n.º 4
0
 public static double GetRealValueOrDefault(this StepSyntaxList syntaxList, int index)
 {
     return(syntaxList.GetRealValueOrDefault(index, 0.0));
 }
Exemplo n.º 5
0
 public StepSimpleItemSyntax(StepKeywordToken keyword, StepSyntaxList parameters)
     : base(keyword.Line, keyword.Column)
 {
     Keyword    = keyword.Value;
     Parameters = parameters;
 }
Exemplo n.º 6
0
 public StepSimpleItemSyntax(string keyword, StepSyntaxList parameters)
     : base(-1, -1)
 {
     Keyword    = keyword;
     Parameters = parameters;
 }
 public StepHeaderMacroSyntax(string name, StepSyntaxList values)
     : base(values.Line, values.Column)
 {
     Name   = name;
     Values = values;
 }