Commit af710487 authored by Elemer Lelik's avatar Elemer Lelik
Browse files

Sync with 5.2.0

parent 4567b25b
!Makefile
!Makefile
\ No newline at end of file
******************************************************************************
* Copyright (c) 2000-2015 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
******************************************************************************
Cygwin setup
- If Cygwin is installed already, refresh your Cygwin installation
Titan is always build for the newest Cygwin version available.
......
Build and install Titan on Linux
1.Install required libraries:
(examples are given for Ubuntu 12.04/14.04; for other Linuxes, pls. use the relevant library installation method)
sudo apt-get install g++ expect libssl-dev libxml2-dev libncurses5-dev flex bison
xutils-dev is needed by makedepend:
sudo apt-get install xutils-dev
The following packages may be needed for titan_eclipse/automatic_build:
sudo apt-get install ant xsltproc
2.Clone the titan directory from git into /home/<user_id>/titan
git clone https://github.com/eclipse/titan.core titan
3. Configure the build
cd titan
check that MakefileFOSS.cfg is present and has the following content:
cat MakefileFOSS.cfg
# Configurations for the Free Open Source Software version
LICENSING := no
USAGE_STATS := no
Several build options are possible; for details on options , please read through the Makefile.cfg.
Options can be overridden by the content of a file named Makefile.personal which can be used to
adapt to local installation directories, change config options etc.
Below, a small number of typical scenarios are presented.
1) JNI disabled
The JNI interface is used by the Eclipse Titan Executor or by the Java Executor API.
If you don't need them , Titan can be compiled without JNI.
Create ~/titan/Makefile.personal to override settings in Makefile.cfg with the following content:
(replace paths with values relevant to your installation)
TTCN3_DIR := /home/<user id>/titan/Install
OPENSSL_DIR := /usr
#JDKDIR := /usr/lib/jvm/java-7-openjdk-amd64
XMLDIR := /usr
JNI := no
GEN_PDF := no
2) JNI enabled
install JDK into /home/<user id>/jdk
Create ~/titan/Makefile.personal to override settings in Makefile.cfg with the following content:
(replace paths with values relevant to your installation)
TTCN3_DIR := /home/<user id>/titan/Install
OPENSSL_DIR := /usr
JDKDIR := /usr/lib/jvm/java-7-openjdk-amd64
XMLDIR := /usr
JNI := yes
GEN_PDF := no
3. Run make
make
4. Run make install
make install
This will install Titan into /home/<user id>/titan/Install
5. Optionally , run function/regression tests
set environment variable TTCN3_DIR to /home/<user id>/titan/Install
(setenv TTCN3_DIR /home/<user id>/titan/Install for csh,
export TTCN3_DIR=/home/<user id>/titan/Install for bash )
cd /home/<user id>/titan/function_test
in the following Makefiles
XER_EncDec/Makefile
Text_EncDec/Makefile
RAW_EncDec/Makefile
edit the value of XMLDIR to match your installation values
run the tests
make
( or make |& tee outputfile if you want to save the output for verification)
cd /home/<user id>/titan/regression_test
make run
( or make run |& tee outputfile if you want to save the output for verification)
These tests might run for half an hour (regr.tests) to two hours (func.tests)
6. Optionally , copy Titan into its' final directory.
From here on, you can continue with the Titan installation guide, see /Install/docs, to set environment variables etc.
******************************************************************************
* Copyright (c) 2000-2015 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
******************************************************************************
Build and install Titan on Linux
1.Install required libraries:
(examples are given for Ubuntu 12.04/14.04; for other Linuxes, pls. use the relevant library installation method)
sudo apt-get install g++ expect libssl-dev libxml2-dev libncurses5-dev flex bison
xutils-dev is needed by makedepend:
sudo apt-get install xutils-dev
The following packages may be needed for titan_eclipse/automatic_build:
sudo apt-get install ant xsltproc
2.Clone the titan directory from git into /home/<user_id>/titan
git clone https://github.com/eclipse/titan.core titan
3. Configure the build
cd titan
check that MakefileFOSS.cfg is present and has the following content:
cat MakefileFOSS.cfg
# Configurations for the Free Open Source Software version
LICENSING := no
USAGE_STATS := no
Several build options are possible; for details on options , please read through the Makefile.cfg.
Options can be overridden by the content of a file named Makefile.personal which can be used to
adapt to local installation directories, change config options etc.
Below, a small number of typical scenarios are presented.
1) JNI disabled
The JNI interface is used by the Eclipse Titan Executor or by the Java Executor API.
If you don't need them , Titan can be compiled without JNI.
Create ~/titan/Makefile.personal to override settings in Makefile.cfg with the following content:
(replace paths with values relevant to your installation)
TTCN3_DIR := /home/<user id>/titan/Install
OPENSSL_DIR := /usr
#JDKDIR := /usr/lib/jvm/java-7-openjdk-amd64
XMLDIR := /usr
JNI := no
GEN_PDF := no
2) JNI enabled
install JDK into /home/<user id>/jdk
Create ~/titan/Makefile.personal to override settings in Makefile.cfg with the following content:
(replace paths with values relevant to your installation)
TTCN3_DIR := /home/<user id>/titan/Install
OPENSSL_DIR := /usr
JDKDIR := /usr/lib/jvm/java-7-openjdk-amd64
XMLDIR := /usr
JNI := yes
GEN_PDF := no
3. Run make
make
4. Run make install
make install
This will install Titan into /home/<user id>/titan/Install
5. Optionally , run function/regression tests
set environment variable TTCN3_DIR to /home/<user id>/titan/Install
(setenv TTCN3_DIR /home/<user id>/titan/Install for csh,
export TTCN3_DIR=/home/<user id>/titan/Install for bash )
cd /home/<user id>/titan/function_test
in the following Makefiles
XER_EncDec/Makefile
Text_EncDec/Makefile
RAW_EncDec/Makefile
edit the value of XMLDIR to match your installation values
run the tests
make
( or make |& tee outputfile if you want to save the output for verification)
cd /home/<user id>/titan/regression_test
make run
( or make run |& tee outputfile if you want to save the output for verification)
These tests might run for half an hour (regr.tests) to two hours (func.tests)
6. Optionally , copy Titan into its' final directory.
From here on, you can continue with the Titan installation guide, see /Install/docs, to set environment variables etc.
......@@ -20,26 +20,26 @@ http://polarsys.org/sites/default/files/custom_uploads/TITAN%20Datasheet%20A4%20
##Binaries and SHA512 checksums for a number of Linux platforms can be downloaded from:
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.0-sles10.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.0-sles10.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.2-sled10.2.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.2-sled10.2.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.3-SLED11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.3-SLED11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.1.2-rhel5.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.1.2-rhel5.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-SLED11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-SLED11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sled11.0.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sled11.0.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sles11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sles11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.4.5-rhel6.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.4.5-rhel6.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.6-ubuntu12.04.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.6-ubuntu12.04.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.8-ubuntu14.04.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.8-ubuntu14.04.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.1.0-sles10.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.1.0-sles10.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.1.2-sled10.2.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.1.2-sled10.2.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.3-SLED11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux32-gcc4.3-SLED11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.1.2-rhel5.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.1.2-rhel5.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-SLED11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-SLED11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-sled11.0.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-sled11.0.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-sles11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.3-sles11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.4.5-rhel6.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.4.5-rhel6.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.6-ubuntu12.04.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.6-ubuntu12.04.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.8-ubuntu14.04.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.2.pl0-linux64-gcc4.8-ubuntu14.04.tgz.sha512
# Related products:
......
# titan.core
TTCN-3 is a standardized, modular language specifically designed for testing.
Eclipse Titan offers a free and open source (FOSS) compiler both for TTCN-3 and for
ASN.1 (Abstract Syntax Notation One).
# Standards page (also including downloadable code):
* http://www.ttcn-3.org/
# Main project page:
* https://projects.eclipse.org/projects/tools.titan
##Introductory video of a presentation about Titan held at EclipseCon 2014:
* https://www.youtube.com/watch?v=2knzZuwzn-Y.
##Titan Datasheet on polarsys.org:
http://polarsys.org/sites/default/files/custom_uploads/TITAN%20Datasheet%20A4%202.1.pdf
##Binaries and SHA512 checksums for a number of Linux platforms can be downloaded from:
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.0-sles10.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.0-sles10.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.2-sled10.2.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.1.2-sled10.2.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.3-SLED11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux32-gcc4.3-SLED11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.1.2-rhel5.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.1.2-rhel5.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-SLED11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-SLED11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sled11.0.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sled11.0.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sles11.1.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.3-sles11.1.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.4.5-rhel6.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.4.5-rhel6.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.6-ubuntu12.04.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.6-ubuntu12.04.tgz.sha512
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.8-ubuntu14.04.tgz
* https://www.eclipse.org/downloads/download.php?file=/titan/ttcn3-5.1.pl0-linux64-gcc4.8-ubuntu14.04.tgz.sha512
# Related products:
## Test Ports:
* https://github.com/eclipse/titan.TestPorts.Common_Components.Abstract_Socket
* https://github.com/eclipse/titan.TestPorts.HTTPmsg
* https://github.com/eclipse/titan.TestPorts.LANL2asp
* https://github.com/eclipse/titan.TestPorts.PCAPasp
* https://github.com/eclipse/titan.TestPorts.PIPEasp
* https://github.com/eclipse/titan.TestPorts.SCTPasp
* https://github.com/eclipse/titan.TestPorts.SIPmsg
* https://github.com/eclipse/titan.TestPorts.SQLasp
* https://github.com/eclipse/titan.TestPorts.TCPasp
* https://github.com/eclipse/titan.TestPorts.TELNETasp
* https://github.com/eclipse/titan.TestPorts.UDPasp
## Protocol Modules:
* https://github.com/eclipse/titan.ProtocolModules.COMMON
* https://github.com/eclipse/titan.ProtocolModules.DHCP
* https://github.com/eclipse/titan.ProtocolModules.DHCPv6
* https://github.com/eclipse/titan.ProtocolModules.DIAMETER_ProtocolModule_Generator
* https://github.com/eclipse/titan.ProtocolModules.DNS
* https://github.com/eclipse/titan.ProtocolModules.ICMP
* https://github.com/eclipse/titan.ProtocolModules.ICMPv6
* https://github.com/eclipse/titan.ProtocolModules.IP
* https://github.com/eclipse/titan.ProtocolModules.RTP
* https://github.com/eclipse/titan.ProtocolModules.RTSP
* https://github.com/eclipse/titan.ProtocolModules.SMPP
* https://github.com/eclipse/titan.ProtocolModules.SMTP
* https://github.com/eclipse/titan.ProtocolModules.SNMP
* https://github.com/eclipse/titan.ProtocolModules.TCP
* https://github.com/eclipse/titan.ProtocolModules.UDP
* https://github.com/eclipse/titan.ProtocolModules.XMPP
******************************************************************************
* Copyright (c) 2000-2015 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
******************************************************************************
MinGW setup
(A) Download the MinGW installer from the MinGW site:
http://www.mingw.org/
(B) Follow the install steps found on the MinGW getting started page:
http://www.mingw.org/wiki/getting_started
Select the mingw-gcc-v3 packages because Titan only compiles
with older gcc. If you select the gcc4 packages, then the make process
stops immediately with some error messages. Select the msys packages too.
(C) Check the PATH system variable:
System -> Advanced system settings -> Environment Variables -> Path
The MinGW installation path must be present to use the installed
executables and files. For example:
echo %PATH%
C:\MinGW\bin;C:\MinGW\usr\bin...
(D) Working environment:
Use the <Install folder>\msys\<version>\msys.bat file to start a shell.
Download and extract the Titan source files and folders to a directory,
and create a Makefile.personal in the top directory. Please check the
installation guide and set all the needed variables like TTCN3_DIR. The
MinGW compilation needs a few extra changes in the Makefile.cfg also. Set
the PLATFORM and MINGW values:
PLATFORM := WIN32
MINGW := -DMINGW -mno-cygwin
(E) Compile Titan:
cd titan
make -j
make install
The compiled files will be placed into the ./Install directory.
(F) If the build process stops with a Windows error message saying that some files
are missing, search for the indicated Cygwin package and download it from the Cygwin page.
You can search fast and easily with the Cygwin Package Search tool:
https://cygwin.com/cgi-bin2/package-grep.cgi
Extract the downloaded package into the MinGW installation directory, and
restart the build process.
......@@ -142,6 +142,7 @@ MACRO_REFERENCE_INT \$"{"{WS}{TTCN3IDENTIFIER}{WS}(","{WS}integer{WS})?"}"
}
"["{WS}LOGGING{WS}"]" BEGIN(INITIAL);
"["{WS}PROFILER{WS}"]" BEGIN(INITIAL);
"["{WS}EXECUTE{WS}"]" BEGIN(INITIAL);
"["{WS}EXTERNAL_COMMANDS{WS}"]" BEGIN(INITIAL);
"["{WS}GROUPS{WS}"]" BEGIN(INITIAL);
......
......@@ -10,7 +10,7 @@
/* Version numbers */
#define TTCN3_MAJOR 5
#define TTCN3_MINOR 1
#define TTCN3_MINOR 2
#define TTCN3_PATCHLEVEL 0
//#define TTCN3_BUILDNUMBER 0
......@@ -22,7 +22,7 @@
* TTCN3_VERSION = TTCN3_MAJOR * 1000000 + TTCN3_MINOR * 10000 +
* TTCN3_PATCHLEVEL * 100 + TTCN3_BUILDNUMBER
*/
#define TTCN3_VERSION 50100
#define TTCN3_VERSION 50200
/* A monotonically increasing version number.
* An official release is deemed to have the highest possible build number (99)
......
......@@ -263,17 +263,10 @@ namespace Common {
return versions;
}
void Modules::add_types_to_json_schema(JSON_Tokenizer& json)
void Modules::generate_json_schema(JSON_Tokenizer& json, map<Type*, JSON_Tokenizer>& json_refs)
{
for(size_t i = 0; i < mods_v.size(); ++i) {
mods_v[i]->add_types_to_json_schema(json);
}
}
void Modules::add_func_to_json_schema(map<Type*, JSON_Tokenizer>& json_refs)
{
for(size_t i = 0; i < mods_v.size(); ++i) {
mods_v[i]->add_func_to_json_schema(json_refs);
mods_v[i]->generate_json_schema(json, json_refs);
}
}
......@@ -807,6 +800,12 @@ namespace Common {
mputprintf(effective_module_functions, "%s\"%s\"",
(effective_module_functions ? ", " : ""), get_modid().get_dispname().c_str());
}
if (profiler_enabled && MOD_TTCN == get_moduletype()) {
output->source.static_function_bodies = mputprintf(output->source.static_function_bodies,
"TTCN3_Stack_Depth stack_depth;\n"
"ttcn3_prof.enter_function(\"%s\", 0, \"%s\");\n",
get_filename(), get_modid().get_dispname().c_str());
}
}
output->source.static_function_bodies =
mputstr(output->source.static_function_bodies, output->functions.pre_init);
......@@ -844,6 +843,12 @@ namespace Common {
mputprintf(effective_module_functions, "%s\"%s\"",
(effective_module_functions ? ", " : ""), get_modid().get_dispname().c_str());
}
if (profiler_enabled && MOD_TTCN == get_moduletype()) {
output->source.static_function_bodies = mputprintf(output->source.static_function_bodies,
"TTCN3_Stack_Depth stack_depth;\n"
"ttcn3_prof.enter_function(\"%s\", 0, \"%s\");\n",
get_filename(), get_modid().get_dispname().c_str());
}
}
output->source.static_function_bodies =
mputstr(output->source.static_function_bodies, output->functions.post_init);
......
......@@ -116,14 +116,15 @@ namespace Common {
void generate_code(CodeGenHelper& cgh);
void dump(unsigned level=1) const;
/** Generates JSON schema segments for the types defined in the modules
* and adds them to the JSON schema parameter. */
void add_types_to_json_schema(JSON_Tokenizer& json);
/** Generates JSON schemas containing references to the types defined in the
* modules. Information related to the types' JSON encoding and decoding
* functions is also inserted after the references. */
void add_func_to_json_schema(map<Type*, JSON_Tokenizer>& json_refs);
/** Generates JSON schema segments for the types defined in the modules,
* and references to these types. Information related to the types'
* JSON encoding and decoding functions is also inserted after the references.
*
* @param json JSON document containing the main schema, schema segments for
* the types will be inserted here
* @param json_refs map of JSON documents containing the references and function
* info related to each type */
void generate_json_schema(JSON_Tokenizer& json, map<Type*, JSON_Tokenizer>& json_refs);
};
/**
......@@ -391,15 +392,15 @@ namespace Common {
void generate_code(CodeGenHelper& cgh);
virtual void dump(unsigned level) const;
/** Generates JSON schema segments for the types defined in the module
* and adds them to the JSON schema parameter. */
virtual void add_types_to_json_schema(JSON_Tokenizer&) = 0;
/** Generates JSON schemas containing references to the types that have JSON
* encoding and/or decoding functions declared in the module. Information
* related to these functions is also inserted after the references
* (only for TTCN-3 modules). */
virtual void add_func_to_json_schema(map<Type*, JSON_Tokenizer>&) = 0;
/** Generates JSON schema segments for the types defined in the modules,
* and references to these types. Information related to the types'
* JSON encoding and decoding functions is also inserted after the references.
*
* @param json JSON document containing the main schema, schema segments for
* the types will be inserted here
* @param json_refs map of JSON documents containing the references and function
* info related to each type */
virtual void generate_json_schema(JSON_Tokenizer& json, map<Type*, JSON_Tokenizer>& json_refs) = 0;
};
/**
......
......@@ -298,7 +298,7 @@ namespace Common {
if (++error_count >= max_errors) {
fputs("Maximum number of errors reached, aborting.\n", stderr);
fflush(stderr);
abort();
exit(EXIT_FAILURE);
}
}
......
......@@ -68,7 +68,7 @@ main.cc Real.cc Setting.cc SigParam.cc string.cc subtype.cc Stopwatch.cc \
Type.cc Type_chk.cc Type_codegen.cc TypeCompat.cc \
Typestuff.cc ustring.cc Value.cc Valuestuff.cc XerAttributes.cc subtypestuff.cc CodeGenHelper.cc
MFGEN_SOURCES := makefile.c xpather.cc
MFGEN_SOURCES := makefile.c xpather.cc ProjectGenHelper.cc
TCOV2LCOV_SOURCES := tcov2lcov.cc
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2014 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
///////////////////////////////////////////////////////////////////////////////
#ifndef _LIB_GEN_HELPER_HH
#define _LIB_GEN_HELPER_HH
#include <string>
#include <map>
#include <vector>
#include <cstdio>
class ProjectGenHelper;
class ProjectDescriptor {
public:
explicit ProjectDescriptor(const char* name);
~ProjectDescriptor() { cleanUp(); };
const std::string& getProjectName() const { return projectName; }
void setTPDFileName( const char* name);
const std::string& getTPDFileName() const { return tpdFileName; }
void setTargetExecName(const char* name) { targetExecutableName = std::string(name); }
const std::string& getTargetExecName() const { return targetExecutableName; }
void setProjectAbsTpdDir(const char* name) { projectAbsTpdDir = std::string(name); }
const std::string& getProjectAbsTpdDir() const { return projectAbsTpdDir; }
void setProjectAbsWorkingDir(const char* name);
void setProjectWorkingDir(const char* name) { projectWorkingDir = std::string(name); }
const std::string& getProjectAbsWorkingDir() const { return projectAbsWorkingDir; }
const std::string& getProjectWorkingDir() const { return projectWorkingDir; }
void setLinkingStrategy(bool strategy) { dynamicLinked = strategy; }
bool getLinkingStrategy() const { return dynamicLinked; }
void setLibrary(bool isLib) { library = isLib; }
bool isLibrary() const { return library; }
bool isInitialized();
void addToReferencedProjects(const char* refProjName);
void addToRefProjWorkingDirs(const std::string& subProjDir);
bool hasLinkerLibTo(const std::string& refProjName) const;
bool hasLinkerLib(const char* libName) const; // Linker Lib got from TPD
void addToLibSearchPaths(const char* libSearchPath);
void addToLinkerLibs(const char* linkerLibs);
void print();
void cleanUp();
size_t numOfReferencedProjects() const { return referencedProjects.size(); };
size_t numOfRefProjWorkingDirs() const { return refProjWorkingDirs.size(); };
size_t numOfLibSearchPaths() const { return libSearchPaths.size(); };
size_t numOfLinkerLibs() const { return linkerLibraries.size(); };
const std::string& getReferencedProject(size_t index) const
{ return index < referencedProjects.size() ? referencedProjects[index] : emptyString; };
const std::string& getRefProjWorkingDir(size_t index) const
{ return index < refProjWorkingDirs.size() ? refProjWorkingDirs[index] : emptyString; };
const char* getLibSearchPath(const std::string& subProjName) const;
const char* getLibSearchPath(size_t index) const { return libSearchPaths[index].c_str(); };
const char* getLinkerLib(const std::string& subProjName) const;
const char* getLinkerLib(size_t index) const { return linkerLibraries[index].c_str(); };
size_t getLibSearchPathIndex(const std::string& subProjName) const;
void setLibSearchPath(size_t index, const std::string& relPath) { libSearchPaths[index] = relPath; };
void addTtcn3ModuleName(const char* name) { ttcn3ModuleNames.push_back(name); };
bool hasTtcn3ModuleName(const char* moduleName) const;
void addAsn1ModuleName(const char* name) { asn1ModuleNames.push_back(name); };
bool hasAsn1ModuleName(const char* moduleName) const;
void addUserSource(const char* name) { userSources.push_back(name); };
bool hasUserSource(const char* userSourceName) const;
void addUserHeader(const char* name) { userHeaders.push_back(name); };
bool hasUserHeader(const char* userHeaderName) const;
void addTtcn3PP(const char* name) { ttcnPP.push_back(name); };