Liest ein else if Statement ein. <br />
EBNF:<br />
<code>spaces condition spaces ")" spaces block;</code>

@return else if Statement
@throws TemplateException
558136
private final boolean elseifStatement(Data data, Condition cont) throws TemplateException {
	int pos = data.srcCode.getPos();
	if (!data.srcCode.forwardIfCurrent("else")) return false;

	comments(data);
	if (!data.srcCode.forwardIfCurrent("if", '(')) {
	    data.srcCode.setPos(pos);
	    return false;
	}

	Position line = data.srcCode.getPosition();
	Body body = new BodyBase(data.factory);
	Pair pair = cont.addElseIf(condition(data), body, line, null);

	if (!data.srcCode.forwardIfCurrent(')')) throw new TemplateException(data.srcCode, "else if statement must end with a [)]");
	// ex block
	Body prior = data.setParent(body);
	statement(data, body, CTX_ELSE_IF);
	data.setParent(prior);

	pair.end = data.srcCode.getPosition();
	return true;
    }
701514
private boolean processTemplateCommand(String cmdLine, int cmdTPosBegin, int cmdTPosEnd)
            throws MiniTemplator.TemplateSyntaxException {
        int p0 = skipBlanks(cmdLine, 0);
        if (p0 >= cmdLine.length()) {
            return false;
        }
        int p = skipNonBlanks(cmdLine, p0);
        String cmd = cmdLine.substring(p0, p);
        String parms = cmdLine.substring(p);
        /* select */
        if (cmd.equalsIgnoreCase("$beginBlock")) {
            processBeginBlockCmd(parms, cmdTPosBegin, cmdTPosEnd);
        } else if (cmd.equalsIgnoreCase("$endBlock")) {
            processEndBlockCmd(parms, cmdTPosBegin, cmdTPosEnd);
        } else if (cmd.equalsIgnoreCase("$include")) {
            processIncludeCmd(parms, cmdTPosBegin, cmdTPosEnd);
        } else if (cmd.equalsIgnoreCase("$if")) {
            processIfCmd(parms, cmdTPosBegin, cmdTPosEnd);
        } else if (cmd.equalsIgnoreCase("$elseIf")) {
            processElseIfCmd(parms, cmdTPosBegin, cmdTPosEnd);
        } else if (cmd.equalsIgnoreCase("$else")) {
            processElseCmd(parms, cmdTPosBegin, cmdTPosEnd);
        } else if (cmd.equalsIgnoreCase("$endIf")) {
            processEndIfCmd(parms, cmdTPosBegin, cmdTPosEnd);
        } else {
            if (cmd.startsWith("$") && !cmd.startsWith("${")) {
                throw new MiniTemplator.TemplateSyntaxException(
                        "Unknown command \"" + cmd + "\" in template at offset " + cmdTPosBegin + ".");
            } else {
                return false;
            }
        }
        return true;
    }
391784
public static <S, T extends Event> InputMapTemplate<S, T> unless(
            Predicate<? super S> condition, InputMapTemplate<S, T> imt) {
        return when(condition.negate(), imt);
    }
1000842
def ifdef(parser, token):
    
    block_tokens = ('elifdef', 'else', 'endifdef')
    # {% ifdef ... %}
    bits = token.split_contents()[1:]
    if len(bits) > 1:
        raise TemplateSyntaxError('%r is not an identifier.' % token)
    condition = IfDefParser(bits).parse()
    nodelist = parser.parse(block_tokens)
    conditions_nodelists = [(condition, nodelist)]
    token = parser.next_token()

    # {% elifdef ... %} (repeatable)
    while token.contents.startswith('elifdef'):
        bits = token.split_contents()[1:]
        if len(bits) > 1:
            raise TemplateSyntaxError('%r is not an identifier.' % token)
        condition = IfDefParser(bits).parse()
        nodelist = parser.parse(block_tokens)
        conditions_nodelists.append((condition, nodelist))
        token = parser.next_token()

    # {% else %} (optional)
    if token.contents == 'else':
        nodelist = parser.parse(block_tokens[-1:])
        conditions_nodelists.append((None, nodelist))
        token = parser.next_token()

    # {% endifdef %}
    assert token.contents == 'endifdef'

    return IfNode(conditions_nodelists)
858529
private final void switchBlock(Data data, Body body) throws TemplateException {
	while (data.srcCode.isValidIndex()) {
	    comments(data);
	    if (data.srcCode.isCurrent("case ") || data.srcCode.isCurrent("default", ':') || data.srcCode.isCurrent('}')) return;

	    Body prior = data.setParent(body);
	    statement(data, body, CTX_SWITCH);
	    data.setParent(prior);
	}
    }
