Return the Selector tree associated with a primed parser.

@return a selector tree.  If the parse was successful, the top node of the tree will
be of BOOLEAN type; otherwise, it will be of INVALID type.
974390
public Selector getSelector(String selector) {
    Selector ans;
    try {
      ans = QueryExpr();
      if (!ans.mayBeBoolean())
        ans.setType(Selector.INVALID);
    } catch (ParseException e) {
      // No FFDC code needed
      Object obj = null;
      ans = new LiteralImpl(obj);
      ans.setType(Selector.INVALID);
    }
    return ans;
  }
803585
private Node parseResultType() {
    skipEOLs();
    if (!match(JsDocToken.COLON)) {
      return newNode(Token.EMPTY);
    }

    next();
    skipEOLs();
    if (match(JsDocToken.STRING) && "void".equals(stream.getString())) {
      next();
      return newNode(Token.VOID);
    } else {
      return parseTypeExpression(next());
    }
  }
932636
final public TsurgeonPattern NodeSelection() throws ParseException {
 /*@bgen(jjtree) NodeSelection */
  SimpleNode jjtn000 = new SimpleNode(JJTNODESELECTION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);TsurgeonPattern result;
    try {
      result = NodeName();
    jjtree.closeNodeScope(jjtn000, true);
    jjtc000 = false;
    {if (true) return result;}
    } catch (Throwable jjte000) {
    if (jjtc000) {
      jjtree.clearNodeScope(jjtn000);
      jjtc000 = false;
    } else {
      jjtree.popNode();
    }
    if (jjte000 instanceof RuntimeException) {
      {if (true) throw (RuntimeException)jjte000;}
    }
    if (jjte000 instanceof ParseException) {
      {if (true) throw (ParseException)jjte000;}
    }
    {if (true) throw (Error)jjte000;}
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
    }
    }
    throw new Error("Missing return statement in function");
  }
420237
private ParseTree parseDoWhileStatement() {
    SourcePosition start = getTreeStartLocation();
    eat(TokenType.DO);
    ParseTree body = parseStatement();
    eat(TokenType.WHILE);
    eat(TokenType.OPEN_PAREN);
    ParseTree condition = parseExpression();
    eat(TokenType.CLOSE_PAREN);
    // The semicolon after the "do-while" is optional.
    if (peek(TokenType.SEMI_COLON)) {
      eat(TokenType.SEMI_COLON);
    }
    return new DoWhileStatementTree(getTreeLocation(start), body, condition);
  }
916442
final public Selector BooleanFactor() throws ParseException {
                             Selector child; boolean neg=false;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case NOT:
      jj_consume_token(NOT);
             neg = true;
      break;
    default:
      jj_la1[2] = jj_gen;
      ;
    }
    child = Predicate();
    if (neg) {if (true) return new OperatorImpl(Operator.NOT, child);}
    else {if (true) return child;}
    throw new Error("Missing return statement in function");
  }
1112759
public Node getNode() {
        if (node == null) {
            if (resource != null) {
                node = resource.adaptTo(Node.class);
            }
        }
        return node;
    }
632145
public static Boolean parserBoolean(JsonPullParser parser) throws IOException,
			JsonFormatException {

		State eventType = parser.getEventType();
		if (eventType == State.VALUE_NULL) {
			return null;
		} else if (eventType == State.VALUE_BOOLEAN) {
			return parser.getValueBoolean();
		} else {
			throw new IllegalStateException("unexpected state. expected=VALUE_BOOLEAN, but get="
					+ eventType.toString());
		}
	}
525072
private Content getTreeForClassHelper(TypeMirror type) {
        Content li = new HtmlTree(HtmlTag.LI);
        if (type.equals(typeElement.asType())) {
            Content typeParameters = getTypeParameterLinks(
                    new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE,
                    typeElement));
            if (configuration.shouldExcludeQualifier(utils.containingPackage(typeElement).toString())) {
                li.addContent(utils.asTypeElement(type).getSimpleName());
                li.addContent(typeParameters);
            } else {
                li.addContent(utils.asTypeElement(type).getQualifiedName());
                li.addContent(typeParameters);
            }
        } else {
            Content link = getLink(new LinkInfoImpl(configuration,
                    LinkInfoImpl.Kind.CLASS_TREE_PARENT, type)
                    .label(configuration.getClassName(utils.asTypeElement(type))));
            li.addContent(link);
        }
        return li;
    }
153888
protected static OptionParser getParser() {
            OptionParser parser = new OptionParser();
            // help options
            AdminParserUtils.acceptsHelp(parser);
            // required options
            AdminParserUtils.acceptsUrl(parser);
            // optional options
            AdminParserUtils.acceptsNodeMultiple(parser); // either
                                                          // --node or
                                                          // --all-nodes
            AdminParserUtils.acceptsAllNodes(parser); // either --node or
                                                      // --all-nodes
            AdminParserUtils.acceptsConfirm(parser);
            return parser;
        }
