<commit_before>/*
 * Copyright (C) 2017, <NAME> <<EMAIL>>
 * All rights reserved.
 *
 * This software may be modified and distributed under the terms
 * of the BSD 3-clause license. See the LICENSE file for details.
 */

package io.proleap.cobol.asg.metamodel.call.impl;

import io.proleap.cobol.Cobol85Parser.SpecialRegisterContext;
import io.proleap.cobol.asg.metamodel.ProgramUnit;
import io.proleap.cobol.asg.metamodel.call.Call;
import io.proleap.cobol.asg.metamodel.call.SpecialRegisterCall;
import io.proleap.cobol.asg.metamodel.type.Type;

public class SpecialRegisterCallImpl extends CallImpl implements SpecialRegisterCall {

	protected final CallType callType = CallType.SPECIAL_REGISTER_CALL;

	protected final SpecialRegisterContext ctx;

	protected Call identifierCall;

	protected final SpecialRegisterType type;

	public SpecialRegisterCallImpl(final SpecialRegisterType type, final ProgramUnit programUnit,
			final SpecialRegisterContext ctx) {
		super(null, programUnit, ctx);

		this.ctx = ctx;
		this.type = type;
	}

	@Override
	public CallType getCallType() {
		return callType;
	}

	@Override
	public SpecialRegisterContext getCtx() {
		return ctx;
	}

	@Override
	public Call getIdentifierCall() {
		return identifierCall;
	}

	@Override
	public SpecialRegisterType getSpecialRegisterType() {
		return type;
	}

	@Override
	public Type getType() {
		return null;
	}

	@Override
	public void setIdentifierCall(final Call identifierCall) {
		this.identifierCall = identifierCall;
	}

}<commit_msg>added special register call value types<commit_after>/*
 * Copyright (C) 2017, <NAME> <<EMAIL>>
 * All rights reserved.
 *
 * This software may be modified and distributed under the terms
 * of the BSD 3-clause license. See the LICENSE file for details.
 */

package io.proleap.cobol.asg.metamodel.call.impl;

import io.proleap.cobol.Cobol85Parser.SpecialRegisterContext;
import io.proleap.cobol.asg.metamodel.ProgramUnit;
import io.proleap.cobol.asg.metamodel.call.Call;
import io.proleap.cobol.asg.metamodel.call.SpecialRegisterCall;
import io.proleap.cobol.asg.metamodel.type.CobolBaseType;
import io.proleap.cobol.asg.metamodel.type.Type;

public class SpecialRegisterCallImpl extends CallImpl implements SpecialRegisterCall {

	protected final CallType callType = CallType.SPECIAL_REGISTER_CALL;

	protected final SpecialRegisterContext ctx;

	protected Call identifierCall;

	protected final SpecialRegisterType type;

	public SpecialRegisterCallImpl(final SpecialRegisterType type, final ProgramUnit programUnit,
			final SpecialRegisterContext ctx) {
		super(null, programUnit, ctx);

		this.ctx = ctx;
		this.type = type;
	}

	@Override
	public CallType getCallType() {
		return callType;
	}

	@Override
	public SpecialRegisterContext getCtx() {
		return ctx;
	}

	@Override
	public Call getIdentifierCall() {
		return identifierCall;
	}

	@Override
	public SpecialRegisterType getSpecialRegisterType() {
		return type;
	}

	@Override
	public Type getType() {
		final Type result;

		switch (type) {
		case ADDRESS_OF:
			result = CobolBaseType.INTEGER;
			break;
		case LENGTH_OF:
			result = CobolBaseType.INTEGER;
			break;
		case LINAGE_COUNTER:
			result = CobolBaseType.INTEGER;
			break;
		case LINE_COUNTER:
			result = CobolBaseType.INTEGER;
			break;
		case PAGE_COUNTER:
			result = CobolBaseType.INTEGER;
			break;
		case SORT_FILE_SIZE:
			result = CobolBaseType.INTEGER;
			break;
		default:
			result = null;
			break;
		}

		return result;
	}

	@Override
	public void setIdentifierCall(final Call identifierCall) {
		this.identifierCall = identifierCall;
	}

}
{'fraction_non_alphanumeric': 0.08321775312066575, 'fraction_numerical': 0.003883495145631068, 'mean_word_length': 4.616822429906542, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '21053', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1153, 'n_words': 286}