예제 #1
0
 private Location Location()
 {
     int index = lexer.SymbolIndex;
     VariableLocation location = new VariableLocation(index);
     Match(Token.Variable);
     if (lookahead == Token.LeftParen)
     {
         List<Expression> exprs = new List<Expression>();
         Match(Token.LeftParen);
         exprs.Add(Expression());
         while (lookahead == Token.Comma)
         {
             Match(Token.Comma);
             exprs.Add(Expression());
         }
         Match(Token.RightParen);
         return new ArrayElement(location, exprs.ToArray());
     }
     else return location;
 }
예제 #2
0
 public ArrayElement(VariableLocation loc, params Expression[] exprs)
 {
     this.location = loc;
     this.exprs = exprs;
 }