hql.g:310:1: inCollectionElementsDeclaration : ( alias IN ELEMENTS OPEN path CLOSE -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) | ELEMENTS OPEN path CLOSE AS alias -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) );
768805
public final hqlParser.inCollectionElementsDeclaration_return inCollectionElementsDeclaration() throws RecognitionException {
		hqlParser.inCollectionElementsDeclaration_return retval = new hqlParser.inCollectionElementsDeclaration_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token IN105=null;
		Token ELEMENTS106=null;
		Token OPEN107=null;
		Token CLOSE109=null;
		Token ELEMENTS110=null;
		Token OPEN111=null;
		Token CLOSE113=null;
		Token AS114=null;
		ParserRuleReturnScope alias104 =null;
		ParserRuleReturnScope path108 =null;
		ParserRuleReturnScope path112 =null;
		ParserRuleReturnScope alias115 =null;

		CommonTree IN105_tree=null;
		CommonTree ELEMENTS106_tree=null;
		CommonTree OPEN107_tree=null;
		CommonTree CLOSE109_tree=null;
		CommonTree ELEMENTS110_tree=null;
		CommonTree OPEN111_tree=null;
		CommonTree CLOSE113_tree=null;
		CommonTree AS114_tree=null;
		RewriteRuleTokenStream stream_OPEN=new RewriteRuleTokenStream(adaptor,"token OPEN");
		RewriteRuleTokenStream stream_AS=new RewriteRuleTokenStream(adaptor,"token AS");
		RewriteRuleTokenStream stream_IN=new RewriteRuleTokenStream(adaptor,"token IN");
		RewriteRuleTokenStream stream_CLOSE=new RewriteRuleTokenStream(adaptor,"token CLOSE");
		RewriteRuleTokenStream stream_ELEMENTS=new RewriteRuleTokenStream(adaptor,"token ELEMENTS");
		RewriteRuleSubtreeStream stream_alias=new RewriteRuleSubtreeStream(adaptor,"rule alias");
		RewriteRuleSubtreeStream stream_path=new RewriteRuleSubtreeStream(adaptor,"rule path");

		try {
			// hql.g:311:2: ( alias IN ELEMENTS OPEN path CLOSE -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) | ELEMENTS OPEN path CLOSE AS alias -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias ) )
			int alt37=2;
			int LA37_0 = input.LA(1);
			if ( (LA37_0==IDENT) ) {
				alt37=1;
			}
			else if ( (LA37_0==ELEMENTS) ) {
				alt37=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 37, 0, input);
				throw nvae;
			}

			switch (alt37) {
				case 1 :
					// hql.g:311:4: alias IN ELEMENTS OPEN path CLOSE
					{
					pushFollow(FOLLOW_alias_in_inCollectionElementsDeclaration1446);
					alias104=alias();
					state._fsp--;

					stream_alias.add(alias104.getTree());
					IN105=(Token)match(input,IN,FOLLOW_IN_in_inCollectionElementsDeclaration1448);
					stream_IN.add(IN105);

					ELEMENTS106=(Token)match(input,ELEMENTS,FOLLOW_ELEMENTS_in_inCollectionElementsDeclaration1450);
					stream_ELEMENTS.add(ELEMENTS106);

					OPEN107=(Token)match(input,OPEN,FOLLOW_OPEN_in_inCollectionElementsDeclaration1452);
					stream_OPEN.add(OPEN107);

					pushFollow(FOLLOW_path_in_inCollectionElementsDeclaration1454);
					path108=path();
					state._fsp--;

					stream_path.add(path108.getTree());
					CLOSE109=(Token)match(input,CLOSE,FOLLOW_CLOSE_in_inCollectionElementsDeclaration1456);
					stream_CLOSE.add(CLOSE109);

					// AST REWRITE
					// elements: path, alias
					// token labels:
					// rule labels: retval
					// token list labels:
					// rule list labels:
					// wildcard labels:
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (CommonTree)adaptor.nil();
					// 312:3: -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias )
					{
						// hql.g:312:6: ^( JOIN[\"join\"] INNER[\"inner\"] path alias )
						{
						CommonTree root_1 = (CommonTree)adaptor.nil();
						root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(JOIN, "join"), root_1);
						adaptor.addChild(root_1, adaptor.create(INNER, "inner"));
						adaptor.addChild(root_1, stream_path.nextTree());
						adaptor.addChild(root_1, stream_alias.nextTree());
						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;
				case 2 :
					// hql.g:313:4: ELEMENTS OPEN path CLOSE AS alias
					{
					ELEMENTS110=(Token)match(input,ELEMENTS,FOLLOW_ELEMENTS_in_inCollectionElementsDeclaration1478);
					stream_ELEMENTS.add(ELEMENTS110);

					OPEN111=(Token)match(input,OPEN,FOLLOW_OPEN_in_inCollectionElementsDeclaration1480);
					stream_OPEN.add(OPEN111);

					pushFollow(FOLLOW_path_in_inCollectionElementsDeclaration1482);
					path112=path();
					state._fsp--;

					stream_path.add(path112.getTree());
					CLOSE113=(Token)match(input,CLOSE,FOLLOW_CLOSE_in_inCollectionElementsDeclaration1484);
					stream_CLOSE.add(CLOSE113);

					AS114=(Token)match(input,AS,FOLLOW_AS_in_inCollectionElementsDeclaration1486);
					stream_AS.add(AS114);

					pushFollow(FOLLOW_alias_in_inCollectionElementsDeclaration1488);
					alias115=alias();
					state._fsp--;

					stream_alias.add(alias115.getTree());
					// AST REWRITE
					// elements: path, alias
					// token labels:
					// rule labels: retval
					// token list labels:
					// rule list labels:
					// wildcard labels:
					retval.tree = root_0;
					RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

					root_0 = (CommonTree)adaptor.nil();
					// 314:3: -> ^( JOIN[\"join\"] INNER[\"inner\"] path alias )
					{
						// hql.g:314:6: ^( JOIN[\"join\"] INNER[\"inner\"] path alias )
						{
						CommonTree root_1 = (CommonTree)adaptor.nil();
						root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(JOIN, "join"), root_1);
						adaptor.addChild(root_1, adaptor.create(INNER, "inner"));
						adaptor.addChild(root_1, stream_path.nextTree());
						adaptor.addChild(root_1, stream_alias.nextTree());
						adaptor.addChild(root_0, root_1);
						}

					}


					retval.tree = root_0;

					}
					break;

			}
			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
503466
public static String pathJoin(final String... pathElements) {

        final String path;

        if (pathElements == null || pathElements.length == 0) {
            path = File.separator;

        } else {

            final StringBuffer sb = new StringBuffer();

            for (final String pathElement : pathElements) {

                if (pathElement.length() > 0) {
                    sb.append(pathElement);
                    sb.append(File.separator);
                }
            }

            if (sb.length() > 0) {
                sb.deleteCharAt(sb.length() - 1);
            }

            path = sb.toString();
        }

        return (path);
    }
1035208
@Override
    public void endElement( String uri, String localName, String qName )
        throws SAXException
    {
        flushCharacters();
        if ( stack.isEmpty() )
        {
            throw new IllegalStateException( "Stack must not be empty when closing the element " + qName
                + " around line " + locator.getLineNumber() + " and column " + locator.getColumnNumber() );
        }
        IndentCheckSaxHandler.ElementEntry startEntry = stack.pop();
        int indentDiff = lastIndent.size - startEntry.expectedIndent.size;
        int expectedIndent = startEntry.expectedIndent.size;
        if ( lastIndent.lineNumber != startEntry.foundIndent.lineNumber && indentDiff != 0 )
        {
            /*
             * diff should be zero unless we are on the same line as start element
             */
            int opValue = expectedIndent - lastIndent.size;
            String op = opValue > 0 ? "Insert" : "Delete";
            String units = opValue == 1 ? "space" : "spaces";
            String message = op + " " + Math.abs( opValue ) + " " + units + ". Expected " + expectedIndent + " found "
                + lastIndent.size + " spaces before end element </" + qName + ">";
            XmlFormatViolation violation =
                new XmlFormatViolation( file, locator.getLineNumber(), locator.getColumnNumber(), message );
            violationHandler.handle( violation );
        }
    }
292214
public final hqlParser.fromRange_return fromRange() throws RecognitionException {
		hqlParser.fromRange_return retval = new hqlParser.fromRange_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		ParserRuleReturnScope fromClassOrOuterQueryPath88 =null;
		ParserRuleReturnScope inClassDeclaration89 =null;
		ParserRuleReturnScope inCollectionDeclaration90 =null;
		ParserRuleReturnScope inCollectionElementsDeclaration91 =null;


		try {
			// hql.g:289:2: ( fromClassOrOuterQueryPath | inClassDeclaration | inCollectionDeclaration | inCollectionElementsDeclaration )
			int alt33=4;
			switch ( input.LA(1) ) {
			case IDENT:
				{
				int LA33_1 = input.LA(2);
				if ( (LA33_1==EOF||LA33_1==AS||LA33_1==CLOSE||LA33_1==COMMA||LA33_1==DOT||LA33_1==FETCH||LA33_1==FULL||LA33_1==GROUP||LA33_1==HAVING||LA33_1==IDENT||LA33_1==INNER||LA33_1==JOIN||LA33_1==LEFT||LA33_1==ORDER||LA33_1==RIGHT||LA33_1==SKIP||LA33_1==TAKE||LA33_1==UNION||LA33_1==WHERE) ) {
					alt33=1;
				}
				else if ( (LA33_1==IN) ) {
					int LA33_5 = input.LA(3);
					if ( (LA33_5==ELEMENTS) ) {
						alt33=4;
					}
					else if ( (LA33_5==CLASS||LA33_5==IDENT) ) {
						alt33=2;
					}

					else {
						int nvaeMark = input.mark();
						try {
							for (int nvaeConsume = 0; nvaeConsume < 3 - 1; nvaeConsume++) {
								input.consume();
							}
							NoViableAltException nvae =
								new NoViableAltException("", 33, 5, input);
							throw nvae;
						} finally {
							input.rewind(nvaeMark);
						}
					}

				}

				else {
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 33, 1, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}

				}
				break;
			case IN:
				{
				alt33=3;
				}
				break;
			case ELEMENTS:
				{
				alt33=4;
				}
				break;
			default:
				NoViableAltException nvae =
					new NoViableAltException("", 33, 0, input);
				throw nvae;
			}
			switch (alt33) {
				case 1 :
					// hql.g:289:4: fromClassOrOuterQueryPath
					{
					root_0 = (CommonTree)adaptor.nil();


					pushFollow(FOLLOW_fromClassOrOuterQueryPath_in_fromRange1302);
					fromClassOrOuterQueryPath88=fromClassOrOuterQueryPath();
					state._fsp--;

					adaptor.addChild(root_0, fromClassOrOuterQueryPath88.getTree());

					}
					break;
				case 2 :
					// hql.g:290:4: inClassDeclaration
					{
					root_0 = (CommonTree)adaptor.nil();


					pushFollow(FOLLOW_inClassDeclaration_in_fromRange1307);
					inClassDeclaration89=inClassDeclaration();
					state._fsp--;

					adaptor.addChild(root_0, inClassDeclaration89.getTree());

					}
					break;
				case 3 :
					// hql.g:291:4: inCollectionDeclaration
					{
					root_0 = (CommonTree)adaptor.nil();


					pushFollow(FOLLOW_inCollectionDeclaration_in_fromRange1312);
					inCollectionDeclaration90=inCollectionDeclaration();
					state._fsp--;

					adaptor.addChild(root_0, inCollectionDeclaration90.getTree());

					}
					break;
				case 4 :
					// hql.g:292:4: inCollectionElementsDeclaration
					{
					root_0 = (CommonTree)adaptor.nil();


					pushFollow(FOLLOW_inCollectionElementsDeclaration_in_fromRange1317);
					inCollectionElementsDeclaration91=inCollectionElementsDeclaration();
					state._fsp--;

					adaptor.addChild(root_0, inCollectionElementsDeclaration91.getTree());

					}
					break;

			}
			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
291085
public final hqlParser.inClassDeclaration_return inClassDeclaration() throws RecognitionException {
		hqlParser.inClassDeclaration_return retval = new hqlParser.inClassDeclaration_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token IN96=null;
		Token CLASS97=null;
		ParserRuleReturnScope alias95 =null;
		ParserRuleReturnScope path98 =null;

		CommonTree IN96_tree=null;
		CommonTree CLASS97_tree=null;
		RewriteRuleTokenStream stream_CLASS=new RewriteRuleTokenStream(adaptor,"token CLASS");
		RewriteRuleTokenStream stream_IN=new RewriteRuleTokenStream(adaptor,"token IN");
		RewriteRuleSubtreeStream stream_alias=new RewriteRuleSubtreeStream(adaptor,"rule alias");
		RewriteRuleSubtreeStream stream_path=new RewriteRuleSubtreeStream(adaptor,"rule path");

		try {
			// hql.g:301:2: ( alias IN ( CLASS )? path -> ^( RANGE path alias ) )
			// hql.g:301:4: alias IN ( CLASS )? path
			{
			pushFollow(FOLLOW_alias_in_inClassDeclaration1369);
			alias95=alias();
			state._fsp--;

			stream_alias.add(alias95.getTree());
			IN96=(Token)match(input,IN,FOLLOW_IN_in_inClassDeclaration1371);
			stream_IN.add(IN96);

			// hql.g:301:13: ( CLASS )?
			int alt36=2;
			int LA36_0 = input.LA(1);
			if ( (LA36_0==CLASS) ) {
				alt36=1;
			}
			switch (alt36) {
				case 1 :
					// hql.g:301:13: CLASS
					{
					CLASS97=(Token)match(input,CLASS,FOLLOW_CLASS_in_inClassDeclaration1373);
					stream_CLASS.add(CLASS97);

					}
					break;

			}

			pushFollow(FOLLOW_path_in_inClassDeclaration1376);
			path98=path();
			state._fsp--;

			stream_path.add(path98.getTree());
			// AST REWRITE
			// elements: alias, path
			// token labels:
			// rule labels: retval
			// token list labels:
			// rule list labels:
			// wildcard labels:
			retval.tree = root_0;
			RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.getTree():null);

			root_0 = (CommonTree)adaptor.nil();
			// 302:3: -> ^( RANGE path alias )
			{
				// hql.g:302:6: ^( RANGE path alias )
				{
				CommonTree root_1 = (CommonTree)adaptor.nil();
				root_1 = (CommonTree)adaptor.becomeRoot(adaptor.create(RANGE, "RANGE"), root_1);
				adaptor.addChild(root_1, stream_path.nextTree());
				adaptor.addChild(root_1, stream_alias.nextTree());
				adaptor.addChild(root_0, root_1);
				}

			}


			retval.tree = root_0;

			}

			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}
79843
public void endElement(String namespaceURI, String localName,
                           String qName) throws SAXException {
        trace("endElement:" + localName + "~" + qName);
        if (currentElement==null) {
            warn(qName + ": endElement before any startElement");
            return;
        }

        Node parentNode;
        boolean atDocumentRoot = false, foundTagToEnd = false;
        Element startElement = currentElement;

        while (!(foundTagToEnd || atDocumentRoot)) {
            parentNode = currentElement.getParentNode();

            if (parentNode.getNodeType()==Node.ELEMENT_NODE) {
                foundTagToEnd = isElementMatching(currentElement, qName);
                currentElement = (Element) parentNode;
            } else if (parentNode.getNodeType()==Node.DOCUMENT_NODE) {
                atDocumentRoot = true;
                if (startElement==currentDocument.getDocumentElement()) {
                    foundTagToEnd = isElementMatching(startElement, qName);
                } else {
                    currentElement = startElement;
                }
            } else {
                throw new IllegalArgumentException("Closing element " + qName
                                                   + ": expecting a parent ELEMENT_NODE but found " + parentNode);
            }
        }
        if (!foundTagToEnd) {
            warn(qName + ": endElement does not match startElement!");
        }
    }
1197031
public static ImmutableList<JoinOrFilterNode> extractFilterAndInnerJoinNodes(InnerJoinNode topJoinNode,
                                                                                 IntermediateQuery query) {

        ImmutableList.Builder<JoinOrFilterNode> joinAndFilterNodeBuilder = ImmutableList.builder();
        Queue<JoinOrFilterNode> nodesToExplore = new LinkedList<>();

        nodesToExplore.add(topJoinNode);
        joinAndFilterNodeBuilder.add(topJoinNode);

        while (!nodesToExplore.isEmpty()) {
            JoinOrFilterNode joinNode = nodesToExplore.poll();

            /**
             * Children: only considers the inner joins and the filter nodes.
             */
            for (QueryNode child : query.getChildren(joinNode)) {
                if ((child instanceof InnerJoinNode)
                        || (child instanceof FilterNode)) {

                    JoinOrFilterNode joinOrFilterChild = (JoinOrFilterNode) child;

                    // Continues exploring
                    nodesToExplore.add(joinOrFilterChild);
                    joinAndFilterNodeBuilder.add(joinOrFilterChild);
                }
            }
        }
        return joinAndFilterNodeBuilder.build();
    }
1106385
public static List<? extends Element> getEnclosedElementsDeclarationOrder(TypeElement type) {
        List<? extends Element> result = null;
        try {
            Object binding = field(type, "_binding");

            Class<?> sourceTypeBinding = null;
            {
                Class<?> c = binding.getClass();
                do {
                    if (c.getCanonicalName().equals(
                            "org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding")) {
                        sourceTypeBinding = c;
                        break;
                    }
                } while ((c = c.getSuperclass()) != null);
            }

            final List<Object> declarationOrder;
            if (sourceTypeBinding != null) {
                declarationOrder = findSourceOrder(binding);

                List<Element> enclosedElements = new ArrayList<Element>(type.getEnclosedElements());
                Collections.sort(enclosedElements, new Comparator<Element>() {

                    public int compare(Element o1, Element o2) {
                        try {
                            Object o1Binding = field(o1, "_binding");
                            Object o2Binding = field(o2, "_binding");

                            int i1 = declarationOrder.indexOf(o1Binding);
                            int i2 = declarationOrder.indexOf(o2Binding);

                            return i1 - i2;
                        } catch (Exception e) {
                            return 0;
                        }
                    }

                });
                result = enclosedElements;
            }
        } catch (Exception e) {
            // ignore
        }
        return (result != null) ? result : type.getEnclosedElements();
    }
208332
protected void addDescription(Element member, Content dlTree, SearchIndexItem si) {

        si.setContainingPackage(utils.getPackageName(utils.containingPackage(member)));
        si.setContainingClass(utils.getSimpleName(utils.getEnclosingTypeElement(member)));
        String name = utils.getSimpleName(member);
        if (utils.isExecutableElement(member)) {
            ExecutableElement ee = (ExecutableElement)member;
            name = name + utils.flatSignature(ee);
            si.setLabel(name);
            if (!((utils.signature(ee)).equals(utils.flatSignature(ee)))) {
                si.setUrl(getName(getAnchor(ee)));
            }

        }  else {
            si.setLabel(name);
        }
        si.setCategory(resources.getText("doclet.Members"));
        Content span = HtmlTree.SPAN(HtmlStyle.memberNameLink,
                getDocLink(LinkInfoImpl.Kind.INDEX, member, name));
        Content dt = HtmlTree.DT(span);
        dt.addContent(" - ");
        addMemberDesc(member, dt);
        dlTree.addContent(dt);
        Content dd = new HtmlTree(HtmlTag.DD);
        addComment(member, dd);
        dlTree.addContent(dd);
    }
1150875
function joinDeclarations(declarations) {
            const declaration = declarations[0];
            const body = Array.isArray(declaration.parent.parent.body) ? declaration.parent.parent.body : [];
            const currentIndex = body.findIndex(node => node.range[0] === declaration.parent.range[0]);
            const previousNode = body[currentIndex - 1];

            return fixer => {
                const type = sourceCode.getTokenBefore(declaration);
                const prevSemi = sourceCode.getTokenBefore(type);
                const res = [];

                if (previousNode && previousNode.kind === sourceCode.getText(type)) {
                    if (prevSemi.value === ";") {
                        res.push(fixer.replaceText(prevSemi, ","));
                    } else {
                        res.push(fixer.insertTextAfter(prevSemi, ","));
                    }
                    res.push(fixer.replaceText(type, ""));
                }

                return res;
            };
        }
620878
private ImmutableMultimap<RelationDefinition, ExtensionalDataNode> extractDataNodeMap(IntermediateQuery query,
                                                                                          InnerJoinNode joinNode) {
        return query.getChildren(joinNode).stream()
                .filter(c -> c instanceof ExtensionalDataNode)
                .map(c -> (ExtensionalDataNode) c)
                .map(c -> Maps.immutableEntry(c.getProjectionAtom().getPredicate().getRelationDefinition(), c))
                .collect(ImmutableCollectors.toMultimap());
    }
944404
private void visitMemberFunctionDefInObjectLit(Node n, Node parent) {
    String name = n.getString();
    Node nameNode = n.getFirstFirstChild();
    Node stringKey = withType(IR.stringKey(name, n.getFirstChild().detach()), n.getJSType());
    stringKey.setJSDocInfo(n.getJSDocInfo());
    parent.replaceChild(n, stringKey);
    stringKey.useSourceInfoFrom(nameNode);
    compiler.reportChangeToEnclosingScope(stringKey);
  }
758899
private ElementUI parentFromPath(String path) throws Exception {
        if (TOOLBAR_PATH.equalsIgnoreCase(path)) {
            return getDesktop().getToolbar();
        }
        
        String[] pieces = path.split(delim, 2);
        ElementTabPane tabPane = pieces.length == 0 ? null : findTabPane(pieces[0]);
        ElementUI parent = pieces.length < 2 ? null : getPathResolver().resolvePath(tabPane, pieces[1]);
        return parent == null ? tabPane : parent;
    }
691995
@SuppressWarnings("fallthrough")
    protected DCReference reference(boolean allowMember) throws ParseException {
        int pos = bp;
        int depth = 0;

        // scan to find the end of the signature, by looking for the first
        // whitespace not enclosed in () or <>, or the end of the tag
        loop:
        while (bp < buflen) {
            switch (ch) {
                case '\n': case '\r': case '\f':
                    newline = true;
                    // fallthrough

                case ' ': case '\t':
                    if (depth == 0)
                        break loop;
                    break;

                case '(':
                case '<':
                    newline = false;
                    depth++;
                    break;

                case ')':
                case '>':
                    newline = false;
                    --depth;
                    break;

                case '}':
                    if (bp == pos)
                        return null;
                    newline = false;
                    break loop;

                case '@':
                    if (newline)
                        break loop;
                    // fallthrough

                default:
                    newline = false;

            }
            nextChar();
        }

        if (depth != 0)
            throw new ParseException("dc.unterminated.signature");

        String sig = newString(pos, bp);

        // Break sig apart into qualifiedExpr member paramTypes.
        JCTree qualExpr;
        Name member;
        List<JCTree> paramTypes;

        Log.DeferredDiagnosticHandler deferredDiagnosticHandler
                = new Log.DeferredDiagnosticHandler(fac.log);

        try {
            int hash = sig.indexOf("#");
            int lparen = sig.indexOf("(", hash + 1);
            if (hash == -1) {
                if (lparen == -1) {
                    qualExpr = parseType(sig);
                    member = null;
                } else {
                    qualExpr = null;
                    member = parseMember(sig.substring(0, lparen));
                }
            } else {
                qualExpr = (hash == 0) ? null : parseType(sig.substring(0, hash));
                if (lparen == -1)
                    member = parseMember(sig.substring(hash + 1));
                else
                    member = parseMember(sig.substring(hash + 1, lparen));
            }

            if (lparen < 0) {
                paramTypes = null;
            } else {
                int rparen = sig.indexOf(")", lparen);
                if (rparen != sig.length() - 1)
                    throw new ParseException("dc.ref.bad.parens");
                paramTypes = parseParams(sig.substring(lparen + 1, rparen));
            }

            if (!deferredDiagnosticHandler.getDiagnostics().isEmpty())
                throw new ParseException("dc.ref.syntax.error");

        } finally {
            fac.log.popDiagnosticHandler(deferredDiagnosticHandler);
        }

        return m.at(pos).newReferenceTree(sig, qualExpr, member, paramTypes).setEndPos(bp);
    }
1352624
public void endElement(String uri, String name, String qName)
    {
        boolean isDebug = logger.isDebugEnabled();
        try
        {
            switch (getLiteralId(qName))
            {
                case MAPPING_REPOSITORY:
                    {
                        currentAttributeContainer = null;
                        break;
                    }
                case CLASS_DESCRIPTOR:
                    {
                        currentAttributeContainer = null;
                        break;
                    }
                case JDBC_CONNECTION_DESCRIPTOR:
                    {
                        logger.debug("   < " + tags.getTagById(JDBC_CONNECTION_DESCRIPTOR));
                        m_CurrentJCD = null;
                        currentAttributeContainer = null;
                        break;
                    }
                case CONNECTION_POOL:
                    {
                        logger.debug("   < " + tags.getTagById(CONNECTION_POOL));
                        currentAttributeContainer = m_CurrentJCD;
                        break;
                    }
                case SEQUENCE_MANAGER:
                    {
                        if (isDebug) logger.debug("    < " + tags.getTagById(SEQUENCE_MANAGER));
                        // set to null at the end of the tag!!
                        this.currentSequenceDescriptor = null;
                        currentAttributeContainer = m_CurrentJCD;
                        break;
                    }
                case OBJECT_CACHE:
                    {
                        if(currentAttributeContainer != null)
                        {
                            if (isDebug) logger.debug("    < " + tags.getTagById(OBJECT_CACHE));
                            // set to null or previous element level at the end of the tag!!
                            currentAttributeContainer = m_CurrentJCD;
                        }
                        break;
                    }
                case ATTRIBUTE:
                    {
                        if(currentAttributeContainer != null)
                        {
                            if (isDebug) logger.debug("      < " + tags.getTagById(ATTRIBUTE));
                        }
                        break;
                    }
                default :
                    {
                        // noop
                    }
            }
        }
        catch (Exception ex)
        {
            logger.error(ex);
            throw new PersistenceBrokerException(ex);
        }
    }
944471
def definition_for_nil_entry
      reference = @entry.at_xpath('./*/cda:outboundRelationship/cda:criteriaReference', HQMF2::Document::NAMESPACES)
      ref_id = nil
      unless reference.nil?
        ref_id = "#{HQMF2::Utilities.attr_val(reference, 'cda:id/@extension')}_#{HQMF2::Utilities.attr_val(reference, 'cda:id/@root')}"
      end
      reference_criteria = @data_criteria_references[strip_tokens(ref_id)] unless ref_id.nil?
      if reference_criteria
        # we only want to copy the reference criteria definition, status, and code_list_id if this is this is not a grouping criteria (i.e., there are no children)
        if @children_criteria.blank?
          @definition = reference_criteria.definition
          @status = reference_criteria.status
          if @specific_occurrence
            @title = reference_criteria.title
            @description = reference_criteria.description
            @code_list_id = reference_criteria.code_list_id
          end
        else
          # if this is a grouping data criteria (has children) mark it as derived and only pull title and description from the reference criteria
          @definition = 'derived'
          if @specific_occurrence
            @title = reference_criteria.title
            @description = reference_criteria.description
          end
        end
      else
        puts "MISSING_DC_REF: #{ref_id}" unless @variable
        @definition = 'variable'
      end
    end
649102
public final hqlParser.collectionExpr_return collectionExpr() throws RecognitionException {
		hqlParser.collectionExpr_return retval = new hqlParser.collectionExpr_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token ELEMENTS274=null;
		Token INDICES275=null;
		Token OPEN276=null;
		Token CLOSE278=null;
		ParserRuleReturnScope path277 =null;

		CommonTree ELEMENTS274_tree=null;
		CommonTree INDICES275_tree=null;
		CommonTree OPEN276_tree=null;
		CommonTree CLOSE278_tree=null;

		try {
			// hql.g:650:2: ( ( ELEMENTS ^| INDICES ^) OPEN ! path CLOSE !)
			// hql.g:650:4: ( ELEMENTS ^| INDICES ^) OPEN ! path CLOSE !
			{
			root_0 = (CommonTree)adaptor.nil();


			// hql.g:650:4: ( ELEMENTS ^| INDICES ^)
			int alt99=2;
			int LA99_0 = input.LA(1);
			if ( (LA99_0==ELEMENTS) ) {
				alt99=1;
			}
			else if ( (LA99_0==INDICES) ) {
				alt99=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 99, 0, input);
				throw nvae;
			}

			switch (alt99) {
				case 1 :
					// hql.g:650:5: ELEMENTS ^
					{
					ELEMENTS274=(Token)match(input,ELEMENTS,FOLLOW_ELEMENTS_in_collectionExpr3253);
					ELEMENTS274_tree = (CommonTree)adaptor.create(ELEMENTS274);
					root_0 = (CommonTree)adaptor.becomeRoot(ELEMENTS274_tree, root_0);

					}
					break;
				case 2 :
					// hql.g:650:17: INDICES ^
					{
					INDICES275=(Token)match(input,INDICES,FOLLOW_INDICES_in_collectionExpr3258);
					INDICES275_tree = (CommonTree)adaptor.create(INDICES275);
					root_0 = (CommonTree)adaptor.becomeRoot(INDICES275_tree, root_0);

					}
					break;

			}

			OPEN276=(Token)match(input,OPEN,FOLLOW_OPEN_in_collectionExpr3262);
			pushFollow(FOLLOW_path_in_collectionExpr3265);
			path277=path();
			state._fsp--;

			adaptor.addChild(root_0, path277.getTree());

			CLOSE278=(Token)match(input,CLOSE,FOLLOW_CLOSE_in_collectionExpr3267);
			}

			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
			retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);
		}
		finally {
			// do for sure before leaving
		}
		return retval;
	}