Generate the given object.

@param breakStatement the break statement.
@param it the target for the generated content.
@param context the context.
@return the statement.
355797
@SuppressWarnings("static-method")
	protected XExpression _generate(SarlBreakExpression breakStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
		if (context.getExpectedExpressionType() == null) {
			it.append("break"); //$NON-NLS-1$
		} else {
			it.append("return ").append(toDefaultValue(context.getExpectedExpressionType().toJavaCompliantTypeReference())); //$NON-NLS-1$
		}
		return breakStatement;
	}
619723
protected void _generate(SarlEnumeration enumeration, PyAppendable it, IExtraLanguageGeneratorContext context) {
		generateEnumerationDeclaration(enumeration, it, context);
	}
325611
@SuppressWarnings("static-method")
	protected XExpression _generate(XNumberLiteral literal, IAppendable it, IExtraLanguageGeneratorContext context) {
		appendReturnIfExpectedReturnedExpression(it, context);
		it.append(literal.getValue());
		return literal;
	}
516102
public final BELScriptParser.statement_return statement() throws RecognitionException {
        BELScriptParser.statement_return retval = new BELScriptParser.statement_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token OPEN_PAREN50=null;
        Token CLOSE_PAREN54=null;
        Token STATEMENT_COMMENT56=null;
        BELScriptParser.outer_term_return outer_term48 = null;

        BELScriptParser.relationship_return relationship49 = null;

        BELScriptParser.outer_term_return outer_term51 = null;

        BELScriptParser.relationship_return relationship52 = null;

        BELScriptParser.outer_term_return outer_term53 = null;

        BELScriptParser.outer_term_return outer_term55 = null;


        Object OPEN_PAREN50_tree=null;
        Object CLOSE_PAREN54_tree=null;
        Object STATEMENT_COMMENT56_tree=null;

         paraphrases.push("in statement."); 
        try {
            // BELScript.g:135:5: ( outer_term ( relationship ( ( OPEN_PAREN outer_term relationship outer_term CLOSE_PAREN ) | outer_term ) )? ( STATEMENT_COMMENT )? )
            // BELScript.g:136:5: outer_term ( relationship ( ( OPEN_PAREN outer_term relationship outer_term CLOSE_PAREN ) | outer_term ) )? ( STATEMENT_COMMENT )?
            {
            root_0 = (Object)adaptor.nil();

            pushFollow(FOLLOW_outer_term_in_statement677);
            outer_term48=outer_term();

            state._fsp--;

            adaptor.addChild(root_0, outer_term48.getTree());
            // BELScript.g:136:16: ( relationship ( ( OPEN_PAREN outer_term relationship outer_term CLOSE_PAREN ) | outer_term ) )?
            int alt9=2;
            int LA9_0 = input.LA(1);

            if ( ((LA9_0>=103 && LA9_0<=130)) ) {
                alt9=1;
            }
            switch (alt9) {
                case 1 :
                    // BELScript.g:136:17: relationship ( ( OPEN_PAREN outer_term relationship outer_term CLOSE_PAREN ) | outer_term )
                    {
                    pushFollow(FOLLOW_relationship_in_statement680);
                    relationship49=relationship();

                    state._fsp--;

                    adaptor.addChild(root_0, relationship49.getTree());
                    // BELScript.g:136:30: ( ( OPEN_PAREN outer_term relationship outer_term CLOSE_PAREN ) | outer_term )
                    int alt8=2;
                    int LA8_0 = input.LA(1);

                    if ( (LA8_0==OPEN_PAREN) ) {
                        alt8=1;
                    }
                    else if ( ((LA8_0>=44 && LA8_0<=102)) ) {
                        alt8=2;
                    }
                    else {
                        NoViableAltException nvae =
                            new NoViableAltException("", 8, 0, input);

                        throw nvae;
                    }
                    switch (alt8) {
                        case 1 :
                            // BELScript.g:136:31: ( OPEN_PAREN outer_term relationship outer_term CLOSE_PAREN )
                            {
                            // BELScript.g:136:31: ( OPEN_PAREN outer_term relationship outer_term CLOSE_PAREN )
                            // BELScript.g:136:32: OPEN_PAREN outer_term relationship outer_term CLOSE_PAREN
                            {
                            OPEN_PAREN50=(Token)match(input,OPEN_PAREN,FOLLOW_OPEN_PAREN_in_statement684); 
                            OPEN_PAREN50_tree = (Object)adaptor.create(OPEN_PAREN50);
                            adaptor.addChild(root_0, OPEN_PAREN50_tree);

                            pushFollow(FOLLOW_outer_term_in_statement686);
                            outer_term51=outer_term();

                            state._fsp--;

                            adaptor.addChild(root_0, outer_term51.getTree());
                            pushFollow(FOLLOW_relationship_in_statement688);
                            relationship52=relationship();

                            state._fsp--;

                            adaptor.addChild(root_0, relationship52.getTree());
                            pushFollow(FOLLOW_outer_term_in_statement690);
                            outer_term53=outer_term();

                            state._fsp--;

                            adaptor.addChild(root_0, outer_term53.getTree());
                            CLOSE_PAREN54=(Token)match(input,CLOSE_PAREN,FOLLOW_CLOSE_PAREN_in_statement692); 
                            CLOSE_PAREN54_tree = (Object)adaptor.create(CLOSE_PAREN54);
                            adaptor.addChild(root_0, CLOSE_PAREN54_tree);


                            }


                            }
                            break;
                        case 2 :
                            // BELScript.g:136:93: outer_term
                            {
                            pushFollow(FOLLOW_outer_term_in_statement697);
                            outer_term55=outer_term();

                            state._fsp--;

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

                            }
                            break;

                    }


                    }
                    break;

            }

            // BELScript.g:136:107: ( STATEMENT_COMMENT )?
            int alt10=2;
            int LA10_0 = input.LA(1);

            if ( (LA10_0==STATEMENT_COMMENT) ) {
                alt10=1;
            }
            switch (alt10) {
                case 1 :
                    // BELScript.g:136:107: STATEMENT_COMMENT
                    {
                    STATEMENT_COMMENT56=(Token)match(input,STATEMENT_COMMENT,FOLLOW_STATEMENT_COMMENT_in_statement702); 
                    STATEMENT_COMMENT56_tree = (Object)adaptor.create(STATEMENT_COMMENT56);
                    adaptor.addChild(root_0, STATEMENT_COMMENT56_tree);


                    }
                    break;

            }


            }

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

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

             paraphrases.pop(); 
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
383117
protected XExpression _generate(XIfExpression ifStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
		it.append("if "); //$NON-NLS-1$
		generate(ifStatement.getIf(), it, context);
		it.append(":"); //$NON-NLS-1$
		it.increaseIndentation().newLine();
		if (ifStatement.getThen() != null) {
			generate(ifStatement.getThen(), context.getExpectedExpressionType(), it, context);
		} else if (context.getExpectedExpressionType() == null) {
			it.append("pass"); //$NON-NLS-1$
		} else {
			it.append("return ").append(toDefaultValue(context.getExpectedExpressionType().toJavaCompliantTypeReference())); //$NON-NLS-1$
		}
		it.decreaseIndentation();
		if (ifStatement.getElse() != null) {
			it.newLine().append("else:"); //$NON-NLS-1$
			it.increaseIndentation().newLine();
			generate(ifStatement.getElse(), context.getExpectedExpressionType(), it, context);
			it.decreaseIndentation();
		} else if (context.getExpectedExpressionType() != null) {
			it.newLine().append("else:"); //$NON-NLS-1$
			it.increaseIndentation().newLine();
			it.append("return ").append(toDefaultValue(context.getExpectedExpressionType().toJavaCompliantTypeReference())); //$NON-NLS-1$
			it.decreaseIndentation();
		}
		return ifStatement;
	}
1212637
static JndiContext createJndiContext() throws NamingException
    {
        try
        {
            if (!NamingManager.hasInitialContextFactoryBuilder())
            {
                JndiContext ctx = new JndiContext();
                NamingManager.setInitialContextFactoryBuilder(ctx);
                return ctx;
            }
            else
            {
                return (JndiContext) NamingManager.getInitialContext(null);
            }
        }
        catch (Exception e)
        {
            jqmlogger.error("Could not create JNDI context: " + e.getMessage());
            NamingException ex = new NamingException("Could not initialize JNDI Context");
            ex.setRootCause(e);
            throw ex;
        }
    }
147684
private String getStatement(final String className, final String methodName) {
    if (null == properties || (null == className && null == methodName)) {
      return null;
    }
    String statement = this.properties.getProperty(className + METHOD_TOKEN + methodName);
    if (null == statement) {
      statement = this.properties.getProperty(className + METHOD_TOKEN);
    }
    return null == statement ? this.properties.getProperty(METHOD_TOKEN + methodName) : statement;
  }
773515
private String generateSQLStatementForDataInTable(
			Map<String, Set<Integer>> dataSourceToUse, String tableToWrite)
	{
		StringBuffer output = new StringBuffer();
		for (Entry<String, Set<Integer>> e : dataSourceToUse.entrySet()) {

			String curTemplateName = e.getKey();

			Set<Integer> curPageIds = e.getValue();

			//FIXME Problem - we do reuse existing ids here, but we treat template names from the pages and from revisions separately - resulting in
			if (!curTemplateName.isEmpty() && !curPageIds.isEmpty()) {
				//if template name does not have an id in the tplname-id map
				String id = "LAST_INSERT_ID()";
				if (!tplNameToTplId.containsKey(curTemplateName)) {
					output.append("INSERT INTO "
							+ GeneratorConstants.TABLE_TPLID_TPLNAME
							+ " (templateName) VALUES ('" + curTemplateName
							+ "');");
					output.append("\r\n");
				}
				else {
					//if template name has an id in the tplname-id map
					id = tplNameToTplId.get(curTemplateName).toString();
				}

				StringBuilder curValues = new StringBuilder();
				for (Integer pId : curPageIds) {
					if (curValues.length() > 0) {
						curValues.append(",");
					}
					curValues.append("(" + id + ", ");
					curValues.append(pId);
					curValues.append(")");
				}
				output.append("REPLACE INTO " + tableToWrite + " VALUES "
						+ curValues + ";");
				output.append("\r\n");

			}
		}

		return output.toString();
	}
756750
protected void generateClosureDefinition(XClosure closure, IAppendable it, IExtraLanguageGeneratorContext context) {
		if (!it.hasName(closure)) {
			final LightweightTypeReference closureType0 = getExpectedType(closure);
			LightweightTypeReference closureType = closureType0;
			if (closureType0.isFunctionType()) {
				final FunctionTypeReference fctRef = closureType0.tryConvertToFunctionTypeReference(true);
				if (fctRef != null) {
					closureType = Utils.toLightweightTypeReference(fctRef.getType(), this.typeServices).getRawTypeReference();
				}
			}
			final String closureName = it.declareSyntheticVariable(closure, "__Jclosure_" //$NON-NLS-1$
					+ closureType.getSimpleName());
			final JvmDeclaredType rawType = (JvmDeclaredType) closureType.getType();
			final JvmOperation function = rawType.getDeclaredOperations().iterator().next();
			// Add the object type as super type because of an issue in the Python language.
			final JvmTypeReference objType = getTypeReferences().getTypeForName(Object.class, closure);
			it.openPseudoScope();
			it.append("class ").append(closureName).append("(") //$NON-NLS-1$//$NON-NLS-2$
				.append(closureType).append(",").append(objType.getType()).append("):") //$NON-NLS-1$ //$NON-NLS-2$
				.increaseIndentation().newLine().append("def ") //$NON-NLS-1$
				.append(function.getSimpleName()).append("(") //$NON-NLS-1$
				.append(getExtraLanguageKeywordProvider().getThisKeywordLambda().apply());
			for (final JvmFormalParameter param : closure.getFormalParameters()) {
				it.append(", "); //$NON-NLS-1$
				final String name = it.declareUniqueNameVariable(param, param.getName());
				it.append(name);
			}
			it.append("):"); //$NON-NLS-1$
			it.increaseIndentation().newLine();
			if (closure.getExpression() != null) {
				LightweightTypeReference returnType = closureType0;
				if (returnType.isFunctionType()) {
					final FunctionTypeReference fctRef = returnType.tryConvertToFunctionTypeReference(true);
					if (fctRef != null) {
						returnType = fctRef.getReturnType();
					} else {
						returnType = null;
					}
				} else {
					returnType = null;
				}
				//LightweightTypeReference returnType = getClosureOperationReturnType(type, operation);
				generate(closure.getExpression(), returnType, it, context);
			} else {
				it.append("pass"); //$NON-NLS-1$
			}
			it.decreaseIndentation().decreaseIndentation().newLine();
			it.closeScope();
		}
	}
524648
@SuppressWarnings("static-method")
	protected XExpression _generate(SarlContinueExpression continueStatement, IAppendable it, IExtraLanguageGeneratorContext context) {
		if (context.getExpectedExpressionType() == null) {
			it.append("continue"); //$NON-NLS-1$
		} else {
			it.append("return ").append(toDefaultValue(context.getExpectedExpressionType().toJavaCompliantTypeReference())); //$NON-NLS-1$
		}
		return continueStatement;
	}
1035111
function getBreakContext(state, label) {
    let context = state.breakContext;

    while (context) {
        if (label ? context.label === label : context.breakable) {
            return context;
        }
        context = context.upper;
    }

    /* istanbul ignore next: foolproof (syntax error) */
    return null;
}
441144
protected Statement createFailOnTimeoutStatement(
            Statement statement) throws Exception {
        return FailOnTimeout.builder()
            .withTimeout(timeout, timeUnit)
            .withLookingForStuckThread(lookForStuckThread)
            .build(statement);
    }
162594
private static StringBuffer generateBody(MetaEntity entity, Context context) {
		StringWriter sw = new StringWriter();
		PrintWriter pw = null;
		try {
			pw = new PrintWriter( sw );

			if ( context.addGeneratedAnnotation() ) {
				pw.println( writeGeneratedAnnotation( entity, context ) );
			}
			if ( context.isAddSuppressWarningsAnnotation() ) {
				pw.println( writeSuppressWarnings() );
			}

			pw.println( writeStaticMetaModelAnnotation( entity ) );

			printClassDeclaration( entity, pw, context );

			pw.println();

			List<MetaAttribute> members = entity.getMembers();
			for ( MetaAttribute metaMember : members ) {
				pw.println( "	" + metaMember.getDeclarationString() );
			}

			pw.println();
			pw.println( "}" );
			return sw.getBuffer();
		}
		finally {
			if ( pw != null ) {
				pw.close();
			}
		}
	}
1351567
private Object exec(StatementContext statement) {
    if (statement == null)
      return null;
    return statement.accept(visitor);
  }
1190516
protected By createBy(TestContext context) {
        if (by != null) {
            return by;
        }

        switch (property) {
            case "id":
                return By.id(context.replaceDynamicContentInString(propertyValue));
            case "class-name":
                return By.className(context.replaceDynamicContentInString(propertyValue));
            case "link-text":
                return By.linkText(context.replaceDynamicContentInString(propertyValue));
            case "css-selector":
                return By.cssSelector(context.replaceDynamicContentInString(propertyValue));
            case "name":
                return By.name(context.replaceDynamicContentInString(propertyValue));
            case "tag-name":
                return By.tagName(context.replaceDynamicContentInString(propertyValue));
            case "xpath":
                return By.xpath(context.replaceDynamicContentInString(propertyValue));
        }

        throw new CitrusRuntimeException("Unknown selector type: " + property);
    }
143185
protected void _generate(SarlAnnotationType annotation, IExtraLanguageGeneratorContext context) {
		final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(annotation);
		final PyAppendable appendable = createAppendable(jvmType, context);
		if (generateTypeDeclaration(
				this.qualifiedNameProvider.getFullyQualifiedName(annotation).toString(),
				annotation.getName(), false, Collections.emptyList(),
				getTypeBuilder().getDocumentation(annotation),
				true,
				annotation.getMembers(), appendable, context, null)) {
			final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(annotation);
			writeFile(name, appendable, context);
		}
	}
812166
function parseBreakStatement() {
        var token, label = null;

        expectKeyword('break');

        // Optimize the most common form: 'break;'.
        if (source[index] === ';') {
            lex();
            
            if (!(inIteration || inSwitch)) {
                throwError({}, Messages.IllegalBreak);
            }

            return {
                type: Syntax.BreakStatement,
                label: null
            };
        }

        if (peekLineTerminator()) {
            if (!(inIteration || inSwitch)) {
                throwError({}, Messages.IllegalBreak);
            }

            return {
                type: Syntax.BreakStatement,
                label: null
            };
        }

        token = lookahead();
        if (token.type === Token.Identifier) {
            label = parseVariableIdentifier();

            if (!Object.prototype.hasOwnProperty.call(labelSet, label.name)) {
                throwError({}, Messages.UnknownLabel, label.name);
            }
        }

        consumeSemicolon();

        if (label === null && !(inIteration || inSwitch)) {
            throwError({}, Messages.IllegalBreak);
        }

        return {
            type: Syntax.BreakStatement,
            label: label
        };
    }