1 19 package org.netbeans.modules.ruby; 20 21 import java.util.List ; 22 import java.util.Set ; 23 import org.jruby.ast.Node; 24 import org.jruby.ast.RootNode; 25 import org.jruby.parser.RubyParserResult; 26 import org.netbeans.api.gsf.Element; 27 import org.netbeans.api.gsf.ParserFile; 28 import org.netbeans.api.gsf.ParserResult; 29 import org.netbeans.modules.ruby.elements.AstElement; 30 import org.netbeans.modules.ruby.elements.AstRootElement; 31 32 33 37 public class RubyParseResult extends ParserResult { 38 private AstTreeNode ast; 40 private Node root; 41 private RootNode realRoot; 42 private AstRootElement rootElement; 43 private String source; 44 private boolean sanitizedSource; 45 private List <Element> structureList; 46 private Set <String > requires; 47 private RubyParserResult jrubyResult; 48 private boolean commentsAdded; 49 50 53 public RubyParseResult(ParserFile file) { 54 super(file); 55 } 56 57 60 public RubyParseResult(ParserFile file, AstRootElement rootElement, AstTreeNode ast, Node root, 61 RootNode realRoot, RubyParserResult jrubyResult) { 62 super(file); 63 this.rootElement = rootElement; 64 this.ast = ast; 65 this.root = root; 66 this.realRoot = realRoot; 67 this.jrubyResult = jrubyResult; 68 } 69 70 public ParserResult.AstTreeNode getAst() { 71 return ast; 72 } 73 74 public void setAst(AstTreeNode ast) { 75 this.ast = ast; 76 } 77 78 @Override 79 public Element getRoot() { 80 return rootElement; 81 } 82 83 86 public Node getRootNode() { 87 return root; 88 } 89 90 public Node getRealRoot() { 91 return realRoot; 92 } 93 94 public String getSource() { 95 return source; 96 } 97 98 public void setSource(String source) { 99 this.source = source; 100 } 101 102 106 public boolean isSanitizedSource() { 107 return sanitizedSource; 108 } 109 110 114 public void setSanitizedSource(boolean sanitizedSource) { 115 this.sanitizedSource = sanitizedSource; 116 } 117 118 public RubyParserResult getJRubyResult() { 119 return jrubyResult; 120 } 121 122 public void setStructure(List <Element> structureList) { 123 this.structureList = structureList; 124 } 125 126 public List <?extends Element> getStructure() { 127 return structureList; 128 } 129 130 public Set <String > getRequires() { 131 return requires; 132 } 133 134 public void setRequires(Set <String > requires) { 135 this.requires = requires; 136 } 137 138 public boolean isCommentsAdded() { 139 return commentsAdded; 140 } 141 142 public void setCommentsAdded(boolean commentsAdded) { 143 this.commentsAdded = commentsAdded; 144 } 145 } 146 | Popular Tags |