Пример #1
0
 public Combined(TokenList.Token start, TokenList.Token end)
 {
     TokenList.Token t = start;
     do
     {
         if (t.getVariable().getType() == VariableType.SCALAR)
         {
             sequences.Add(new Explicit(t));
         }
         else if (t.getVariable().getType() == VariableType.INTEGER_SEQUENCE)
         {
             sequences.Add(((VariableIntegerSequence)t.getVariable()).sequence);
         }
         else
         {
             throw new InvalidOperationException("Unexpected token type");
         }
         t = t.next;
     } while (t != null && t.previous != end);
 }
Пример #2
0
 public Explicit(TokenList.Token start, TokenList.Token end)
 {
     TokenList.Token t = start;
     while (true)
     {
         sequence.Add((VariableInteger)t.getVariable());
         if (t == end)
         {
             break;
         }
         else
         {
             t = t.next;
         }
     }
 }
Пример #3
0
 public For(TokenList.Token start, TokenList.Token step, TokenList.Token end)
 {
     this.start = (VariableInteger)start.getVariable();
     this.step  = step == null ? null : (VariableInteger)step.getVariable();
     this.end   = (VariableInteger)end.getVariable();
 }
Пример #4
0
 public Range(TokenList.Token start, TokenList.Token step)
 {
     this.start = start == null ? null : (VariableInteger)start.getVariable();
     this.step  = step == null ? null : (VariableInteger)step.getVariable();
 }
Пример #5
0
 public Explicit(TokenList.Token single)
 {
     sequence.Add((VariableInteger)single.getVariable());
 }