KeywordArgNode.java

  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package org.jruby.ast;

  6. import java.util.List;
  7. import org.jruby.ast.visitor.NodeVisitor;
  8. import org.jruby.lexer.yacc.ISourcePosition;

  9. /**
  10.  *
  11.  * @author enebo
  12.  */
  13. public class KeywordArgNode extends Node {
  14.     private AssignableNode assignable;
  15.    
  16.     public KeywordArgNode(ISourcePosition position, AssignableNode assignable) {
  17.         super(position);
  18.         this.assignable = assignable;
  19.     }

  20.     @Override
  21.     public Object accept(NodeVisitor visitor) {
  22.         return visitor.visitKeywordArgNode(this);
  23.     }

  24.     @Override
  25.     public List<Node> childNodes() {
  26.         return Node.createList(assignable);
  27.     }

  28.     public int getIndex() {
  29.         return ((IScopedNode) assignable).getIndex();
  30.     }

  31.     @Override
  32.     public NodeType getNodeType() {
  33.         return NodeType.KEYWORDARGNODE;
  34.     }

  35.     public AssignableNode getAssignable() {
  36.         return assignable;
  37.     }
  38.    
  39. }