P13

@see <a href="http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#15.25">JLS section 15.25</a>
778378
Rule inlineIfExpressionChaining() {
		return Sequence(
				conditionalOrExpressionChaining().label("head"),
				set(),
				Optional(
						Sequence(
								Sequence(Ch('?'), TestNot(FirstOf(Ch('.'), Ch(':'), Ch('?')))).label("operator1"),
								group.basics.optWS(),
								assignmentExpressionChaining().label("tail1"),
								Ch(':').label("operator2"),
								group.basics.optWS(),
								inlineIfExpressionChaining().label("tail2")
								)),
				set(actions.createInlineIfExpression(value("head"),
						node("Optional/Sequence/operator1"), node("Optional/Sequence/operator2"),
						value("Optional/Sequence/tail1"), value("Optional/Sequence/tail2"))),
				group.basics.optWS());
	}
546287
function defineRules($, t) {
  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-Block
  $.RULE("block", () => {
    $.CONSUME(t.LCurly);
    $.OPTION(() => {
      $.SUBRULE($.blockStatements);
    });
    $.CONSUME(t.RCurly);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-BlockStatements
  $.RULE("blockStatements", () => {
    $.SUBRULE($.blockStatement);
    $.MANY(() => {
      $.SUBRULE2($.blockStatement);
    });
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-BlockStatement
  $.RULE("blockStatement", () => {
    const isLocalVariableDeclaration = this.BACKTRACK_LOOKAHEAD(
      $.isLocalVariableDeclaration
    );
    $.OR([
      {
        GATE: () => isLocalVariableDeclaration,
        ALT: () => $.SUBRULE($.localVariableDeclarationStatement)
      },
      {
        ALT: () => $.SUBRULE($.classDeclaration)
      },
      { ALT: () => $.SUBRULE($.statement) }
    ]);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-LocalVariableDeclaration
  $.RULE("localVariableDeclarationStatement", () => {
    $.SUBRULE($.localVariableDeclaration);
    $.CONSUME(t.Semicolon);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-LocalVariableDeclaration
  $.RULE("localVariableDeclaration", () => {
    $.MANY(() => {
      $.SUBRULE($.variableModifier);
    });
    $.SUBRULE($.localVariableType);
    $.SUBRULE($.variableDeclaratorList);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-LocalVariableType
  $.RULE("localVariableType", () => {
    $.OR([
      { ALT: () => $.SUBRULE($.unannType) },
      { ALT: () => $.CONSUME(t.Var) }
    ]);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-Statement
  $.RULE("statement", () => {
    $.OR([
      { ALT: () => $.SUBRULE($.statementWithoutTrailingSubstatement) },
      { ALT: () => $.SUBRULE($.labeledStatement) },
      // Spec deviation: combined "IfThenStatement" and "IfThenElseStatement"
      { ALT: () => $.SUBRULE($.ifStatement) },
      { ALT: () => $.SUBRULE($.whileStatement) },
      { ALT: () => $.SUBRULE($.forStatement) }
    ]);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-StatementWithoutTrailingSubstatement
  $.RULE("statementWithoutTrailingSubstatement", () => {
    $.OR([
      { ALT: () => $.SUBRULE($.block) },
      { ALT: () => $.SUBRULE($.emptyStatement) },
      { ALT: () => $.SUBRULE($.expressionStatement) },
      { ALT: () => $.SUBRULE($.assertStatement) },
      { ALT: () => $.SUBRULE($.switchStatement) },
      { ALT: () => $.SUBRULE($.doStatement) },
      { ALT: () => $.SUBRULE($.breakStatement) },
      { ALT: () => $.SUBRULE($.continueStatement) },
      { ALT: () => $.SUBRULE($.returnStatement) },
      { ALT: () => $.SUBRULE($.synchronizedStatement) },
      { ALT: () => $.SUBRULE($.throwStatement) },
      { ALT: () => $.SUBRULE($.tryStatement) }
    ]);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-EmptyStatement
  $.RULE("emptyStatement", () => {
    $.CONSUME(t.Semicolon);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-LabeledStatement
  $.RULE("labeledStatement", () => {
    $.CONSUME(t.Identifier);
    $.CONSUME(t.Colon);
    $.SUBRULE($.statement);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ExpressionStatement
  $.RULE("expressionStatement", () => {
    $.SUBRULE($.statementExpression);
    $.CONSUME(t.Semicolon);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-StatementExpression
  $.RULE("statementExpression", () => {
    // Spec deviation: The many alternatives here were replaced with
    //                 the "expression" rule as it contains them all,
    //                 and distinguishing between the alternatives cannot be done
    //                 using a fixed lookahead.
    // TODO: verify the resulting expression is one of the valid alternatives?
    $.SUBRULE($.expression);
  });

  // Spec deviation: combined "IfThenStatement" and "IfThenElseStatement"
  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-IfThenStatement
  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-IfThenElseStatement
  $.RULE("ifStatement", () => {
    $.CONSUME(t.If);
    $.CONSUME(t.LBrace);
    $.SUBRULE($.expression);
    $.CONSUME(t.RBrace);
    $.SUBRULE($.statement);
    $.OPTION(() => {
      $.CONSUME(t.Else);
      $.SUBRULE2($.statement);
    });
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-AssertStatement
  $.RULE("assertStatement", () => {
    $.CONSUME(t.Assert);
    $.SUBRULE($.expression);
    $.OPTION(() => {
      $.CONSUME(t.Colon);
      $.SUBRULE2($.expression);
    });
    $.CONSUME(t.Semicolon);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-SwitchStatement
  $.RULE("switchStatement", () => {
    $.CONSUME(t.Switch);
    $.CONSUME(t.LBrace);
    $.SUBRULE($.expression);
    $.CONSUME(t.RBrace);
    $.SUBRULE($.switchBlock);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-SwitchBlock
  $.RULE("switchBlock", () => {
    $.CONSUME(t.LCurly);
    $.MANY(() => {
      // Spec Deviation: refactored "switchBlock" for easy post-processing
      //                 each case and block together in the same rule.
      $.SUBRULE($.switchCase);
    });
    $.CONSUME(t.RCurly);
  });

  $.RULE("switchCase", () => {
    $.SUBRULE($.switchLabel);
    $.OPTION(() => {
      $.SUBRULE($.blockStatements);
    });
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-SwitchLabel
  $.RULE("switchLabel", () => {
    $.OR([
      {
        ALT: () => {
          $.CONSUME(t.Case);
          $.SUBRULE($.constantExpression);
          $.CONSUME(t.Colon);
        }
      },
      // SPEC Deviation: the variant with "enumConstantName" was removed
      // as it can be matched by the "constantExpression" variant
      // the distinction is semantic not syntactic.
      {
        ALT: () => {
          $.CONSUME(t.Default);
          $.CONSUME3(t.Colon);
        }
      }
    ]);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-EnumConstantName
  $.RULE("enumConstantName", () => {
    $.CONSUME(t.Identifier);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-WhileStatement
  $.RULE("whileStatement", () => {
    $.CONSUME(t.While);
    $.CONSUME(t.LBrace);
    $.SUBRULE($.expression);
    $.CONSUME(t.RBrace);
    $.SUBRULE($.statement);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-DoStatement
  $.RULE("doStatement", () => {
    $.CONSUME(t.Do);
    $.SUBRULE($.statement);
    $.CONSUME(t.While);
    $.CONSUME(t.LBrace);
    $.SUBRULE($.expression);
    $.CONSUME(t.RBrace);
    $.CONSUME(t.Semicolon);
  });
  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ForStatement
  $.RULE("forStatement", () => {
    $.OR([
      {
        GATE: () => this.BACKTRACK_LOOKAHEAD($.isBasicForStatement),
        ALT: () => $.SUBRULE($.basicForStatement)
      },
      { ALT: () => $.SUBRULE($.enhancedForStatement) }
    ]);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-BasicForStatement
  $.RULE("basicForStatement", () => {
    $.CONSUME(t.For);
    $.CONSUME(t.LBrace);
    $.OPTION(() => {
      $.SUBRULE($.forInit);
    });
    $.CONSUME(t.Semicolon);
    $.OPTION2(() => {
      $.SUBRULE($.expression);
    });
    $.CONSUME2(t.Semicolon);
    $.OPTION3(() => {
      $.SUBRULE($.forUpdate);
    });
    $.CONSUME(t.RBrace);
    $.SUBRULE($.statement);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ForInit
  $.RULE("forInit", () => {
    $.OR([
      {
        GATE: () => $.BACKTRACK_LOOKAHEAD($.isLocalVariableDeclaration),
        ALT: () => $.SUBRULE($.localVariableDeclaration)
      },
      { ALT: () => $.SUBRULE($.statementExpressionList) }
    ]);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ForUpdate
  $.RULE("forUpdate", () => {
    $.SUBRULE($.statementExpressionList);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-StatementExpressionList
  $.RULE("statementExpressionList", () => {
    $.SUBRULE($.statementExpression);
    $.MANY(() => {
      $.CONSUME(t.Comma);
      $.SUBRULE2($.statementExpression);
    });
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-EnhancedForStatement
  $.RULE("enhancedForStatement", () => {
    $.CONSUME(t.For);
    $.CONSUME(t.LBrace);
    $.MANY(() => {
      $.SUBRULE($.variableModifier);
    });
    $.SUBRULE($.localVariableType);
    $.SUBRULE($.variableDeclaratorId);
    $.CONSUME(t.Colon);
    $.SUBRULE($.expression);
    $.CONSUME(t.RBrace);
    $.SUBRULE($.statement);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-BreakStatement
  $.RULE("breakStatement", () => {
    $.CONSUME(t.Break);
    $.OPTION(() => {
      $.CONSUME(t.Identifier);
    });
    $.CONSUME(t.Semicolon);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ContinueStatement
  $.RULE("continueStatement", () => {
    $.CONSUME(t.Continue);
    $.OPTION(() => {
      $.CONSUME(t.Identifier);
    });
    $.CONSUME(t.Semicolon);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ReturnStatement
  $.RULE("returnStatement", () => {
    $.CONSUME(t.Return);
    $.OPTION(() => {
      $.SUBRULE($.expression);
    });
    $.CONSUME(t.Semicolon);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ThrowStatement
  $.RULE("throwStatement", () => {
    $.CONSUME(t.Throw);
    $.SUBRULE($.expression);
    $.CONSUME(t.Semicolon);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-SynchronizedStatement
  $.RULE("synchronizedStatement", () => {
    $.CONSUME(t.Synchronized);
    $.CONSUME(t.LBrace);
    $.SUBRULE($.expression);
    $.CONSUME(t.RBrace);
    $.SUBRULE($.block);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-TryStatement
  $.RULE("tryStatement", () => {
    $.OR([
      {
        ALT: () => {
          $.CONSUME(t.Try);
          $.SUBRULE($.block);
          $.OR2([
            {
              ALT: () => {
                $.SUBRULE($.catches);
                $.OPTION(() => {
                  $.SUBRULE($.finally);
                });
              }
            },
            { ALT: () => $.SUBRULE2($.finally) }
          ]);
        }
      },
      { ALT: () => $.SUBRULE($.tryWithResourcesStatement) }
    ]);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-Catches
  $.RULE("catches", () => {
    $.SUBRULE($.catchClause);
    $.MANY(() => {
      $.SUBRULE2($.catchClause);
    });
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-CatchClause
  $.RULE("catchClause", () => {
    $.CONSUME(t.Catch);
    $.CONSUME(t.LBrace);
    $.SUBRULE($.catchFormalParameter);
    $.CONSUME(t.RBrace);
    $.SUBRULE($.block);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-CatchFormalParameter
  $.RULE("catchFormalParameter", () => {
    $.MANY(() => {
      $.SUBRULE($.variableModifier);
    });
    $.SUBRULE($.catchType);
    $.SUBRULE($.variableDeclaratorId);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-CatchType
  $.RULE("catchType", () => {
    $.SUBRULE($.unannClassType);
    $.MANY(() => {
      $.CONSUME(t.Or);
      $.SUBRULE2($.classType);
    });
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-Finally
  $.RULE("finally", () => {
    $.CONSUME(t.Finally);
    $.SUBRULE($.block);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-TryWithResourcesStatement
  $.RULE("tryWithResourcesStatement", () => {
    $.CONSUME(t.Try);
    $.SUBRULE($.resourceSpecification);
    $.SUBRULE($.block);
    $.OPTION(() => {
      $.SUBRULE($.catches);
    });
    $.OPTION2(() => {
      $.SUBRULE($.finally);
    });
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ResourceSpecification
  $.RULE("resourceSpecification", () => {
    $.CONSUME(t.LBrace);
    $.SUBRULE($.resourceList);
    $.OPTION(() => {
      $.CONSUME(t.Semicolon);
    });
    $.CONSUME(t.RBrace);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-ResourceList
  $.RULE("resourceList", () => {
    $.SUBRULE($.resource);
    $.MANY({
      GATE: () => tokenMatcher($.LA(2).tokenType, t.RBrace) === false,
      DEF: () => {
        $.CONSUME(t.Semicolon);
        $.SUBRULE2($.resource);
      }
    });
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-Resource
  $.RULE("resource", () => {
    $.OR([
      {
        GATE: $.BACKTRACK($.resourceInit),
        // Spec Deviation: extracted this alternative to "resourceInit"
        //                 to enable backtracking.
        ALT: () => $.SUBRULE($.resourceInit)
      },
      { ALT: () => $.SUBRULE($.variableAccess) }
    ]);
  });

  // Spec Deviation: extracted from "resource"
  $.RULE("resourceInit", () => {
    $.MANY(() => {
      $.SUBRULE($.variableModifier);
    });
    $.SUBRULE($.localVariableType);
    $.CONSUME(t.Identifier);
    $.CONSUME(t.Equals);
    $.SUBRULE($.expression);
  });

  // https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-VariableAccess
  $.RULE("variableAccess", () => {
    // Spec Deviation: both "expressionName" and "fieldAccess" can be parsed
    //                 by the "primary" rule
    // TODO: verify that the primary is a fieldAccess or an expressionName.
    $.SUBRULE($.primary);
  });

  // ------------------------------------
  // Special optimized backtracking rules.
  // ------------------------------------
  $.RULE("isBasicForStatement", () => {
    $.CONSUME(t.For);
    $.CONSUME(t.LBrace);
    $.OPTION(() => {
      $.SUBRULE($.forInit);
    });
    $.CONSUME(t.Semicolon);
    // consuming the first semiColon distinguishes between
    // "basic" and "enhanced" for statements
    return true;
  });

  $.RULE("isLocalVariableDeclaration", () => {
    $.MANY(() => {
      $.SUBRULE($.variableModifier);
    });
    $.SUBRULE($.localVariableType);
    $.SUBRULE($.variableDeclaratorId);

    const nextTokenType = this.LA(1).tokenType;
    switch (nextTokenType) {
      // Int x;
      case t.Semicolon:
      // Int x, y, z;
      case t.Comma:
      // Int x = 5;
      case t.Equals:
        return true;
      default:
        return false;
    }
  });
}
267336
private static String nestedListToHtml( NestedList nl ){
		if( nl == null ) {
			return "null";
		}

		StringBuilder result = new StringBuilder();

		if( nl.getClass()==NestedListElement.class ){
			result.append( "<li>\n"+ contentElementToHtml( (NestedListElement)nl ) +"</li>\n" );
		}
		else{
			result.append("<table class=\"NestedList\">\n" +
					"<tr><th class=\"NestedList\">NestedList</th></tr>\n"+
					"<tr><td class=\"NestedList\">" );

			result.append((((NestedListContainer)nl).isNumbered()?"<ol>":"<ul>")+"\n" );
			for( NestedList nl2 : ((NestedListContainer)nl).getNestedLists() ) {
				result.append( nestedListToHtml( nl2 ) );
			}
			result.append((((NestedListContainer)nl).isNumbered()?"</ol>":"</ul>")+"\n");

			result.append("</td></tr>\n" );
			result.append("</table>\n");
		}

		return result.toString();
	}
525289
@Override
	public int doEndTag() throws JspException {

		try {

			BinaryResourcesHandler rsHandler = null;
			if ((rsHandler = (BinaryResourcesHandler) pageContext.getServletContext()
					.getAttribute(JawrConstant.BINARY_CONTEXT_ATTRIBUTE)) == null)
				throw new IllegalStateException(
						"Binary ResourceBundlesHandler not present in servlet context. Initialization of Jawr either failed or never occurred.");

			JawrConfig jawrConfig = rsHandler.getConfig();
			this.renderer = RendererFactory.getImgRenderer(jawrConfig, isPlainImage());
			this.renderer.renderImage(getImgSrcToRender(), getAttributeMap(), pageContext.getOut());
		} catch (IOException e) {
			throw new JspException(e);
		} finally {
			// Reset the Thread local for the Jawr context
			ThreadLocalJawrContext.reset();
		}

		return (EVAL_PAGE);
	}
1048961
public static String parsedPageToHtml( ParsedPage pp ){
		StringBuilder result = new StringBuilder();
		result.append(getHtmlHeader());

		if( pp != null ) {
    		//Title
    		result.append(
    			"<table class=\"ParsedPage\">\n"+
    			"<tr><th class=\"ParsedPage\">ParsedPage: \n" +
    			pp.getName()+
    			"</th></tr>\n");

//    		if( pp.aboutArticle()!=null ){
//    			result.append("<tr><td class=\"ParsedPage\">\n");
//    			result.append("About Article:" + contentElementToHtml( pp.aboutArticle() ));
//    			result.append("</td></tr>\n");
//    		}

    		//Sections
    		result.append(
    			"<tr><td class=\"ParsedPage\">\n"		);
    		for( Section s: pp.getSections() ) {
				result.append( sectionToHtml( s ));
			}
    		result.append(
    			"</td></tr>\n");

    		//Categories
    		if( pp.getCategoryElement()!= null ){
    			result.append("<tr><td class=\"ParsedPage\">\n");
    			result.append("Categories:\n"  + contentElementToHtml( pp.getCategoryElement() ));
    			result.append("</td></tr>\n");
    		}

    		//Languages
    		if( pp.getLanguagesElement()!= null ){
    			result.append("<tr><td class=\"ParsedPage\">\n");
    			result.append("Languages:\n"  + contentElementToHtml( pp.getLanguagesElement() ));
    			result.append("</td></tr>\n");
    		}

    		//Finalize
    		result.append("</table>\n");
        }

		result.append(getHtmlFooter());

		return result.toString();
	}
565371
@Override
    public int doEndTag() throws JspException {

        Tag t = findAncestorWithClass(this, I_CmsJspTagParamParent.class);
        if (t == null) {
            throw new JspTagException(Messages.get().getBundle(pageContext.getRequest().getLocale()).key(
                Messages.ERR_PARENTLESS_TAG_1,
                new Object[] {"param"}));
        }
        // take no action for null or empty names
        if (CmsStringUtil.isEmpty(m_name)) {
            return EVAL_PAGE;
        }

        // send the parameter to the appropriate ancestor
        I_CmsJspTagParamParent parent = (I_CmsJspTagParamParent)t;
        String value = m_value;
        if (value == null) {
            if ((bodyContent == null) || (bodyContent.getString() == null)) {
                value = "";
            } else {
                value = bodyContent.getString().trim();
            }
        }
        if (m_encode) {
            parent.addParameter(
                CmsEncoder.encode(m_name, OpenCms.getSystemInfo().getDefaultEncoding()),
                CmsEncoder.encode(value, OpenCms.getSystemInfo().getDefaultEncoding()));
        } else {
            parent.addParameter(m_name, value);
        }

        return EVAL_PAGE;
    }
243748
public static void html(StringBuilder sb, String html) {
        for (int i = 0; i < html.length(); i++) {
            char c = html.charAt(i);
            switch (c) {
            case '&':
                sb.append("&amp;");
                break;
            case '"':
                sb.append("&quot;");
                break;
            case '\'':
                sb.append("&apos;");
                break;
            case '<':
                sb.append("&lt;");
                break;
            case '>':
                sb.append("&gt;");
                break;
            default:
                sb.append(c);
            }
        }
    }
500757
public int doStartTag()
            throws JspException {
        ServletRequest req = pageContext.getRequest();
        HashMap atts = (HashMap) req.getAttribute(TEMPLATE_ATTRIBUTES);
        try {
            if (atts != null) {
                String val = (String) atts.get(_name);
                if (val != null) {
                    Writer out = pageContext.getOut();
                    out.write(val);
                }
                else {
                    Writer out = pageContext.getOut();
                    if (_defaultValue != null)
                        out.write(_defaultValue);
                    else
                        out.write("");
                }
            }
            else {
                Writer out = pageContext.getOut();
                if (_defaultValue != null)
                    out.write(_defaultValue);
                else
                    out.write("");
            }
        }
        catch (IOException e) {
            localRelease();
            JspException jspException = new JspException("Caught IO Exception:" + e.getMessage(),e);
            // todo: future cleanup
            // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
            // this will cause an IllegalStateException on the following call.
            if (jspException.getCause() == null) {
                jspException.initCause(e);
            }
            throw jspException;
        }
        localRelease();
        return EVAL_PAGE;
    }
1008824
function () {
                var negate, p = input.charAt(i + 1);

                if (input.charAt(i) === '-' && (p === '@' || p === '(')) { negate = $('-') }
                var o = $(this.sub) || $(this.entities.dimension) ||
                        $(this.entities.color) || $(this.entities.variable) ||
                        $(this.entities.call);

                if (negate) {
                    o.parensInOp = true;
                    o = new(tree.Negative)(o);
                }

                return o;
            }
555417
function highlight() {
    $('pre code').each(function (i, block) {
      hljs.highlightBlock(block);
    });
    $('pre code[highlight-lines]').each(function (i, block) {
      if (block.innerHTML === "") return;
      var lines = block.innerHTML.split('\n');

      queryString = block.getAttribute('highlight-lines');
      if (!queryString) return;

      var ranges = queryString.split(',');
      for (var j = 0, range; range = ranges[j++];) {
        var found = range.match(/^(\d+)\-(\d+)?$/);
        if (found) {
          // consider region as `{startlinenumber}-{endlinenumber}`, in which {endlinenumber} is optional
          var start = +found[1];
          var end = +found[2];
          if (isNaN(end) || end > lines.length) {
            end = lines.length;
          }
        } else {
          // consider region as a sigine line number
          if (isNaN(range)) continue;
          var start = +range;
          var end = start;
        }
        if (start <= 0 || end <= 0 || start > end || start > lines.length) {
          // skip current region if invalid
          continue;
        }
        lines[start - 1] = '<span class="line-highlight">' + lines[start - 1];
        lines[end - 1] = lines[end - 1] + '</span>';
      }

      block.innerHTML = lines.join('\n');
    });
  }
91489
@VisibleForTesting
  static Context parse(String text) {
    Queue<String> parts = Lists.newLinkedList(Arrays.asList(text.split(" ")));
    Context.Builder builder = HTML_PCDATA.toBuilder();
    builder.withState(HtmlContext.valueOf(parts.remove()));
    if (!parts.isEmpty()) {
      try {
        builder.withElType(ElementType.valueOf(parts.element()));
        parts.remove();
      } catch (IllegalArgumentException ex) {
        // OK
      }
    }
    if (!parts.isEmpty()) {
      try {
        builder.withAttrType(AttributeType.valueOf(parts.element()));
        parts.remove();
      } catch (IllegalArgumentException ex) {
        // OK
      }
    }
    if (!parts.isEmpty()) {
      try {
        builder.withDelimType(AttributeEndDelimiter.valueOf(parts.element()));
        parts.remove();
      } catch (IllegalArgumentException ex) {
        // OK
      }
    }
    if (!parts.isEmpty()) {
      try {
        builder.withSlashType(JsFollowingSlash.valueOf(parts.element()));
        parts.remove();
      } catch (IllegalArgumentException ex) {
        // OK
      }
    }
    if (!parts.isEmpty()) {
      try {
        builder.withUriPart(UriPart.valueOf(parts.element()));
        parts.remove();
      } catch (IllegalArgumentException ex) {
        // OK
      }
    }
    if (!parts.isEmpty()) {
      try {
        builder.withUriType(UriType.valueOf(parts.element()));
        parts.remove();
      } catch (IllegalArgumentException ex) {
        // OK
      }
    }
    if (!parts.isEmpty()) {
      String part = parts.element();
      String prefix = "templateNestDepth=";
      if (part.startsWith(prefix)) {
        try {
          builder.withTemplateNestDepth(Integer.parseInt(part.substring(prefix.length())));
          parts.remove();
        } catch (NumberFormatException ex) {
          // OK
        }
      }
    }
    if (!parts.isEmpty()) {
      String part = parts.element();
      String prefix = "jsTemplateLiteralNestDepth=";
      if (part.startsWith(prefix)) {
        try {
          builder.withJsTemplateLiteralNestDepth(Integer.parseInt(part.substring(prefix.length())));
          parts.remove();
        } catch (NumberFormatException ex) {
          // OK
        }
      }
    }
    if (!parts.isEmpty()) {
      throw new IllegalArgumentException(
          "Unable to parse context \"" + text + "\". Unparsed portion: " + parts);
    }
    Context result = builder.build();
    return result;
  }
1321362
public final void synpred137_Java_fragment() throws RecognitionException {
		// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:657:9: ( interfaceDeclaration ( ';' )? )
		// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:657:9: interfaceDeclaration ( ';' )?
		{
		pushFollow(FOLLOW_interfaceDeclaration_in_synpred137_Java2595);
		interfaceDeclaration();
		state._fsp--;
		if (state.failed) return;
		// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:657:30: ( ';' )?
		int alt209=2;
		int LA209_0 = input.LA(1);
		if ( (LA209_0==52) ) {
			alt209=1;
		}
		switch (alt209) {
			case 1 :
				// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:657:30: ';'
				{
				match(input,52,FOLLOW_52_in_synpred137_Java2597); if (state.failed) return;
				}
				break;

		}

		}

	}
575492
private void createIndexHTML(String siteRoot) throws CmsIllegalArgumentException, CmsException {

        if (!m_cms.existsResource(siteRoot + INDEX_HTML)) {
            //Create index.html
            I_CmsResourceType containerType = OpenCms.getResourceManager().getResourceType(
                org.opencms.file.types.CmsResourceTypeXmlContainerPage.RESOURCE_TYPE_NAME);
            m_cms.createResource(siteRoot + INDEX_HTML, containerType);
        }
    }
280745
function html()
	{
		$version = get_option('acf_version','1.0.5');
		$next = false;

		// list of starting points
		if( $version < '3.0.0' )
		{
			$next = '3.0.0';
		}
		elseif( $version < '3.1.8' )
		{
			$next = '3.1.8';
		}
		elseif( $version < '3.2.5' )
		{
			$next = '3.2.5';
		}
		elseif( $version < '3.3.3' )
		{
			$next = '3.3.3';
		}
		elseif( $version < '3.4.1' )
		{
			$next = '3.4.1';
		}

		?>
		<script type="text/javascript">
		(function($){

			function add_message(messaage)
			{
				$('#wpbody-content').append('<p>' + messaage + '</p>');
			}

			function run_upgrade(version)
			{
				$.ajax({
					url: ajaxurl,
					data: {
						action : 'acf_upgrade',
						version : version
					},
					type: 'post',
					dataType: 'json',
					success: function(json){

						if(json)
						{
							if(json.status)
							{
								add_message(json.message);

								// next update?
								if(json.next)
								{
									run_upgrade(json.next);
								}
								else
								{
									// all done
									add_message('Upgrade Complete! <a href="<?php echo admin_url(); ?>edit.php?post_type=acf">Continue to ACF &raquo;</a>');
								}
							}
							else
							{
								// error!
								add_message('Error: ' + json.message);
							}
						}
						else
						{
							// major error!
							add_message('Sorry. Something went wrong during the upgrade process. Please report this on the support forum');
						}
					}
				});
			}

			<?php if($next){ echo 'run_upgrade("' . $next . '");'; } ?>

		})(jQuery);
		</script>
		<style type="text/css">
			#message {
				display: none;
			}
		</style>
		<?php

		if(!$next)
		{
			echo '<p>No Upgrade Required</p>';
		}
	}
841448
@Override
    public String dialogBlockEnd() {

        StringBuffer result = new StringBuffer(8);
        result.append(super.dialogBlockEnd());
        result.append(dialogSpacer());
        result.append("</td></tr>\n");
        return result.toString();
    }
82582
public int doStartTag()
            throws JspException {
        Object source = evaluateDataSource();

        // report any errors that may have occured 
        if(hasErrors())
            return SKIP_BODY;

        _renderState = INIT;

        boolean empty = false;
        if(source != null) {
            _iterator = IteratorFactory.createIterator(source);
            if(_iterator == null) {
                LOGGER.warn(Bundle.getString("Tags_Repeater_nullIterator"));
                _iterator = Collections.EMPTY_LIST.iterator();
            }

            if(_iterator.hasNext()) {
                _currentIndex = 0;
                _currentItem = _iterator.next();

                if(_ignoreNulls && _currentItem == null) {
                    /*
                      doStartTag doesn't know if the repeater is structured or unstructured
                      thus, if ignoreNulls is true, it's going to make an attempt to go
                      through the body with a non-null item.  if there are no non-null
                      items in the data structure, the doAfterBody method will handle
                      this correctly, but a data structure with a null first item
                      will render the same as a data structure with a null second item
                     */
                    advanceToNonNullItem();

                    /*
                       this null check needs to re-run here because the advanceToNonNullItem method
                       side-effects the _currentItem.
                     */
                    if(_currentItem == null)
                        empty = true;
                }
            }
            /* there is no data set of there are zero items in the iterator */
            else empty = true;
        }
        /* the dataSource evaluated to null */
        else {
            _iterator = Collections.EMPTY_LIST.iterator();
            empty = true;
        }

        if(empty) {
            /* if the defaultText attribute is non-null, it will be evaluated as an expression and rendered to the page */
            if(_defaultText != null)
                addContent(_defaultText.toString());
            return SKIP_BODY;
        }
        else {
            DataAccessProviderStack.addDataAccessProvider(this, pageContext);
            _containerInPageContext = true;
            return EVAL_BODY_BUFFERED;
        }
    }
1173451
private boolean parseInstructions(final Page page, final DOMNode node, final String src, final boolean apply) throws FrameworkException {

		this.source          = src.toCharArray();
		this.sourceLength    = src.length();
		this.currentPosition = 0;
		boolean hit          = false;

		while (currentPosition < sourceLength) {

			if (findSequence("@structr:")) {

				// comment contains instruction, can be removed upon import
				hit = true;

				// currentPosition is now at the first letter of the actual instruction
				final String token    = getNextToken();
				final Handler handler = handlers.get(token);
				String parameters     = null;

				if (handler != null) {

					// additional characters..
					if (hasMore()) {

						final char c = source[currentPosition++];
						switch (c) {

							case '(':
								parameters = getUntilClosingParenthesis();
								break;

							case ',':
								// next instruction, ignore
								break;
						}
					}

					// only apply if instructed to (can be used to check
					// if the comment source actually contains instructions)
					if (apply) {

						handler.apply(page, node, parameters);
					}

				} else {

					logger.warn("Unknown token {}, expected one of {}.", new Object[] { token, handlers.keySet() });
					break;
				}
			}
		}

		return hit;
	}