From add47f42600c80c7f952e2aa65eaf614c4a3027c Mon Sep 17 00:00:00 2001 From: Adam Knapp <adam.knapp@ericsson.com> Date: Tue, 22 Oct 2024 14:28:31 +0200 Subject: [PATCH] Refactoring enum 'Type_type' (issue #62) Signed-off-by: Adam Knapp <adam.knapp@ericsson.com> --- .../AST/ASN1/types/ASN1_BitString_Type.java | 4 +- .../lsp/AST/ASN1/types/ASN1_Choice_Type.java | 2 +- .../AST/ASN1/types/ASN1_Enumerated_Type.java | 2 +- .../lsp/AST/ASN1/types/ASN1_Integer_Type.java | 4 +- .../AST/ASN1/types/ASN1_Sequence_Type.java | 2 +- .../lsp/AST/ASN1/types/ASN1_Set_Type.java | 2 +- .../titan/lsp/AST/ASN1/types/Any_Type.java | 6 +- .../lsp/AST/ASN1/types/BMPString_Type.java | 2 +- .../lsp/AST/ASN1/types/Embedded_PDV_Type.java | 7 +- .../lsp/AST/ASN1/types/External_Type.java | 6 +- .../AST/ASN1/types/GeneralString_Type.java | 2 +- .../AST/ASN1/types/GeneralizedTime_Type.java | 2 +- .../AST/ASN1/types/GraphicString_Type.java | 2 +- .../lsp/AST/ASN1/types/IA5String_Type.java | 2 +- .../titan/lsp/AST/ASN1/types/NULL_Type.java | 2 +- .../AST/ASN1/types/NumericString_Type.java | 2 +- .../AST/ASN1/types/ObjectClassField_Type.java | 4 +- .../AST/ASN1/types/ObjectDescriptor_Type.java | 2 +- .../titan/lsp/AST/ASN1/types/Open_Type.java | 4 +- .../AST/ASN1/types/PrintableString_Type.java | 2 +- .../types/RelativeObjectIdentifier_Type.java | 2 +- .../lsp/AST/ASN1/types/Selection_Type.java | 2 +- .../AST/ASN1/types/TeletexString_Type.java | 2 +- .../lsp/AST/ASN1/types/UTCTime_Type.java | 4 +- .../lsp/AST/ASN1/types/UTF8String_Type.java | 2 +- .../AST/ASN1/types/UniversalString_Type.java | 2 +- .../ASN1/types/UnrestrictedString_Type.java | 4 +- .../AST/ASN1/types/VideotexString_Type.java | 2 +- .../AST/ASN1/types/VisibleString_Type.java | 2 +- .../java/org/eclipse/titan/lsp/AST/IType.java | 212 +++++++++--------- .../java/org/eclipse/titan/lsp/AST/Scope.java | 4 +- .../lsp/AST/TTCN3/definitions/Def_Port.java | 2 +- .../lsp/AST/TTCN3/definitions/Def_Type.java | 4 +- .../AST/TTCN3/definitions/TTCN3Module.java | 6 +- .../AST/TTCN3/templates/TTCN3Template.java | 17 +- .../lsp/AST/TTCN3/types/Address_Type.java | 4 +- .../lsp/AST/TTCN3/types/Anytype_Type.java | 2 +- .../lsp/AST/TTCN3/types/BitString_Type.java | 4 +- .../lsp/AST/TTCN3/types/Boolean_Type.java | 7 +- .../lsp/AST/TTCN3/types/CharString_Type.java | 5 +- .../titan/lsp/AST/TTCN3/types/Class_Type.java | 2 +- .../lsp/AST/TTCN3/types/Component_Type.java | 2 +- .../lsp/AST/TTCN3/types/Default_Type.java | 4 +- .../titan/lsp/AST/TTCN3/types/Float_Type.java | 4 +- .../lsp/AST/TTCN3/types/HexString_Type.java | 4 +- .../lsp/AST/TTCN3/types/Integer_Type.java | 6 +- .../lsp/AST/TTCN3/types/ObjectID_Type.java | 2 +- .../lsp/AST/TTCN3/types/OctetString_Type.java | 4 +- .../titan/lsp/AST/TTCN3/types/Port_Type.java | 2 +- .../lsp/AST/TTCN3/types/Property_Type.java | 2 +- .../lsp/AST/TTCN3/types/RefdSpec_Type.java | 2 +- .../lsp/AST/TTCN3/types/Referenced_Type.java | 4 +- .../lsp/AST/TTCN3/types/Signature_Type.java | 2 +- .../AST/TTCN3/types/TTCN3_Choice_Type.java | 8 +- .../TTCN3/types/TTCN3_Enumerated_Type.java | 2 +- .../AST/TTCN3/types/TTCN3_Sequence_Type.java | 8 +- .../types/TTCN3_Set_Seq_Choice_BaseType.java | 8 +- .../lsp/AST/TTCN3/types/TTCN3_Set_Type.java | 8 +- .../TTCN3/types/UniversalCharstring_Type.java | 4 +- .../lsp/AST/TTCN3/types/Verdict_Type.java | 2 +- .../java/org/eclipse/titan/lsp/AST/Type.java | 7 +- .../eclipse/titan/lsp/GeneralConstants.java | 5 - 62 files changed, 213 insertions(+), 229 deletions(-) diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_BitString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_BitString_Type.java index f54604c4..f3555e96 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_BitString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_BitString_Type.java @@ -123,13 +123,13 @@ public final class ASN1_BitString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "bitstring"; + return getTypetype().getName(); } @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("bit string"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Choice_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Choice_Type.java index 5849de76..660520e2 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Choice_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Choice_Type.java @@ -210,7 +210,7 @@ public final class ASN1_Choice_Type extends ASN1_Set_Seq_Choice_BaseType { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("choice"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Enumerated_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Enumerated_Type.java index 6f63f928..51b8a65b 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Enumerated_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Enumerated_Type.java @@ -97,7 +97,7 @@ public final class ASN1_Enumerated_Type extends Type implements IASN1Type, IType @Override /** {@inheritDoc} */ public final StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("enumerated"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Integer_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Integer_Type.java index 3e9ced52..2ded8553 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Integer_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Integer_Type.java @@ -134,13 +134,13 @@ public final class ASN1_Integer_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "integer"; + return getTypetype().getName(); } @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("integer"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Sequence_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Sequence_Type.java index 779e321d..b3f8baab 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Sequence_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Sequence_Type.java @@ -412,7 +412,7 @@ public final class ASN1_Sequence_Type extends ASN1_Set_Seq_Choice_BaseType { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("sequence"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Set_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Set_Type.java index e328a671..d3986c0d 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Set_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ASN1_Set_Type.java @@ -339,7 +339,7 @@ public final class ASN1_Set_Type extends ASN1_Set_Seq_Choice_BaseType implements @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("set"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Any_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Any_Type.java index 753224ad..df202860 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Any_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Any_Type.java @@ -73,7 +73,7 @@ public final class Any_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "ANY"; + return getTypetype().getName(); } @Override @@ -211,7 +211,7 @@ public final class Any_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("any"); + return builder.append(getTypetype().getName()); } @Override @@ -221,6 +221,6 @@ public final class Any_Type extends Type implements IASN1Type { return "FIXLSP"; } - return "ANY"; + return getTypename(); } } diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/BMPString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/BMPString_Type.java index 9c8313de..58fb5548 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/BMPString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/BMPString_Type.java @@ -87,7 +87,7 @@ public final class BMPString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "BMPString"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Embedded_PDV_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Embedded_PDV_Type.java index 4f0d37d9..1054bf90 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Embedded_PDV_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Embedded_PDV_Type.java @@ -36,7 +36,6 @@ import org.eclipse.titan.lsp.parsers.CompilationTimeStamp; * @author Kristof Szabados * */ public final class Embedded_PDV_Type extends Type implements IASN1Type, IReferencingType { - private static final String EMBEDDED_PDV = "EMBEDDED PDV"; private static final String TEMPLATENOTALLOWED = "{0} cannot be used for type `EMBEDDED PDV''"; private static final String LENGTHRESTRICTIONNOTALLOWED = "Length restriction is not allowed for type `EMBEDDED PDV''"; @@ -68,7 +67,7 @@ public final class Embedded_PDV_Type extends Type implements IASN1Type, IReferen @Override /** {@inheritDoc} */ public String getTypename() { - return EMBEDDED_PDV; + return getTypetype().getName(); } @Override @@ -79,7 +78,7 @@ public final class Embedded_PDV_Type extends Type implements IASN1Type, IReferen return this; } - final Identifier identifier = new Identifier(Identifier_type.ID_ASN, EMBEDDED_PDV); + final Identifier identifier = new Identifier(Identifier_type.ID_ASN, getTypename()); final Assignments assignments = myScope.getAssignmentsScope(); if (!assignments.hasAssignmentWithId(timestamp, identifier)) { setIsErroneous(true); @@ -221,6 +220,6 @@ public final class Embedded_PDV_Type extends Type implements IASN1Type, IReferen @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("embedded PDV"); + return builder.append(getTypetype().getName()); } } diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/External_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/External_Type.java index 0a6f31a2..47899993 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/External_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/External_Type.java @@ -67,7 +67,7 @@ public final class External_Type extends Type implements IASN1Type, IReferencing @Override /** {@inheritDoc} */ public String getTypename() { - return "EXTERNAL"; + return getTypetype().getName(); } @Override @@ -78,7 +78,7 @@ public final class External_Type extends Type implements IASN1Type, IReferencing return this; } - final Identifier identifier = new Identifier(Identifier_type.ID_ASN, "EXTERNAL"); + final Identifier identifier = new Identifier(Identifier_type.ID_ASN, getTypename()); final Assignments assignments = myScope.getAssignmentsScope(); if (!assignments.hasAssignmentWithId(timestamp, identifier)) { setIsErroneous(true); @@ -220,6 +220,6 @@ public final class External_Type extends Type implements IASN1Type, IReferencing @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("external"); + return builder.append(getTypetype().getName()); } } diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GeneralString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GeneralString_Type.java index 3c632cc7..3d4bf0fd 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GeneralString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GeneralString_Type.java @@ -88,7 +88,7 @@ public final class GeneralString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "GeneralString"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GeneralizedTime_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GeneralizedTime_Type.java index 1043e667..2c65099f 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GeneralizedTime_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GeneralizedTime_Type.java @@ -80,7 +80,7 @@ public final class GeneralizedTime_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "GeneralizedTime"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GraphicString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GraphicString_Type.java index e20b743e..884230fb 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GraphicString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/GraphicString_Type.java @@ -88,7 +88,7 @@ public final class GraphicString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "GraphicString"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/IA5String_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/IA5String_Type.java index 96dd226f..aec28c45 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/IA5String_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/IA5String_Type.java @@ -80,7 +80,7 @@ public final class IA5String_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "IA5String"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/NULL_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/NULL_Type.java index a3d3e5d5..e370c371 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/NULL_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/NULL_Type.java @@ -70,7 +70,7 @@ public final class NULL_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "NULL"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/NumericString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/NumericString_Type.java index f3ca4388..303cf59e 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/NumericString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/NumericString_Type.java @@ -80,7 +80,7 @@ public final class NumericString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "NumericString"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ObjectClassField_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ObjectClassField_Type.java index f30974f8..cd1fa578 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ObjectClassField_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ObjectClassField_Type.java @@ -111,7 +111,7 @@ public final class ObjectClassField_Type extends Type implements IASN1Type, IRef /** {@inheritDoc} */ public String getTypename() { if (isErroneous || null == referred_type || this == referred_type) { - return "Object class field type"; + return getTypetype().getName(); } return referred_type.getTypename(); @@ -279,7 +279,7 @@ public final class ObjectClassField_Type extends Type implements IASN1Type, IRef return referred_type.getProposalDescription(builder); } - return builder.append("unknown_referred_type"); + return builder.append("<unknown_referred_type>"); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ObjectDescriptor_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ObjectDescriptor_Type.java index c81c6c03..f5d4effb 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ObjectDescriptor_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/ObjectDescriptor_Type.java @@ -87,7 +87,7 @@ public final class ObjectDescriptor_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "ObjectDescriptor"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Open_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Open_Type.java index 52ee8957..9d733fb9 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Open_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Open_Type.java @@ -198,7 +198,7 @@ public final class Open_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "open type"; + return getTypetype().getName(); } @Override @@ -509,7 +509,7 @@ public final class Open_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("open type"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/PrintableString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/PrintableString_Type.java index c6753584..b5e506e6 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/PrintableString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/PrintableString_Type.java @@ -80,7 +80,7 @@ public final class PrintableString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "PrintableString"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/RelativeObjectIdentifier_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/RelativeObjectIdentifier_Type.java index 52baa4c2..cea52dfd 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/RelativeObjectIdentifier_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/RelativeObjectIdentifier_Type.java @@ -71,7 +71,7 @@ public final class RelativeObjectIdentifier_Type extends Type implements IASN1Ty @Override /** {@inheritDoc} */ public String getTypename() { - return "objid"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Selection_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Selection_Type.java index 8ba493a4..d4ff64f0 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Selection_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/Selection_Type.java @@ -110,7 +110,7 @@ public final class Selection_Type extends Type implements IASN1Type, IReferencin /** {@inheritDoc} */ public String getTypename() { if (isErroneous || null == selectionType || this == selectionType) { - return "Selection type"; + return getTypetype().getName(); } return selectionType.getTypename(); diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/TeletexString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/TeletexString_Type.java index 78caec25..53f5f871 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/TeletexString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/TeletexString_Type.java @@ -88,7 +88,7 @@ public final class TeletexString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "TeletexString"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UTCTime_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UTCTime_Type.java index f86f2ef7..a520f19a 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UTCTime_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UTCTime_Type.java @@ -80,7 +80,7 @@ public final class UTCTime_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "UTCTime"; + return getTypetype().getName(); } @Override @@ -206,6 +206,6 @@ public final class UTCTime_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("utctime"); + return builder.append(getTypetype().getName()); } } diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UTF8String_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UTF8String_Type.java index 96513e56..ffcbc268 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UTF8String_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UTF8String_Type.java @@ -87,7 +87,7 @@ public final class UTF8String_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "UTF8String"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UniversalString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UniversalString_Type.java index 1b9bcd90..32837194 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UniversalString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UniversalString_Type.java @@ -87,7 +87,7 @@ public final class UniversalString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "UniversalString"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UnrestrictedString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UnrestrictedString_Type.java index 5d0b1d9e..d154896b 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UnrestrictedString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/UnrestrictedString_Type.java @@ -67,7 +67,7 @@ public final class UnrestrictedString_Type extends Type implements IASN1Type, IR @Override /** {@inheritDoc} */ public String getTypename() { - return "CHARACTER STRING"; + return getTypetype().getName(); } @Override @@ -78,7 +78,7 @@ public final class UnrestrictedString_Type extends Type implements IASN1Type, IR return this; } - final Identifier identifier = new Identifier(Identifier_type.ID_ASN, "CHARACTER STRING"); + final Identifier identifier = new Identifier(Identifier_type.ID_ASN, getTypename()); final Assignments assignments = myScope.getAssignmentsScope(); if (!assignments.hasAssignmentWithId(timestamp, identifier)) { setIsErroneous(true); diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/VideotexString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/VideotexString_Type.java index 872074f9..a01fd173 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/VideotexString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/VideotexString_Type.java @@ -88,7 +88,7 @@ public final class VideotexString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "VideotexString"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/VisibleString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/VisibleString_Type.java index 4deb5b3f..df758618 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/VisibleString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/ASN1/types/VisibleString_Type.java @@ -80,7 +80,7 @@ public final class VisibleString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "VisibleString"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/IType.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/IType.java index 715c1905..c20222b4 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/IType.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/IType.java @@ -52,133 +52,143 @@ public interface IType extends IGovernor, IIdentifierContainer, IVisitableNode, enum Type_type { // special values never instantiated /** undefined. */ - TYPE_UNDEFINED, + TYPE_UNDEFINED("<undefined>"), // common types (they reside among the TTCN-3 type package) - /** boolean. */ - TYPE_BOOL, /** bitstring. */ - TYPE_BITSTRING, - /** octetstring. */ - TYPE_OCTETSTRING, + TYPE_BITSTRING("bitstring"), + /** boolean. */ + TYPE_BOOL("boolean"), /** integer. */ - TYPE_INTEGER, - /** real / float. */ - TYPE_REAL, + TYPE_INTEGER("integer"), + /** octetstring. */ + TYPE_OCTETSTRING("octetstring"), /** object identifier. */ - TYPE_OBJECTID, - /** referenced. */ - TYPE_REFERENCED, + TYPE_OBJECTID("objid"), + /** real / float. */ + TYPE_REAL("float"), /** referenced directly by pointer. */ - TYPE_REFD_SPEC, + TYPE_REFD_SPEC("referenced type"), + /** referenced. */ + TYPE_REFERENCED("referenced type"), /** sequence of. */ - TYPE_SEQUENCE_OF, + TYPE_SEQUENCE_OF("sequence of"), /** set of. */ - TYPE_SET_OF, + TYPE_SET_OF("set of"), // TTCN-3 types - /** character string (TTCN-3). */ - TYPE_CHARSTRING, - /** hexadecimal string (TTCN-3). */ - TYPE_HEXSTRING, - /** unversal charstring (TTCN-3). */ - TYPE_UCHARSTRING, - /** verdict type (TTCN-3). */ - TYPE_VERDICT, /** address (TTCN-3). */ - TYPE_ADDRESS, - /** default (TTCN-3). */ - TYPE_DEFAULT, - /** Sequence (TTCN-3). */ - TYPE_TTCN3_SEQUENCE, - /** Set (TTCN-3). */ - TYPE_TTCN3_SET, - /** Union (TTCN-3). */ - TYPE_TTCN3_CHOICE, - /** enumeration (TTCN-3). */ - TYPE_TTCN3_ENUMERATED, - /** function (TTCN-3). */ - TYPE_FUNCTION, + TYPE_ADDRESS("address"), /** altstep (TTCN-3). */ - TYPE_ALTSTEP, - /** testcase (TTCN-3). */ - TYPE_TESTCASE, + TYPE_ALTSTEP("altstep"), + /** anytype (TTCN-3). */ + TYPE_ANYTYPE("anytype"), /** array (TTCN-3). */ - TYPE_ARRAY, - /** signature (TTCN-3). */ - TYPE_SIGNATURE, + TYPE_ARRAY("array"), + /** character string (TTCN-3). */ + TYPE_CHARSTRING("charstring"), + /** class (TTCN-3 extension) */ + TYPE_CLASS("class"), /** component (TTCN-3). */ - TYPE_COMPONENT, + TYPE_COMPONENT("component"), + /** default (TTCN-3). */ + TYPE_DEFAULT("default"), + /** function (TTCN-3). */ + TYPE_FUNCTION("function"), + /** hexadecimal string (TTCN-3). */ + TYPE_HEXSTRING("hexstring"), + /** map type (TTCN-3) */ + TYPE_MAP("map"), /** port (TTCN-3). */ - TYPE_PORT, - /** class (TTCN-3 extension) */ - TYPE_CLASS, + TYPE_PORT("port"), /** property (TTCN-3 OOP extension) */ - TYPE_PROPERTY, - /** anytype (TTCN-3). */ - TYPE_ANYTYPE, - /** ,a[ type (TTCN-3) */ - TYPE_MAP, + TYPE_PROPERTY("property"), + /** signature (TTCN-3). */ + TYPE_SIGNATURE("signature"), + /** testcase (TTCN-3). */ + TYPE_TESTCASE("testcase"), + /** Union (TTCN-3). */ + TYPE_TTCN3_CHOICE("union"), + /** enumeration (TTCN-3). */ + TYPE_TTCN3_ENUMERATED("enumerated"), + /** Sequence (TTCN-3). */ + TYPE_TTCN3_SEQUENCE("record"), + /** Set (TTCN-3). */ + TYPE_TTCN3_SET("set"), + /** unversal charstring (TTCN-3). */ + TYPE_UCHARSTRING("universal charstring"), + /** verdict type (TTCN-3). */ + TYPE_VERDICT("verdicttype"), // ASN.1 types - /** null type (ASN.1). */ - TYPE_NULL, - /** Integer type (ASN.1). */ - TYPE_INTEGER_A, + /** ANY (ASN.1). */ + TYPE_ANY("ANY"), + /** choice (ASN.1). */ + TYPE_ASN1_CHOICE("choice"), /** enumeration (ASN.1). */ - TYPE_ASN1_ENUMERATED, + TYPE_ASN1_ENUMERATED("enumerated"), + /** sequence (ASN.1). */ + TYPE_ASN1_SEQUENCE("sequence"), + /** set (ASN.1). */ + TYPE_ASN1_SET("set"), /** bitstring (ASN.1). */ - TYPE_BITSTRING_A, - /** UTF8String (ASN.1). */ - TYPE_UTF8STRING, + TYPE_BITSTRING_A("bitstring"), + /** bmpString (ASN.1). */ + TYPE_BMPSTRING("BMPString"), + /** embedded_pdv (ASN.1). */ + TYPE_EMBEDDED_PDV("EMBEDDED PDV"), + /** external (ASN.1). */ + TYPE_EXTERNAL("EXTERNAL"), + /** generalised time (ASN.1). */ + TYPE_GENERALIZEDTIME("GeneralizedTime"), + /** generalString (ASN.1). */ + TYPE_GENERALSTRING("GeneralString"), + /** graphicstring (ASN.1). */ + TYPE_GRAPHICSTRING("GraphicString"), + /** IA5String (ASN.1). */ + TYPE_IA5STRING("IA5String"), + /** Integer type (ASN.1). */ + TYPE_INTEGER_A("integer"), + /** null type (ASN.1). */ + TYPE_NULL("NULL"), /** numericString (ASN.1). */ - TYPE_NUMERICSTRING, + TYPE_NUMERICSTRING("NumericString"), + /** ObjectClassField (ASN.1). */ + TYPE_OBJECTCLASSFIELDTYPE("object class field type"), + /** objectdescriptor. */ + TYPE_OBJECTDESCRIPTOR("ObjectDescriptor"), + /** opentype (ASN.1). */ + TYPE_OPENTYPE("open type"), /** printablestring (ASN.1). */ - TYPE_PRINTABLESTRING, + TYPE_PRINTABLESTRING("PrintableString"), + /** relative object identifier (ASN.1). */ + TYPE_ROID("objid"), + /** selection (ASN.1). */ + TYPE_SELECTION("selection type"), /** teletexstring (ASN.1). */ - TYPE_TELETEXSTRING, - /** videotexstring (ASN.1). */ - TYPE_VIDEOTEXSTRING, - /** IA5String (ASN.1). */ - TYPE_IA5STRING, - /** graphicstring (ASN.1). */ - TYPE_GRAPHICSTRING, - /** visiblestring (ASN.1). */ - TYPE_VISIBLESTRING, - /** generalString (ASN.1). */ - TYPE_GENERALSTRING, + TYPE_TELETEXSTRING("TeletexString"), /** universalString (ASN.1). */ - TYPE_UNIVERSALSTRING, - /** bmpString (ASN.1). */ - TYPE_BMPSTRING, + TYPE_UNIVERSALSTRING("UniversalString"), /** unrestrictedString (ASN.1). */ - TYPE_UNRESTRICTEDSTRING, + TYPE_UNRESTRICTEDSTRING("CHARACTER STRING"), /** UTCtime (ASN.1). */ - TYPE_UTCTIME, - /** generalised time (ASN.1). */ - TYPE_GENERALIZEDTIME, - /** objectdescriptor. */ - TYPE_OBJECTDESCRIPTOR, - /** relative object identifier (ASN.1). */ - TYPE_ROID, - /** choice (ASN.1). */ - TYPE_ASN1_CHOICE, - /** sequence (ASN.1). */ - TYPE_ASN1_SEQUENCE, - /** set (ASN.1). */ - TYPE_ASN1_SET, - /** ObjectClassField (ASN.1). */ - TYPE_OBJECTCLASSFIELDTYPE, - /** opentype (ASN.1). */ - TYPE_OPENTYPE, - /** ANY (ASN.1). */ - TYPE_ANY, - /** external (ASN.1). */ - TYPE_EXTERNAL, - /** embedded_pdv (ASN.1). */ - TYPE_EMBEDDED_PDV, - /** selection (ASN.1). */ - TYPE_SELECTION + TYPE_UTCTIME("UTCTime"), + /** UTF8String (ASN.1). */ + TYPE_UTF8STRING("UTF8String"), + /** videotexstring (ASN.1). */ + TYPE_VIDEOTEXSTRING("VideotexString"), + /** visiblestring (ASN.1). */ + TYPE_VISIBLESTRING("VisibleString"); + + final String name; + + Type_type(final String name) { + this.name = name; + } + + public String getName() { + return name; + } } /** diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/Scope.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/Scope.java index cd1b5b97..005fd567 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/Scope.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/Scope.java @@ -342,15 +342,12 @@ public abstract class Scope implements INamedNode, IIdentifierContainer, IVisita } Component_Type referencedComponent; - String typename; switch (type.getTypetype()) { case TYPE_FUNCTION: referencedComponent = ((Function_Type) type).getRunsOnType(timestamp); - typename = "function"; break; case TYPE_ALTSTEP: referencedComponent = ((Altstep_Type) type).getRunsOnType(timestamp); - typename = "altstep"; break; default: return; @@ -360,6 +357,7 @@ public abstract class Scope implements INamedNode, IIdentifierContainer, IVisita return; } + final String typename = type.getTypetype().getName(); final RunsOnScope runsOnScope = getScopeRunsOn(); if (runsOnScope == null) { errorLocation.getLocation().reportSemanticError( diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/Def_Port.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/Def_Port.java index 11547801..e449596f 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/Def_Port.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/Def_Port.java @@ -335,7 +335,7 @@ public final class Def_Port extends Definition { } final IType assType = getType(getLastTimeChecked()); - hoverContent.addStyledText("port", Ttcn3HoverContent.BOLD).addText(" "); + hoverContent.addStyledText(getAssignmentName(), Ttcn3HoverContent.BOLD).addText(" "); hoverContent.addStyledText(assType != null ? assType.getTypename() : "<?>") .addStyledText(" ").addStyledText(getFullName()); diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/Def_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/Def_Type.java index cbd5d57c..e9507fc4 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/Def_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/Def_Type.java @@ -232,7 +232,7 @@ public final class Def_Type extends Definition implements ICommentable { lastTimeChecked = timestamp; isUsed = false; - if (!GeneralConstants.ADDRESS.equals(identifier.getTtcnName()) && !GeneralConstants.ANYTYPE.equals(identifier.getTtcnName())) { + if (!Type_type.TYPE_ADDRESS.getName().equals(identifier.getTtcnName()) && !Type_type.TYPE_ANYTYPE.getName().equals(identifier.getTtcnName())) { NamingConventionHelper.checkConvention(NamingConventionElement.Type, identifier, this); NamingConventionHelper.checkNameContents(identifier, getMyScope().getModuleScope().getIdentifier(), getDescription()); } @@ -246,7 +246,7 @@ public final class Def_Type extends Definition implements ICommentable { } type.check(timestamp); type.checkConstructorName(identifier.getName()); - if (GeneralConstants.ADDRESS.equals(identifier.getTtcnName())) { + if (Type_type.TYPE_ADDRESS.getName().equals(identifier.getTtcnName())) { Address_Type.checkAddress(timestamp, type); } diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/TTCN3Module.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/TTCN3Module.java index c7a4a28f..30f34522 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/TTCN3Module.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/definitions/TTCN3Module.java @@ -159,7 +159,7 @@ public final class TTCN3Module extends Module implements ISemanticInformation { definitions.setFullNameParent(this); anytype = new Anytype_Type(); - anytypeDefinition = new Def_Type(new Identifier(Identifier_type.ID_TTCN, GeneralConstants.ANYTYPE), anytype); + anytypeDefinition = new Def_Type(new Identifier(Identifier_type.ID_TTCN, Type_type.TYPE_ANYTYPE.getName()), anytype); anytypeDefinition.setMyScope(this); anytypeDefinition.setFullNameParent(this); @@ -935,7 +935,7 @@ public final class TTCN3Module extends Module implements ISemanticInformation { if (moduleId == null) { // no module name is given in the reference - if (GeneralConstants.ANYTYPE.equals(id.getTtcnName())) { + if (Type_type.TYPE_ANYTYPE.getName().equals(id.getTtcnName())) { return anytypeDefinition; } @@ -990,7 +990,7 @@ public final class TTCN3Module extends Module implements ISemanticInformation { missingReferences.add(reference); } else if (moduleId.getName().equals(name)) { // the reference points to the own module - if (GeneralConstants.ANYTYPE.equals(id.getTtcnName())) { + if (Type_type.TYPE_ANYTYPE.getName().equals(id.getTtcnName())) { return anytypeDefinition; } diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/templates/TTCN3Template.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/templates/TTCN3Template.java index 76c7b92f..34e59167 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/templates/TTCN3Template.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/templates/TTCN3Template.java @@ -11,7 +11,6 @@ import java.text.MessageFormat; import java.util.List; import java.util.Set; -import org.eclipse.titan.lsp.GeneralConstants; import org.eclipse.titan.lsp.AST.ASTVisitor; import org.eclipse.titan.lsp.AST.ArraySubReference; import org.eclipse.titan.lsp.AST.Assignment; @@ -398,7 +397,7 @@ public abstract class TTCN3Template extends GovernedSimple if (!((ASN1_Choice_Type) tempType).hasComponentWithName(fieldIdentifier)) { if (!silent) { reference.getLocation().reportSemanticError( - MessageFormat.format(REFERENCETONONEXISTENTFIELD, GeneralConstants.UNION, + MessageFormat.format(REFERENCETONONEXISTENTFIELD, tempType.getTypetype().getName(), fieldIdentifier.getDisplayName(), tempType.getTypename())); } return null; @@ -409,7 +408,7 @@ public abstract class TTCN3Template extends GovernedSimple if (!((TTCN3_Choice_Type) tempType).hasComponentWithName(fieldIdentifier.getName())) { if (!silent) { reference.getLocation().reportSemanticError( - MessageFormat.format(REFERENCETONONEXISTENTFIELD, GeneralConstants.UNION, + MessageFormat.format(REFERENCETONONEXISTENTFIELD, tempType.getTypetype().getName(), fieldIdentifier.getDisplayName(), tempType.getTypename())); } return null; @@ -420,7 +419,7 @@ public abstract class TTCN3Template extends GovernedSimple if (!((Open_Type) tempType).hasComponentWithName(fieldIdentifier)) { if (!silent) { reference.getLocation().reportSemanticError( - MessageFormat.format(REFERENCETONONEXISTENTFIELD, GeneralConstants.UNION, + MessageFormat.format(REFERENCETONONEXISTENTFIELD, tempType.getTypetype().getName(), fieldIdentifier.getDisplayName(), tempType.getTypename())); } return null; @@ -431,7 +430,7 @@ public abstract class TTCN3Template extends GovernedSimple if (!((Anytype_Type) tempType).hasComponentWithName(fieldIdentifier.getName())) { if (!silent) { reference.getLocation().reportSemanticError( - MessageFormat.format(REFERENCETONONEXISTENTFIELD, GeneralConstants.UNION, + MessageFormat.format(REFERENCETONONEXISTENTFIELD, tempType.getTypetype().getName(), fieldIdentifier.getDisplayName(), tempType.getTypename())); } return null; @@ -442,7 +441,7 @@ public abstract class TTCN3Template extends GovernedSimple if (!((ASN1_Sequence_Type) tempType).hasComponentWithName(fieldIdentifier)) { if (!silent) { reference.getLocation().reportSemanticError( - MessageFormat.format(REFERENCETONONEXISTENTFIELD, GeneralConstants.RECORD, + MessageFormat.format(REFERENCETONONEXISTENTFIELD, tempType.getTypetype().getName(), fieldIdentifier.getDisplayName(), tempType.getTypename())); } return null; @@ -453,7 +452,7 @@ public abstract class TTCN3Template extends GovernedSimple if (!((TTCN3_Sequence_Type) tempType).hasComponentWithName(fieldIdentifier.getName())) { if (!silent) { reference.getLocation().reportSemanticError( - MessageFormat.format(REFERENCETONONEXISTENTFIELD, GeneralConstants.RECORD, + MessageFormat.format(REFERENCETONONEXISTENTFIELD, tempType.getTypetype().getName(), fieldIdentifier.getDisplayName(), tempType.getTypename())); } return null; @@ -464,7 +463,7 @@ public abstract class TTCN3Template extends GovernedSimple if (!((ASN1_Set_Type) tempType).hasComponentWithName(fieldIdentifier)) { if (!silent) { reference.getLocation().reportSemanticError( - MessageFormat.format(REFERENCETONONEXISTENTFIELD, GeneralConstants.SET, + MessageFormat.format(REFERENCETONONEXISTENTFIELD, tempType.getTypetype().getName(), fieldIdentifier.getDisplayName(), tempType.getTypename())); } return null; @@ -475,7 +474,7 @@ public abstract class TTCN3Template extends GovernedSimple if (!((TTCN3_Set_Type) tempType).hasComponentWithName(fieldIdentifier.getName())) { if (!silent) { reference.getLocation().reportSemanticError( - MessageFormat.format(REFERENCETONONEXISTENTFIELD, GeneralConstants.SET, + MessageFormat.format(REFERENCETONONEXISTENTFIELD, tempType.getTypetype().getName(), fieldIdentifier.getDisplayName(), tempType.getTypename())); } return null; diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Address_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Address_Type.java index 8dd33333..9b54234d 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Address_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Address_Type.java @@ -64,7 +64,7 @@ public final class Address_Type extends Type implements IReferencingType { @Override /** {@inheritDoc} */ public String getTypename() { - return "address"; + return getTypetype().getName(); } @Override @@ -283,7 +283,7 @@ public final class Address_Type extends Type implements IReferencingType { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("address"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Anytype_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Anytype_Type.java index 464b2b50..0411a2a6 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Anytype_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Anytype_Type.java @@ -796,7 +796,7 @@ public final class Anytype_Type extends Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append(GeneralConstants.ANYTYPE); + return builder.append(getTypetype().getName()); } /** diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/BitString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/BitString_Type.java index 91c96a5d..df3018c3 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/BitString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/BitString_Type.java @@ -55,7 +55,7 @@ public final class BitString_Type extends Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("bitstring"); + return builder.append(getTypetype().getName()); } @Override @@ -85,7 +85,7 @@ public final class BitString_Type extends Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "bitstring"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Boolean_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Boolean_Type.java index a0f17173..e6869c55 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Boolean_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Boolean_Type.java @@ -41,7 +41,6 @@ import org.eclipse.titan.lsp.parsers.CompilationTimeStamp; * @author Arpad Lovassy */ public final class Boolean_Type extends Type implements IASN1Type { - private static final String BOOLEAN = "boolean"; private static final String BOOLEANVALUEEXPECTED1 = "boolean value was expected"; private static final String BOOLEANVALUEEXPECTED2 = "BOOLEAN value was expected"; private static final String TEMPLATENOTALLOWED = "{0} cannot be used for type `boolean''"; @@ -72,7 +71,7 @@ public final class Boolean_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return BOOLEAN; + return getTypetype().getName(); } @Override @@ -281,7 +280,7 @@ public final class Boolean_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append(BOOLEAN); + return builder.append(getTypetype().getName()); } @Override @@ -291,7 +290,7 @@ public final class Boolean_Type extends Type implements IASN1Type { return "FIXLSP"; } - return "BOOLEAN"; + return getTypetype().getName().toUpperCase(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/CharString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/CharString_Type.java index 9916be7f..1568bf80 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/CharString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/CharString_Type.java @@ -48,7 +48,6 @@ import org.eclipse.titan.lsp.parsers.CompilationTimeStamp; * @author Arpad Lovassy */ public final class CharString_Type extends Type { - private static final String CHARSTRING = "charstring"; public static final String CHARSTRINGVALUEEXPECTED = "Character string value was expected"; private static final String TEMPLATENOTALLOWED = "{0} cannot be used for type `{1}''"; private static final String INCORRECTBOUNDARIES = "The lower boundary is higher than the upper boundary"; @@ -86,7 +85,7 @@ public final class CharString_Type extends Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append(CHARSTRING); + return builder.append(getTypetype().getName()); } @Override @@ -127,7 +126,7 @@ public final class CharString_Type extends Type { @Override /** {@inheritDoc} */ public String getTypename() { - return CHARSTRING; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Class_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Class_Type.java index 32b09516..50b4b39e 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Class_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Class_Type.java @@ -1734,6 +1734,6 @@ public final class Class_Type extends Type implements ITypeWithComponents { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("class"); + return builder.append(getTypetype().getName()); } } diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Component_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Component_Type.java index 823418a8..c43760cf 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Component_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Component_Type.java @@ -109,7 +109,7 @@ public final class Component_Type extends Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("component"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Default_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Default_Type.java index 491bf326..d25837e3 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Default_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Default_Type.java @@ -72,7 +72,7 @@ public final class Default_Type extends Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "default"; + return getTypetype().getName(); } @Override @@ -210,6 +210,6 @@ public final class Default_Type extends Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("default"); + return builder.append(getTypetype().getName()); } } diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Float_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Float_Type.java index b06f1311..ddd57e42 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Float_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Float_Type.java @@ -94,7 +94,7 @@ public final class Float_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "float"; + return getTypetype().getName(); } @Override @@ -386,7 +386,7 @@ public final class Float_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("float"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/HexString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/HexString_Type.java index 29ff2679..e2a7bec1 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/HexString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/HexString_Type.java @@ -53,7 +53,7 @@ public final class HexString_Type extends Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("hexstring"); + return builder.append(getTypetype().getName()); } @Override @@ -83,7 +83,7 @@ public final class HexString_Type extends Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "hexstring"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Integer_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Integer_Type.java index 662ea727..18cf0083 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Integer_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Integer_Type.java @@ -94,7 +94,7 @@ public final class Integer_Type extends Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "integer"; + return getTypetype().getName(); } @Override @@ -487,7 +487,7 @@ public final class Integer_Type extends Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("integer"); + return builder.append(getTypetype().getName()); } @Override @@ -497,7 +497,7 @@ public final class Integer_Type extends Type { return "FIXLSP"; } - return "INTEGER"; + return getTypetype().getName().toUpperCase(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/ObjectID_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/ObjectID_Type.java index 5685a1d4..616cb1da 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/ObjectID_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/ObjectID_Type.java @@ -78,7 +78,7 @@ public final class ObjectID_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "objid"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/OctetString_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/OctetString_Type.java index e6dfcb9b..3d994c5c 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/OctetString_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/OctetString_Type.java @@ -86,7 +86,7 @@ public final class OctetString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "octetstring"; + return getTypetype().getName(); } @Override @@ -325,7 +325,7 @@ public final class OctetString_Type extends Type implements IASN1Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("octetstring"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Port_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Port_Type.java index 17c11fb6..a3c4ef50 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Port_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Port_Type.java @@ -208,7 +208,7 @@ public final class Port_Type extends Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("port"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Property_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Property_Type.java index 2a3bf3e3..fa69b469 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Property_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Property_Type.java @@ -293,7 +293,7 @@ public final class Property_Type extends Type { @Override public String getTypename() { - return "property"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/RefdSpec_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/RefdSpec_Type.java index 1c96f75e..2455dc84 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/RefdSpec_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/RefdSpec_Type.java @@ -84,7 +84,7 @@ public class RefdSpec_Type extends Type implements IASN1Type, IReferencingType { /** {@inheritDoc} */ public String getTypename() { if (isErroneous || refdType == null || refdType == this) { - return "Referenced type"; + return getTypetype().getName(); } return refdType.getTypename(); diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Referenced_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Referenced_Type.java index 28502204..7f82b227 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Referenced_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Referenced_Type.java @@ -183,7 +183,7 @@ public final class Referenced_Type extends Type implements IASN1Type, IReferenci /** {@inheritDoc} */ public String getTypename() { if (isErroneous || referencedLast == null || referencedLast == this) { - return "Referenced type"; + return getTypetype().getName(); } return referencedLast.getTypename();//TODO maybe this should be the name of the current type. @@ -712,7 +712,7 @@ public final class Referenced_Type extends Type implements IASN1Type, IReferenci final TTCN3_Set_Seq_Choice_BaseType last = (TTCN3_Set_Seq_Choice_BaseType)referencedLast; final int nofComponents = last.getNofComponents(); if (jsonAttribute.as_value && nofComponents == 1) { - getLocation().reportSemanticWarning(MessageFormat.format("Attribute 'metainfo for unbound' will be ignored, because the {0} is encoded without field names.", referencedLast.getTypetype() == Type_type.TYPE_TTCN3_SEQUENCE ? "record" : "set")); + getLocation().reportSemanticWarning(MessageFormat.format("Attribute 'metainfo for unbound' will be ignored, because the {0} is encoded without field names.", referencedLast.getTypetype().getName())); } else { for (int i = 0; i < nofComponents; i++) { final Type componentType = last.getComponentByIndex(i).getType(); diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Signature_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Signature_Type.java index 1bb2b9b0..c2059192 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Signature_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Signature_Type.java @@ -637,7 +637,7 @@ public final class Signature_Type extends Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("signature"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Choice_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Choice_Type.java index 9513e231..21d60603 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Choice_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Choice_Type.java @@ -221,12 +221,6 @@ public final class TTCN3_Choice_Type extends TTCN3_Set_Seq_Choice_BaseType imple return getTypetype(); } - @Override - /** {@inheritDoc} */ - public String getTypename() { - return getFullName(); - } - @Override /** {@inheritDoc} */ public void checkConstructorName(final String definitionName) { @@ -634,7 +628,7 @@ public final class TTCN3_Choice_Type extends TTCN3_Set_Seq_Choice_BaseType imple @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("union"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Enumerated_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Enumerated_Type.java index d54ba914..c4093305 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Enumerated_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Enumerated_Type.java @@ -683,7 +683,7 @@ public final class TTCN3_Enumerated_Type extends Type implements ITypeWithCompon @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("enumerated"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Sequence_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Sequence_Type.java index cd1ecc08..8cc16543 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Sequence_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Sequence_Type.java @@ -381,12 +381,6 @@ public final class TTCN3_Sequence_Type extends TTCN3_Set_Seq_Choice_BaseType { return getTypetype(); } - @Override - /** {@inheritDoc} */ - public String getTypename() { - return getFullName(); - } - @Override /** {@inheritDoc} */ public void checkConstructorName(final String definitionName) { @@ -964,7 +958,7 @@ public final class TTCN3_Sequence_Type extends TTCN3_Set_Seq_Choice_BaseType { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("record"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Set_Seq_Choice_BaseType.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Set_Seq_Choice_BaseType.java index 0bb71f6f..4bf5955d 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Set_Seq_Choice_BaseType.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Set_Seq_Choice_BaseType.java @@ -80,6 +80,12 @@ public abstract class TTCN3_Set_Seq_Choice_BaseType extends Type implements ITyp compFieldMap.setFullNameParent(this); } + @Override + /** {@inheritDoc} */ + public String getTypename() { + return getFullName(); + } + @Override /** {@inheritDoc} */ public final void setMyScope(final Scope scope) { @@ -642,7 +648,7 @@ public abstract class TTCN3_Set_Seq_Choice_BaseType extends Type implements ITyp if (jsonAttribute.as_value && getNofComponents() == 1) { getLocation().reportSemanticWarning(MessageFormat.format("Attribute 'metainfo for unbound' will be ignored, because " + "the {0} is encoded without field names.", - getTypetype() == Type_type.TYPE_TTCN3_SEQUENCE ? "record" : "set")); + getTypetype().getName())); } else { for (int i = 0; i < getNofComponents(); i++) { final CompField cField = getComponentByIndex(i); diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Set_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Set_Type.java index 1aa03d06..c023d941 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Set_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/TTCN3_Set_Type.java @@ -303,12 +303,6 @@ public final class TTCN3_Set_Type extends TTCN3_Set_Seq_Choice_BaseType implemen return getTypetype(); } - - @Override - /** {@inheritDoc} */ - public String getTypename() { - return getFullName(); - } @Override /** {@inheritDoc} */ @@ -772,7 +766,7 @@ public final class TTCN3_Set_Type extends TTCN3_Set_Seq_Choice_BaseType implemen @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("set"); + return builder.append(getTypetype().getName()); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/UniversalCharstring_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/UniversalCharstring_Type.java index 45177b22..d7582b13 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/UniversalCharstring_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/UniversalCharstring_Type.java @@ -58,7 +58,7 @@ public final class UniversalCharstring_Type extends Type { @Override /** {@inheritDoc} */ public StringBuilder getProposalDescription(final StringBuilder builder) { - return builder.append("universalcharstring"); + return builder.append(getTypetype().getName()); } @Override @@ -108,7 +108,7 @@ public final class UniversalCharstring_Type extends Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "universal charstring"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Verdict_Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Verdict_Type.java index ae6440d4..0bff4aca 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Verdict_Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/TTCN3/types/Verdict_Type.java @@ -69,7 +69,7 @@ public final class Verdict_Type extends Type { @Override /** {@inheritDoc} */ public String getTypename() { - return "verdicttype"; + return getTypetype().getName(); } @Override diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/AST/Type.java b/lsp/src/main/java/org/eclipse/titan/lsp/AST/Type.java index 36a0c20c..156e35e2 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/AST/Type.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/AST/Type.java @@ -958,7 +958,7 @@ public abstract class Type extends Setting final int nof_comps = ((TTCN3_Set_Seq_Choice_BaseType)last).getNofComponents(); if (jsonAttribute.as_value && nof_comps == 1) { getLocation().reportSemanticWarning(MessageFormat.format("Attribute 'metainfo for unbound' will be ignored, because the {0} is encoded without field names.", - Type_type.TYPE_TTCN3_SEQUENCE == last.getTypetype() ? "record" : "set")); + last.getTypetype().getName())); } else { for (int i = 0; i < nof_comps; i++) { @@ -2436,13 +2436,10 @@ public abstract class Type extends Setting public static String typeToSrcType(Type_type type) { switch (type) { case TYPE_INTEGER: - return "integer"; case TYPE_CHARSTRING: - return "charstring"; case TYPE_BITSTRING: - return "bitstring"; case TYPE_REAL: - return "float"; + return type.getName(); default: return GeneralConstants.EMPTY_STRING; } diff --git a/lsp/src/main/java/org/eclipse/titan/lsp/GeneralConstants.java b/lsp/src/main/java/org/eclipse/titan/lsp/GeneralConstants.java index 7a5c03a8..a1e742a6 100755 --- a/lsp/src/main/java/org/eclipse/titan/lsp/GeneralConstants.java +++ b/lsp/src/main/java/org/eclipse/titan/lsp/GeneralConstants.java @@ -24,8 +24,6 @@ public final class GeneralConstants { public static final boolean ETSI_BUILD = false; // General strings - public static final String ADDRESS = "ADDRESS"; - public static final String ANYTYPE = "anytype"; public static final String AT = "@"; public static final String CALL = "call"; public static final String DONE = "done"; @@ -38,13 +36,10 @@ public final class GeneralConstants { public static final String SECOND = "second"; public static final String THIRD = "third"; public static final String TRUE = "true"; - public static final String RECORD = "record"; - public static final String SET = "set"; public static final String TEMPLATE = "template"; public static final String TITAN = "titan"; public static final String TITANIUM = "titanium"; public static final String TOSTRINGFUNCITON = "toString"; - public static final String UNION = "union"; public static final String VALUE = "value"; public static final String VALUEORTEMPLATE = "value or template"; -- GitLab