Commit 8797075b authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Fixed XER descriptor generation for in-line enumerated field of open type (bug 528313)



Change-Id: I5cdb9f709176c830a262120dc41f24f9800252bc
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 18965c20
...@@ -861,6 +861,7 @@ void Type::chk_encodings() ...@@ -861,6 +861,7 @@ void Type::chk_encodings()
case OT_RECORD_OF: case OT_RECORD_OF:
case OT_COMP_FIELD: case OT_COMP_FIELD:
case OT_SELTYPE: case OT_SELTYPE:
case OT_FIELDSETTING:
// ASN.1 types automatically have BER, PER, XER, OER and JSON encoding // ASN.1 types automatically have BER, PER, XER, OER and JSON encoding
add_coding(string("BER:2002"), Ttcn::MOD_NONE, true); add_coding(string("BER:2002"), Ttcn::MOD_NONE, true);
add_coding(string(get_encoding_name(CT_PER)), Ttcn::MOD_NONE, true); add_coding(string(get_encoding_name(CT_PER)), Ttcn::MOD_NONE, true);
......
...@@ -518,7 +518,7 @@ void Type::generate_code_xerdescriptor(output_struct* target) ...@@ -518,7 +518,7 @@ void Type::generate_code_xerdescriptor(output_struct* target)
continue; continue;
} }
else { // probably a built-in type, punt with the C++ class name else { // probably a built-in type, punt with the C++ class name
last_s = ot->get_genname_value(0); last_s = ot->get_genname_value(ot->get_my_scope());
break; break;
} }
} }
......
...@@ -32,6 +32,9 @@ type record Rec { ...@@ -32,6 +32,9 @@ type record Rec {
Oct1 o, Oct1 o,
Char3 c Char3 c
} }
with {
variant "";
}
type component CT {} type component CT {}
......
...@@ -29,7 +29,7 @@ CODIRS := dynamicTemplate styleGuide topLevelPdu \ ...@@ -29,7 +29,7 @@ CODIRS := dynamicTemplate styleGuide topLevelPdu \
attribQualif HT48786 selectCase openTypeNames \ attribQualif HT48786 selectCase openTypeNames \
defaultParamUsageBeforeDecl deterministic readFromFile \ defaultParamUsageBeforeDecl deterministic readFromFile \
asn1_hyphen nameClash portTranslation UntaggedOnTopLevelUnionSwitch \ asn1_hyphen nameClash portTranslation UntaggedOnTopLevelUnionSwitch \
typeDescrGenWIthNoXER languageSpec asn1_opentype typeDescrGenWIthNoXER languageSpec asn1_opentype openTypeXER
ifdef DYN ifdef DYN
CODIRS += mfgen-xsd CODIRS += mfgen-xsd
......
openTypeXER
openTypeXER.exe
Types*.cc
Types*.hh
##############################################################################
# Copyright (c) 2000-2017 Ericsson Telecom 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
#
# Contributors:
# Baranyi, Botond
#
##############################################################################
TOPDIR := ../..
include $(TOPDIR)/Makefile.regression
.PHONY: all clean dep
TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
TTCN3_MODULES =
ASN1_MODULES = Types.asn
GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
ifdef CODE_SPLIT
GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
else ifdef SPLIT_TO_SLICES
POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
GENERATED_SOURCES += $(GENERATED_SOURCES2)
endif
OBJECTS = $(GENERATED_SOURCES:.cc=.o)
TARGET = openTypeXER$(EXESUFFIX)
all: $(TARGET)
$(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
-L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS)
$(GENERATED_SOURCES) $(GENERATED_HEADERS): $(TTCN3_MODULES) $(ASN1_MODULES)
$(TTCN3_COMPILER) -a $(COMPILER_FLAGS) $^
clean distclean:
$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
$(GENERATED_SOURCES) compile *.log
dep: $(GENERATED_SOURCES)
makedepend $(CPPFLAGS) $(GENERATED_SOURCES)
--/////////////////////////////////////////////////////////////////////////////
-- Copyright (c) 2000-2017 Ericsson Telecom 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
--
-- Contributors:
-- Baranyi, Botond
--
--/////////////////////////////////////////////////////////////////////////////
Types
DEFINITIONS
AUTOMATIC TAGS
EXTENSIBILITY IMPLIED
::=
BEGIN
IMPORTS ; -- nothing
ERROR-CLASS ::= CLASS
{
&category PrintableString(SIZE(1)),
&code INTEGER,
&Type DEFAULT INTEGER
}
WITH SYNTAX {&category &code [&Type]}
ErrorSet ERROR-CLASS ::=
{
{"A" 1 [1] INTEGER} |
{"A" 2 [1] VisibleString} |
{"B" 1 [1] PrintableString} |
{"B" 2 [1] BOOLEAN} |
oneErrorObject
}
oneErrorObject ERROR-CLASS ::= { "C" 3 ENUMERATED{foobar} }
ErrorReturn ::= SEQUENCE
{
errorCategory ERROR-CLASS.&category ({ErrorSet}) OPTIONAL,
errors SEQUENCE OF SEQUENCE
{
errorCode ERROR-CLASS.&code({ErrorSet}{@errorCategory}),
errorInfo [99] ERROR-CLASS.&Type({ErrorSet}{@errorCategory,@.errorCode})
} OPTIONAL
}
END
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment