modules/ballerina-core/src/main/java/org/ballerinalang/model/builder/BLangModelBuilder.java
public void addParam(NodeLocation location, SimpleTypeName typeName, String paramName,
                         int annotationCount, boolean isReturnParam) {
        SymbolName symbolName = new SymbolName(paramName);

        // Check whether this parameter is already defined.
        BLangSymbol paramSymbol = currentScope.resolve(symbolName);
        if (paramSymbol != null && paramSymbol.getSymbolScope().getScopeName() == SymbolScope.ScopeName.LOCAL) {
            String errMsg = BLangExceptionHelper.constructSemanticError(location,
                    SemanticErrors.REDECLARED_SYMBOL, paramName);
            errorMsgs.add(errMsg);
        }

        ParameterDef paramDef = new ParameterDef(location, paramName, typeName, symbolName, currentScope);
        getAnnotationAttachments(annotationCount).forEach(attachment -> paramDef.addAnnotation(attachment));

        if (currentCUBuilder != null) {
            // Add the parameter to callableUnitBuilder.
            if (isReturnParam) {
                currentCUBuilder.addReturnParameter(paramDef);
            } else {
                currentCUBuilder.addParameter(paramDef);
            }

        } else {
            currentCUGroupBuilder.addParameter(paramDef);
        }

        currentScope.define(symbolName, paramDef);
    }
/**
     * <p>Create a function parameter and a corresponding variable reference expression.</p>
     * Set the even function to get the value from the function arguments with the correct index.
     * Store the reference in the symbol table.
     *
     * @param paramName name of the function parameter
     * @param location  Location of the parameter in the source file
     */
Create a function parameter and a corresponding variable reference expression.
Set the even function to get the value from the function arguments with the correct index.
Store the reference in the symbol table.

@param paramName name of the function parameter
@param location  Location of the parameter in the source file
Create a function parameter and a corresponding variable reference expression . Set the even function to get the value from the function arguments with the correct index . Store the reference in the symbol table . @param paramName name of the function parameter @param location Location of the parameter in the source file
public void addParam(NodeLocation location, SimpleTypeName typeName, String paramName,
                         int annotationCount, boolean isReturnParam) {
        SymbolName symbolName = new SymbolName(paramName);
        BLangSymbol paramSymbol = currentScope.resolve(symbolName);
        if (paramSymbol != null && paramSymbol.getSymbolScope().getScopeName() == SymbolScope.ScopeName.LOCAL) {
            String errMsg = BLangExceptionHelper.constructSemanticError(location,
                    SemanticErrors.REDECLARED_SYMBOL, paramName);
            errorMsgs.add(errMsg);
        }
        ParameterDef paramDef = new ParameterDef(location, paramName, typeName, symbolName, currentScope);
        getAnnotationAttachments(annotationCount).forEach(attachment -> paramDef.addAnnotation(attachment));
        if (currentCUBuilder != null) {
            if (isReturnParam) {
                currentCUBuilder.addReturnParameter(paramDef);
            } else {
                currentCUBuilder.addParameter(paramDef);
            }
        } else {
            currentCUGroupBuilder.addParameter(paramDef);
        }
        currentScope.define(symbolName, paramDef);
    }
public void addParam ( NodeLocation location , SimpleTypeName typeName , String paramName , int annotationCount , boolean isReturnParam ) { SymbolName symbolName = new SymbolName ( paramName ) ; BLangSymbol paramSymbol = currentScope . resolve ( symbolName ) ; if ( paramSymbol != null && paramSymbol . getSymbolScope ( ) . getScopeName ( ) == SymbolScope . ScopeName . LOCAL ) { String errMsg = BLangExceptionHelper . constructSemanticError ( location , SemanticErrors . REDECLARED_SYMBOL , paramName ) ; errorMsgs . add ( errMsg ) ; } ParameterDef paramDef = new ParameterDef ( location , paramName , typeName , symbolName , currentScope ) ; getAnnotationAttachments ( annotationCount ) . forEach ( attachment -> paramDef . addAnnotation ( attachment ) ) ; if ( currentCUBuilder != null ) { if ( isReturnParam ) { currentCUBuilder . addReturnParameter ( paramDef ) ; } else { currentCUBuilder . addParameter ( paramDef ) ; } } else { currentCUGroupBuilder . addParameter ( paramDef ) ; } currentScope . define ( symbolName , paramDef ) ; }
<p>Create a function parameter and a corresponding variable reference expression.</p>
 Set the even function to get the value from the function arguments with the correct index.
<p > Create a function parameter and a corresponding variable reference expression . < / p > Set the even function to get the value from the function arguments with the correct index .
// Check whether this parameter is already defined. // Add the parameter to callableUnitBuilder.