<commit_before>/******************************************************************************
 * Copyright (c) 2000-2015 <NAME> AB
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/
package org.eclipse.titan.designer.AST.TTCN3.values;

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;

import org.eclipse.titan.designer.AST.ASTVisitor;
import org.eclipse.titan.designer.AST.Assignment;
import org.eclipse.titan.designer.AST.FieldSubReference;
import org.eclipse.titan.designer.AST.IReferenceChain;
import org.eclipse.titan.designer.AST.ISetting;
import org.eclipse.titan.designer.AST.ISubReference;
import org.eclipse.titan.designer.AST.IType;
import org.eclipse.titan.designer.AST.IType.Type_type;
import org.eclipse.titan.designer.AST.IValue;
import org.eclipse.titan.designer.AST.Identifier;
import org.eclipse.titan.designer.AST.Location;
import org.eclipse.titan.designer.AST.Reference;
import org.eclipse.titan.designer.AST.ReferenceChain;
import org.eclipse.titan.designer.AST.ReferenceFinder;
import org.eclipse.titan.designer.AST.ReferenceFinder.Hit;
import org.eclipse.titan.designer.AST.Scope;
import org.eclipse.titan.designer.AST.Value;
import org.eclipse.titan.designer.AST.ASN1.Value_Assignment;
import org.eclipse.titan.designer.AST.ASN1.types.ASN1_Sequence_Type;
import org.eclipse.titan.designer.AST.ASN1.types.ASN1_Set_Type;
import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type;
import org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Const;
import org.eclipse.titan.designer.AST.TTCN3.types.TTCN3_Sequence_Type;
import org.eclipse.titan.designer.AST.TTCN3.types.TTCN3_Set_Type;
import org.eclipse.titan.designer.parsers.CompilationTimeStamp;
import org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException;
import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater;

/**
 * @author <NAME>
 * */
public final class Referenced_Value extends Value {
	private static final String UNEXPECTEDCALL1 =
			"Reference to a value or template was expected instead of a call of {0}, which does not have a return type";
	private static final String UNEXPECTEDCALL2 =
			"Reference to a value was expected instead of a call of {0}, which does not have a return type";
	private static final String UNEXPECTEDASSIGNMENT1 = "Reference to a value or template was expected instead of {0}";
	private static final String UNEXPECTEDASSIGNMENT2 = "Reference to a value was expected instead of {0}";

	private static final String CIRCULARVALUEREFERENCE = "circular value reference chain: `{0}''";
	private static final String INFORMATIONFROMOBJECTNOTVALUE = "InformationFromObjects construct `{0}'' does not refer to a value";
	private static final String VALUERETURNEXPECTED =
			"Reference to a value was expected instead of a call of {0}, which does not have a return type";

	private final Reference reference;

	private IValue referencedValue;

	public Referenced_Value(final Reference reference) {
		this.reference = reference;

		if (reference != null) {
			reference.setFullNameParent(this);
		}
	}

	protected Referenced_Value(final Undefined_LowerIdentifier_Value original) {
		copyGeneralProperties(original);
		List<ISubReference> subReferences = new ArrayList<ISubReference>();
		subReferences.add(new FieldSubReference(original.getIdentifier()));
		reference = new Reference(null, subReferences);
		reference.setMyScope(myScope);
		reference.setLocation(original.getIdentifier().getLocation());
	}

	@Override
	public Value_type getValuetype() {
		return Value_type.REFERENCED_VALUE;
	}<commit_msg>Unused const String commented out<commit_after>/******************************************************************************
 * Copyright (c) 2000-2015 <NAME> AB
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/
package org.eclipse.titan.designer.AST.TTCN3.values;

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;

import org.eclipse.titan.designer.AST.ASTVisitor;
import org.eclipse.titan.designer.AST.Assignment;
import org.eclipse.titan.designer.AST.FieldSubReference;
import org.eclipse.titan.designer.AST.IReferenceChain;
import org.eclipse.titan.designer.AST.ISetting;
import org.eclipse.titan.designer.AST.ISubReference;
import org.eclipse.titan.designer.AST.IType;
import org.eclipse.titan.designer.AST.IType.Type_type;
import org.eclipse.titan.designer.AST.IValue;
import org.eclipse.titan.designer.AST.Identifier;
import org.eclipse.titan.designer.AST.Location;
import org.eclipse.titan.designer.AST.Reference;
import org.eclipse.titan.designer.AST.ReferenceChain;
import org.eclipse.titan.designer.AST.ReferenceFinder;
import org.eclipse.titan.designer.AST.ReferenceFinder.Hit;
import org.eclipse.titan.designer.AST.Scope;
import org.eclipse.titan.designer.AST.Value;
import org.eclipse.titan.designer.AST.ASN1.Value_Assignment;
import org.eclipse.titan.designer.AST.ASN1.types.ASN1_Sequence_Type;
import org.eclipse.titan.designer.AST.ASN1.types.ASN1_Set_Type;
import org.eclipse.titan.designer.AST.TTCN3.Expected_Value_type;
import org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Const;
import org.eclipse.titan.designer.AST.TTCN3.types.TTCN3_Sequence_Type;
import org.eclipse.titan.designer.AST.TTCN3.types.TTCN3_Set_Type;
import org.eclipse.titan.designer.parsers.CompilationTimeStamp;
import org.eclipse.titan.designer.parsers.ttcn3parser.ReParseException;
import org.eclipse.titan.designer.parsers.ttcn3parser.TTCN3ReparseUpdater;

/**
 * @author <NAME>
 * */
public final class Referenced_Value extends Value {
	private static final String UNEXPECTEDCALL1 =
			"Reference to a value or template was expected instead of a call of {0}, which does not have a return type";
	private static final String UNEXPECTEDCALL2 =
			"Reference to a value was expected instead of a call of {0}, which does not have a return type";
	private static final String UNEXPECTEDASSIGNMENT1 = "Reference to a value or template was expected instead of {0}";
	private static final String UNEXPECTEDASSIGNMENT2 = "Reference to a value was expected instead of {0}";

	//private static final String CIRCULARVALUEREFERENCE = "circular value reference chain: `{0}''";
	private static final String INFORMATIONFROMOBJECTNOTVALUE = "InformationFromObjects construct `{0}'' does not refer to a value";
	private static final String VALUERETURNEXPECTED =
			"Reference to a value was expected instead of a call of {0}, which does not have a return type";

	private final Reference reference;

	private IValue referencedValue;

	public Referenced_Value(final Reference reference) {
		this.reference = reference;

		if (reference != null) {
			reference.setFullNameParent(this);
		}
	}

	protected Referenced_Value(final Undefined_LowerIdentifier_Value original) {
		copyGeneralProperties(original);
		List<ISubReference> subReferences = new ArrayList<ISubReference>();
		subReferences.add(new FieldSubReference(original.getIdentifier()));
		reference = new Reference(null, subReferences);
		reference.setMyScope(myScope);
		reference.setLocation(original.getIdentifier().getLocation());
	}

	@Override
	public Value_type getValuetype() {
		return Value_type.REFERENCED_VALUE;
	}
{'fraction_non_alphanumeric': 0.13188518231186966, 'fraction_numerical': 0.00982673907421774, 'mean_word_length': 5.912421805183199, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2567097', 'n_tokens_mistral': 2393, 'n_tokens_neox': 2291, 'n_words': 552}