426853
protected Expression string(Data data) throws TemplateException {

	// check starting character for a string literal
	if (!data.srcCode.isCurrent('"') && !data.srcCode.isCurrent('\'')) return null;
	Position line = data.srcCode.getPosition();

	// Init Parameter
	char quoter = data.srcCode.getCurrentLower();
	StringBuilder str = new StringBuilder();
	Expression expr = null;

	while (data.srcCode.hasNext()) {
	    data.srcCode.next();
	    // check sharp
	    if (data.srcCode.isCurrent('#')) {

		// Ecaped sharp
		if (data.srcCode.isNext('#')) {
		    data.srcCode.next();
		    str.append('#');
		}
		// get Content of sharp
		else {
		    data.srcCode.next();
		    comments(data);
		    Expression inner = assignOp(data);
		    comments(data);
		    if (!data.srcCode.isCurrent('#')) throw new TemplateException(data.srcCode, "Invalid Syntax Closing [#] not found");

		    ExprString exprStr = null;
		    if (str.length() != 0) {
			exprStr = data.factory.createLitString(str.toString(), line, data.srcCode.getPosition());
			if (expr != null) {
			    expr = data.factory.opString(expr, exprStr);
			}
			else expr = exprStr;
			str = new StringBuilder();
		    }
		    if (expr == null) {
			expr = inner;
		    }
		    else {
			expr = data.factory.opString(expr, inner);
		    }
		}
	    }
	    // check quoter
	    else if (data.srcCode.isCurrent(quoter)) {
		// Ecaped sharp
		if (data.srcCode.isNext(quoter)) {
		    data.srcCode.next();
		    str.append(quoter);
		}
		// finsish
		else {
		    break;
		}
	    }
	    // all other character
	    else {
		str.append(data.srcCode.getCurrent());
	    }
	}
	if (!data.srcCode.forwardIfCurrent(quoter)) throw new TemplateException(data.srcCode, "Invalid Syntax Closing [" + quoter + "] not found");

	if (expr == null) expr = data.factory.createLitString(str.toString(), line, data.srcCode.getPosition());
	else if (str.length() != 0) {
	    expr = data.factory.opString(expr, data.factory.createLitString(str.toString(), line, data.srcCode.getPosition()));
	}
	comments(data);

	if (expr instanceof Variable) {
	    Variable var = (Variable) expr;
	    var.fromHash(true);
	}

	return expr;

    }
619712
@Override
    public String next() {
        if (hasNext()) {
            if (enumerationSize == NULL_LOCALE_ENUMERATION_SIZE) {
                cursor++;
                return templateName;
            }
            final String language = matcher.group(1);
            final String country = matcher.group(2);
            switch (cursor) {
                case 0: cursor++; return templateName + FILE_SEPARATOR + language + FILE_SEPARATOR + country;
                case 1: cursor++; return templateName + FILE_SEPARATOR + language + UNDERSCORE + country;
                case 2: cursor++; return templateName + FILE_SEPARATOR + language;
                case 3: cursor++; return templateName + UNDERSCORE + language + UNDERSCORE + country;
                case 4: cursor++; return templateName + UNDERSCORE + language;
                case 5: cursor++; return templateName;
            }
        }
        String message = "No next available template name combination.";
        LOGGER.error(message);
        throw new IllegalStateException(message);
    }
887204
function(workspace) {
    var containerBlock = workspace.newBlock('controls_if_if');
    containerBlock.initSvg();
    var connection = containerBlock.nextConnection;
    for (var i = 1; i <= this.elseifCount_; i++) {
      var elseifBlock = workspace.newBlock('controls_if_elseif');
      elseifBlock.initSvg();
      connection.connect(elseifBlock.previousConnection);
      connection = elseifBlock.nextConnection;
    }
    if (this.elseCount_) {
      var elseBlock = workspace.newBlock('controls_if_else');
      elseBlock.initSvg();
      connection.connect(elseBlock.previousConnection);
    }
    return containerBlock;
  }
