<commit_before>/**
 * ConstantParamDec.java
 * ---------------------------------
 * Copyright (c) 2016
 * RESOLVE Software Research Group
 * School of Computing
 * Clemson University
 * All rights reserved.
 * ---------------------------------
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE.txt', which is part of this source code package.
 */
package edu.clemson.cs.rsrg.absyn.declarations.paramdecl;

import edu.clemson.cs.rsrg.absyn.declarations.Dec;
import edu.clemson.cs.rsrg.absyn.declarations.variabledecl.ParameterVarDec;
import edu.clemson.cs.rsrg.absyn.rawtypes.Ty;
import edu.clemson.cs.rsrg.parsing.data.PosSymbol;
import edu.clemson.cs.rsrg.typeandpopulate.entry.ProgramParameterEntry;

/**
 * <p>This is the class for all the constant parameter declaration objects
 * that the compiler builds using the ANTLR4 AST nodes.</p>
 *
 * @version 2.0
 */
public class ConstantParamDec extends Dec implements ModuleParameter {

    // ===========================================================
    // Member Fields
    // ===========================================================

    /** <p>The parameter variable.</p> */
    private final ParameterVarDec myParameterDec;

    // ===========================================================
    // Constructors
    // ===========================================================

    /**
     * <p>This constructs a constant variable that is passed as a parameter
     * to a module.</p>
     *
     * @param name A {@link PosSymbol} representing the variable's name.
     * @param ty A {@link Ty} representing the variable's raw type.
     */
    public ConstantParamDec(PosSymbol name, Ty ty) {
        super(name.getLocation(), name);
        myParameterDec =
                new ParameterVarDec(
                        ProgramParameterEntry.ParameterMode.EVALUATES, name, ty);
    }

    // ===========================================================
    // Public Methods
    // ===========================================================

    /**
     * {@inheritDoc}
     */
    @Override
    public final String asString(int indentSize, int innerIndentInc) {
        return myParameterDec.asString(indentSize, innerIndentInc);
    }

    // ===========================================================
    // Protected Methods
    // ===========================================================

    /**
     * {@inheritDoc}
     */
    @Override
    protected final ConstantParamDec copy() {
        return new ConstantParamDec(myName.clone(), myParameterDec.getTy()
                .clone());
    }

}<commit_msg>Added a getter for the parameter variable<commit_after>/**
 * ConstantParamDec.java
 * ---------------------------------
 * Copyright (c) 2016
 * RESOLVE Software Research Group
 * School of Computing
 * Clemson University
 * All rights reserved.
 * ---------------------------------
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE.txt', which is part of this source code package.
 */
package edu.clemson.cs.rsrg.absyn.declarations.paramdecl;

import edu.clemson.cs.rsrg.absyn.declarations.Dec;
import edu.clemson.cs.rsrg.absyn.declarations.variabledecl.ParameterVarDec;
import edu.clemson.cs.rsrg.absyn.rawtypes.Ty;
import edu.clemson.cs.rsrg.parsing.data.PosSymbol;
import edu.clemson.cs.rsrg.typeandpopulate.entry.ProgramParameterEntry;

/**
 * <p>This is the class for all the constant parameter declaration objects
 * that the compiler builds using the ANTLR4 AST nodes.</p>
 *
 * @version 2.0
 */
public class ConstantParamDec extends Dec implements ModuleParameter {

    // ===========================================================
    // Member Fields
    // ===========================================================

    /** <p>The parameter variable.</p> */
    private final ParameterVarDec myParameterDec;

    // ===========================================================
    // Constructors
    // ===========================================================

    /**
     * <p>This constructs a constant variable that is passed as a parameter
     * to a module.</p>
     *
     * @param name A {@link PosSymbol} representing the variable's name.
     * @param ty A {@link Ty} representing the variable's raw type.
     */
    public ConstantParamDec(PosSymbol name, Ty ty) {
        super(name.getLocation(), name);
        myParameterDec =
                new ParameterVarDec(
                        ProgramParameterEntry.ParameterMode.EVALUATES, name, ty);
    }

    // ===========================================================
    // Public Methods
    // ===========================================================

    /**
     * {@inheritDoc}
     */
    @Override
    public final String asString(int indentSize, int innerIndentInc) {
        return myParameterDec.asString(indentSize, innerIndentInc);
    }

    /**
     * <p>Returns the variable defined in this parameter declaration.</p>
     *
     * @return A {@link ParameterVarDec} representation object.
     */
    public final ParameterVarDec getVarDec() {
        return myParameterDec;
    }

    // ===========================================================
    // Protected Methods
    // ===========================================================

    /**
     * {@inheritDoc}
     */
    @Override
    protected final ConstantParamDec copy() {
        return new ConstantParamDec(myName.clone(), myParameterDec.getTy()
                .clone());
    }

}
{'fraction_non_alphanumeric': 0.28, 'fraction_numerical': 0.0025454545454545456, 'mean_word_length': 2.9978197674418605, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6276265', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1329, 'n_words': 350}