1240056
public Node parentNode() {

		if (currentNode == null)
			return null;

		Node node = getParentNode(currentNode);

		if (node != null)
			currentNode = node;

		return node;

	}
335542
private Map<String, ParseTreeNode> getHelperTokens() throws TreeException {
	Map<String, ParseTreeNode> helpers = new HashMap<String, ParseTreeNode>();
	ParseTreeNode helperTree = parserTree.getChild("Helper");
	ParseTreeNode helperDefinitions = helperTree.getChild("HelperDefinitions");
	for (ParseTreeNode helperDefinition : helperDefinitions
		.getChildren("HelperDefinition")) {
	    String identifier = helperDefinition.getChild("IDENTIFIER")
		    .getText();
	    helpers.put(identifier, helperDefinition);
	}
	return helpers;
    }
1046214
def get_node_type(tree):
    
    node_type = tree[0].label()
    assert node_type in NODE_TYPES, "node_type: {}".format(node_type)
    return node_type
662125
public static boolean isStaticSelector(JCTree base, Names names) {
        if (base == null)
            return false;
        switch (base.getTag()) {
            case IDENT:
                JCIdent id = (JCIdent)base;
                return id.name != names._this &&
                        id.name != names._super &&
                        isStaticSym(base);
            case SELECT:
                return isStaticSym(base) &&
                    isStaticSelector(((JCFieldAccess)base).selected, names);
            case TYPEAPPLY:
            case TYPEARRAY:
                return true;
            case ANNOTATED_TYPE:
                return isStaticSelector(((JCAnnotatedType)base).underlyingType, names);
            default:
                return false;
        }
    }
1242562
def get_nodes_by_selector(self, selector, not_selector=None):
        
        nodes = self.parsed(selector)

        if not_selector is not None:
            nodes = nodes.not_(not_selector)

        return nodes
342661
public static <T extends Tree> Matcher<T> isStatic() {
    return new Matcher<T>() {
      @Override
      public boolean matches(Tree tree, VisitorState state) {
        Symbol sym = ASTHelpers.getSymbol(tree);
        return sym != null && sym.isStatic();
      }
    };
  }
1282388
public DiffNode getChild(final List<ElementSelector> selectors)
	{
		Assert.notEmpty(selectors, "selectors");
		final ElementSelector selector = selectors.get(0);
		if (selectors.size() == 1)
		{
			if (selector == RootElementSelector.getInstance())
			{
				return isRootNode() ? this : null;
			}
			else
			{
				return getChild(selector);
			}
		}
		else if (selectors.size() > 1)
		{
			final DiffNode child;
			if (selector == RootElementSelector.getInstance())
			{
				child = isRootNode() ? this : null;
			}
			else
			{
				child = getChild(selector);
			}
			if (child != null)
			{
				return child.getChild(selectors.subList(1, selectors.size()));
			}
		}
		return null;
	}
509478
private Collection<Node> check(final Collection<Selector> parts) throws NodeSelectorException {
		Collection<Node> result = new LinkedHashSet<Node>();
		result.add(root);

		boolean initialPart=true;
		for (Selector selector : parts) {
			Checker<Node> checker = new TagChecker<Node>(helper, selector, initialPart);
			result = checker.check(result);
			if (selector.hasSpecifiers())
				for (Specifier specifier : selector.getSpecifiers()) {
					switch (specifier.getType()) {
					case ATTRIBUTE:
						checker = new AttributeSpecifierChecker<Node>(helper, (AttributeSpecifier) specifier);
						break;
					case PSEUDO:
						if (specifier instanceof PseudoClassSpecifier)
							checker = new PseudoClassSpecifierChecker<Node>(helper, (PseudoClassSpecifier) specifier);
						else if (specifier instanceof PseudoNthSpecifier)
							checker = new PseudoNthSpecifierChecker<Node>(helper, (PseudoNthSpecifier) specifier);
						else if (specifier instanceof PseudoContainsSpecifier)
							checker = new PseudoContainsSpecifierChecker<Node>(helper, (PseudoContainsSpecifier) specifier);

						break;

					case NEGATION:
						final Collection<Node> negationNodes = checkNegationSpecifier((NegationSpecifier) specifier);
						checker = new Checker<Node>() {
							@Override
							public List<Node> check(final Collection<Node> nodes) {
								Collection<Node> set = new LinkedHashSet<Node>(nodes);
								set.removeAll(negationNodes);
								return new ArrayList<Node>(set);
							}
						};
						break;
					}

					result = checker.check(result);
					if (result.isEmpty())
						// Bail out early.
						return result;
				}
			initialPart=false;
		}

		return result;
	}