263938
public final BaseDescr conditionalExpression() throws RecognitionException {
		BaseDescr result = null;


		BaseDescr left =null;

		try {
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:169:5: (left= conditionalOrExpression ( ternaryExpression )? )
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:169:9: left= conditionalOrExpression ( ternaryExpression )?
			{
			pushFollow(FOLLOW_conditionalOrExpression_in_conditionalExpression820);
			left=conditionalOrExpression();
			state._fsp--;
			if (state.failed) return result;
			if ( state.backtracking==0 ) { if( buildDescr  ) { result = left; } }
			// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:170:9: ( ternaryExpression )?
			int alt17=2;
			int LA17_0 = input.LA(1);
			if ( (LA17_0==QUESTION) ) {
				alt17=1;
			}
			switch (alt17) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL5Expressions.g:170:9: ternaryExpression
					{
					pushFollow(FOLLOW_ternaryExpression_in_conditionalExpression832);
					ternaryExpression();
					state._fsp--;
					if (state.failed) return result;
					}
					break;

			}

			}

		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
		return result;
	}
652714
function() {
            var tpl = this.options.template;

            //first pass
            $.each(this.map, function(k, v) {
                v = v[0]; 
                var r = new RegExp(v+'+'),
                    token = v.length > 1 ? v.substring(1, 2) : v;
                    
                tpl = tpl.replace(r, '{'+token+'}');
            });

            //replace spaces with &nbsp;
            tpl = tpl.replace(/ /g, '&nbsp;');

            //second pass
            $.each(this.map, function(k, v) {
                v = v[0];
                var token = v.length > 1 ? v.substring(1, 2) : v;
                    
                tpl = tpl.replace('{'+token+'}', '<select class="'+k+'"></select>');
            });   

            return tpl;
        }
586465
private IfStatement parseIfStatement(Token token) throws IOException {
        SourceInfo info = token.getSourceInfo();

        Expression condition = parseExpression();

        if (!(condition instanceof ParenExpression)) {
            error("if.condition", condition.getSourceInfo());
        }

        Block thenPart = parseBlock();
        Block elsePart = null;

        token = peek();
        if (token.getID() != Token.ELSE) {
            info = info.setEndPosition(thenPart.getSourceInfo());
        }
        else {
            read(); // read the else keyword
            token = peek();
            if (token.getID() == Token.IF) {
                elsePart = new Block(parseIfStatement(read()));
            }
            else {
                elsePart = parseBlock();
            }

            info = info.setEndPosition(elsePart.getSourceInfo());
        }

        return new IfStatement(info, condition, thenPart, elsePart);
    }
451065
@Override
    public String validate(DTDValidatorBase v, char[] cbuf, int start, int end, boolean normalize)
        throws XMLStreamException
    {
        //int origStart = start;

        /* First things first; let's ensure value is not empty (all
         * white space)...
         */
        while (start < end && WstxInputData.isSpaceChar(cbuf[start])) {
            ++start;
        }
        // Empty value?
        if (start >= end) {
            return reportValidationProblem(v, "Empty NMTOKENS value");
        }

        /* Then, let's have separate handling for normalizing and
         * non-normalizing case, since latter is trivially easy case:
         */
        if (!normalize) {
            for (; start < end; ++start) {
                char c = cbuf[start];
                if (!WstxInputData.isSpaceChar(c) 
                    && !WstxInputData.isNameChar(c, mCfgNsAware, mCfgXml11)) {
                    return reportInvalidChar(v, c, "not valid as NMTOKENS character");
                }
            }
            return null; // ok, all good
        }

        //boolean trimmed = (origStart != start);
        //origStart = start;

        --end; // so that it now points to the last char
        // Wouldn't absolutely have to trim trailing... but is easy to do
        while (end > start && WstxInputData.isSpaceChar(cbuf[end])) {
            --end;
            //trimmed = true;
        }

        /* Ok, now, need to check we only have valid chars, and maybe
         * also coalesce multiple spaces, if any.
         */
        StringBuilder sb = null;

        while (start <= end) {
            int i = start;
            for (; i <= end; ++i) {
                char c = cbuf[i];
                if (WstxInputData.isSpaceChar(c)) {
                    break;
                }
                if (!WstxInputData.isNameChar(c, mCfgNsAware, mCfgXml11)) {
                    return reportInvalidChar(v, c, "not valid as an NMTOKENS character");
                }
            }

            if (sb == null) {
                sb = new StringBuilder(end - start + 1);
            } else {
                sb.append(' ');
            }
            sb.append(cbuf, start, (i - start));

            start = i + 1;
            // Ok, any white space to skip?
            while (start <= end && WstxInputData.isSpaceChar(cbuf[start])) {
                ++start;
            }
        }

        /* 27-Nov-2005, TSa: Could actually optimize trimming, and often
         *   avoid using StringBuilder... but let's only do it if it turns
         *   out dealing with NMTOKENS normalization shows up on profiling...
         */
        return sb.toString();
    }
805326
private final Switch switchStatement(Data data) throws TemplateException {
	if (!data.srcCode.forwardIfCurrent("switch", '(')) return null;

	Position line = data.srcCode.getPosition();

	comments(data);
	Expression expr = super.expression(data);
	comments(data);
	// end )
	if (!data.srcCode.forwardIfCurrent(')')) throw new TemplateException(data.srcCode, "switch statement must end with a [)]");
	comments(data);

	if (!data.srcCode.forwardIfCurrent('{')) throw new TemplateException(data.srcCode, "switch statement must have a starting  [{]");

	Switch swit = new Switch(expr, line, null);

	// cases
	// Node child=null;
	comments(data);
	while (caseStatement(data, swit)) {
	    comments(data);
	}
	// default
	if (defaultStatement(data, swit)) {
	    comments(data);
	}

	while (caseStatement(data, swit)) {
	    comments(data);
	}

	// }
	if (!data.srcCode.forwardIfCurrent('}')) throw new TemplateException(data.srcCode, "invalid construct in switch statement");
	swit.setEnd(data.srcCode.getPosition());
	return swit;
    }
775708
public EvaluatedTemplate evaluateTemplate(String template, EvaluationContext context) {
        return evaluateTemplate(template, context, false);
    }
1264674
private static String negate(String conditionTemplate) {
    if (conditionTemplate.startsWith("!")
        && !BOOLEAN_BINARY_OPERATOR.matcher(conditionTemplate).find()) {
      return conditionTemplate.substring(1);
    } else if (ANY_OPERATOR.matcher(conditionTemplate).find()) {
      // The condition might already enclosed in a bracket, but we can't simply check for opening
      // and closing brackets at the start and end of the string, as that misses cases like
      // (a || b) && (c || d). Attempting to determine if the initial and closing bracket are paired
      // requires understanding character constants and strings constants, so for simplicity we
      // just add unnecessary brackets.
      return "!(" + conditionTemplate + ")";
    } else {
      return "!" + conditionTemplate;
    }
  }
1363906
private final boolean caseStatement(Data data, Switch swit) throws TemplateException {
	if (!data.srcCode.forwardIfCurrentAndNoWordAfter("case")) return false;

	// int line=data.srcCode.getLine();
	comments(data);
	Expression expr = super.expression(data);
	comments(data);

	if (!data.srcCode.forwardIfCurrent(':')) throw new TemplateException(data.srcCode, "case body must start with [:]");

	Body body = new BodyBase(data.factory);
	switchBlock(data, body);
	swit.addCase(expr, body);
	return true;
    }
547131
private function _if() {
    $node = new IfNode();
    $this->mustMatch(T_IF, $node);
    $this->condition($node, 'condition');
    if ($this->tryMatch(':', $node, 'openColon', FALSE, TRUE)) {
      $node->addChild($this->innerIfInnerStatementList(), 'then');
      while ($this->currentType === T_ELSEIF) {
        $this->matchHidden($node);
        $elseIf = new ElseIfNode();
        $this->mustMatch(T_ELSEIF, $elseIf);
        $this->condition($elseIf, 'condition');
        $this->mustMatch(':', $elseIf, 'openColon', FALSE, TRUE);
        $elseIf->addChild($this->innerIfInnerStatementList(), 'then');
        $node->addChild($elseIf);
      }
      if ($this->tryMatch(T_ELSE, $node, 'elseKeyword')) {
        $this->mustMatch(':', $node, 'elseColon', FALSE, TRUE);
        $node->addChild($this->innerStatementListNode(T_ENDIF), 'else');
      }
      $this->mustMatch(T_ENDIF, $node, 'endKeyword');
      $this->endStatement($node);
      return $node;
    }
    else {
      $this->matchHidden($node);
      $node->addChild($this->statement(), 'then');
      while ($this->currentType === T_ELSEIF) {
        $this->matchHidden($node);
        $elseIf = new ElseIfNode();
        $this->mustMatch(T_ELSEIF, $elseIf);
        $this->condition($elseIf, 'condition');
        $this->matchHidden($elseIf);
        $elseIf->addChild($this->statement(), 'then');
        $node->addChild($elseIf);
      }
      if ($this->tryMatch(T_ELSE, $node, 'elseKeyword', FALSE, TRUE)) {
        $node->addChild($this->statement(), 'else');
      }
      return $node;
    }
  }