Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Projects
Eclipse Titan
titan.core
Commits
af710487
Commit
af710487
authored
Mar 16, 2015
by
Elemer Lelik
Browse files
Sync with 5.2.0
parent
4567b25b
Changes
140
Show whitespace changes
Inline
Side-by-side
Install/.gitignore
View file @
af710487
README.cygwin
View file @
af710487
******************************************************************************
* 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
Cygwin setup
- If Cygwin is installed already, refresh your Cygwin installation
- If Cygwin is installed already, refresh your Cygwin installation
Titan is always build for the newest Cygwin version available.
Titan is always build for the newest Cygwin version available.
...
...
README.linux
View file @
af710487
******************************************************************************
* 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
Build and install Titan on Linux
1.Install required libraries:
1.Install required libraries:
...
@@ -108,6 +116,3 @@ These tests might run for half an hour (regr.tests) to two hours (func.tests)
...
@@ -108,6 +116,3 @@ These tests might run for half an hour (regr.tests) to two hours (func.tests)
6. Optionally , copy Titan into its' final directory.
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.
From here on, you can continue with the Titan installation guide, see /Install/docs, to set environment variables etc.
README.md
View file @
af710487
...
@@ -20,26 +20,26 @@ http://polarsys.org/sites/default/files/custom_uploads/TITAN%20Datasheet%20A4%20
...
@@ -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:
##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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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.
2
.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-linux64-gcc4.8-ubuntu14.04.tgz.sha512
# Related products:
# Related products:
...
...
README.md~
0 → 100644
View file @
af710487
# 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
README.mingw
0 → 100644
View file @
af710487
******************************************************************************
* 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.
common/config_preproc_la.l
View file @
af710487
...
@@ -142,6 +142,7 @@ MACRO_REFERENCE_INT \$"{"{WS}{TTCN3IDENTIFIER}{WS}(","{WS}integer{WS})?"}"
...
@@ -142,6 +142,7 @@ MACRO_REFERENCE_INT \$"{"{WS}{TTCN3IDENTIFIER}{WS}(","{WS}integer{WS})?"}"
}
}
"["{WS}LOGGING{WS}"]" BEGIN(INITIAL);
"["{WS}LOGGING{WS}"]" BEGIN(INITIAL);
"["{WS}PROFILER{WS}"]" BEGIN(INITIAL);
"["{WS}EXECUTE{WS}"]" BEGIN(INITIAL);
"["{WS}EXECUTE{WS}"]" BEGIN(INITIAL);
"["{WS}EXTERNAL_COMMANDS{WS}"]" BEGIN(INITIAL);
"["{WS}EXTERNAL_COMMANDS{WS}"]" BEGIN(INITIAL);
"["{WS}GROUPS{WS}"]" BEGIN(INITIAL);
"["{WS}GROUPS{WS}"]" BEGIN(INITIAL);
...
...
common/version.h
View file @
af710487
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
/* Version numbers */
/* Version numbers */
#define TTCN3_MAJOR 5
#define TTCN3_MAJOR 5
#define TTCN3_MINOR
1
#define TTCN3_MINOR
2
#define TTCN3_PATCHLEVEL 0
#define TTCN3_PATCHLEVEL 0
//#define TTCN3_BUILDNUMBER 0
//#define TTCN3_BUILDNUMBER 0
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
* TTCN3_VERSION = TTCN3_MAJOR * 1000000 + TTCN3_MINOR * 10000 +
* TTCN3_VERSION = TTCN3_MAJOR * 1000000 + TTCN3_MINOR * 10000 +
* TTCN3_PATCHLEVEL * 100 + TTCN3_BUILDNUMBER
* TTCN3_PATCHLEVEL * 100 + TTCN3_BUILDNUMBER
*/
*/
#define TTCN3_VERSION 50
1
00
#define TTCN3_VERSION 50
2
00
/* A monotonically increasing version number.
/* A monotonically increasing version number.
* An official release is deemed to have the highest possible build number (99)
* An official release is deemed to have the highest possible build number (99)
...
...
compiler2/AST.cc
View file @
af710487
...
@@ -263,17 +263,10 @@ namespace Common {
...
@@ -263,17 +263,10 @@ namespace Common {
return
versions
;
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
)
{
for
(
size_t
i
=
0
;
i
<
mods_v
.
size
();
++
i
)
{
mods_v
[
i
]
->
add_types_to_json_schema
(
json
);
mods_v
[
i
]
->
generate_json_schema
(
json
,
json_refs
);
}
}
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
);
}
}
}
}
...
@@ -807,6 +800,12 @@ namespace Common {
...
@@ -807,6 +800,12 @@ namespace Common {
mputprintf
(
effective_module_functions
,
"%s
\"
%s
\"
"
,
mputprintf
(
effective_module_functions
,
"%s
\"
%s
\"
"
,
(
effective_module_functions
?
", "
:
""
),
get_modid
().
get_dispname
().
c_str
());
(
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
=
output
->
source
.
static_function_bodies
=
mputstr
(
output
->
source
.
static_function_bodies
,
output
->
functions
.
pre_init
);
mputstr
(
output
->
source
.
static_function_bodies
,
output
->
functions
.
pre_init
);
...
@@ -844,6 +843,12 @@ namespace Common {
...
@@ -844,6 +843,12 @@ namespace Common {
mputprintf
(
effective_module_functions
,
"%s
\"
%s
\"
"
,
mputprintf
(
effective_module_functions
,
"%s
\"
%s
\"
"
,
(
effective_module_functions
?
", "
:
""
),
get_modid
().
get_dispname
().
c_str
());
(
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
=
output
->
source
.
static_function_bodies
=
mputstr
(
output
->
source
.
static_function_bodies
,
output
->
functions
.
post_init
);
mputstr
(
output
->
source
.
static_function_bodies
,
output
->
functions
.
post_init
);
...
...
compiler2/AST.hh
View file @
af710487
...
@@ -116,14 +116,15 @@ namespace Common {
...
@@ -116,14 +116,15 @@ namespace Common {
void
generate_code
(
CodeGenHelper
&
cgh
);
void
generate_code
(
CodeGenHelper
&
cgh
);
void
dump
(
unsigned
level
=
1
)
const
;
void
dump
(
unsigned
level
=
1
)
const
;
/** Generates JSON schema segments for the types defined in the modules
/** Generates JSON schema segments for the types defined in the modules,
* and adds them to the JSON schema parameter. */
* and references to these types. Information related to the types'
void
add_types_to_json_schema
(
JSON_Tokenizer
&
json
);
* JSON encoding and decoding functions is also inserted after the references.
*
/** Generates JSON schemas containing references to the types defined in the
* @param json JSON document containing the main schema, schema segments for
* modules. Information related to the types' JSON encoding and decoding
* the types will be inserted here
* functions is also inserted after the references. */
* @param json_refs map of JSON documents containing the references and function
void
add_func_to_json_schema
(
map
<
Type
*
,
JSON_Tokenizer
>&
json_refs
);
* info related to each type */
void
generate_json_schema
(
JSON_Tokenizer
&
json
,
map
<
Type
*
,
JSON_Tokenizer
>&
json_refs
);
};
};
/**
/**
...
@@ -391,15 +392,15 @@ namespace Common {
...
@@ -391,15 +392,15 @@ namespace Common {
void
generate_code
(
CodeGenHelper
&
cgh
);
void
generate_code
(
CodeGenHelper
&
cgh
);
virtual
void
dump
(
unsigned
level
)
const
;
virtual
void
dump
(
unsigned
level
)
const
;
/** Generates JSON schema segments for the types defined in the module
/** Generates JSON schema segments for the types defined in the module
s,
* and
adds them to the JSON schema parameter. */
* and
references to these types. Information related to the types'
virtual
void
add_types_to_json_schema
(
JSON_Tokenizer
&
)
=
0
;
* JSON encoding and decoding functions is also inserted after the references.
*
/** Generates JSON schemas containing references to the types that have JSON
* @param json JSON document containing the main schema, schema segments for
*
encoding and/or decoding functions declared in the module. Information
*
the types will be inserted here
*
related to these functions is also inserted after
the references
*
@param json_refs map of JSON documents containing
the references
and function
*
(only for TTCN-3 modules).
*/
*
info related to each type
*/
virtual
void
add_func_to
_json_schema
(
map
<
Type
*
,
JSON_Tokenizer
>&
)
=
0
;
virtual
void
generate
_json_schema
(
JSON_Tokenizer
&
json
,
map
<
Type
*
,
JSON_Tokenizer
>&
json_refs
)
=
0
;
};
};
/**
/**
...
...
compiler2/CompilerError.cc
View file @
af710487
...
@@ -298,7 +298,7 @@ namespace Common {
...
@@ -298,7 +298,7 @@ namespace Common {
if
(
++
error_count
>=
max_errors
)
{
if
(
++
error_count
>=
max_errors
)
{
fputs
(
"Maximum number of errors reached, aborting.
\n
"
,
stderr
);
fputs
(
"Maximum number of errors reached, aborting.
\n
"
,
stderr
);
fflush
(
stderr
);
fflush
(
stderr
);
abort
(
);
exit
(
EXIT_FAILURE
);
}
}
}
}
...
...
compiler2/Makefile
View file @
af710487
...
@@ -68,7 +68,7 @@ main.cc Real.cc Setting.cc SigParam.cc string.cc subtype.cc Stopwatch.cc \
...
@@ -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
\
Type.cc Type_chk.cc Type_codegen.cc TypeCompat.cc
\
Typestuff.cc ustring.cc Value.cc Valuestuff.cc XerAttributes.cc subtypestuff.cc CodeGenHelper.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
TCOV2LCOV_SOURCES
:=
tcov2lcov.cc
...
...
compiler2/ProjectGenHelper.cc
0 → 100644
View file @
af710487
///////////////////////////////////////////////////////////////////////////////
// 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
///////////////////////////////////////////////////////////////////////////////
#include "ProjectGenHelper.hh"
#include "../common/memory.h"
#include "error.h"
#include <limits>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
const
std
::
string
ProjectDescriptor
::
emptyString
=
std
::
string
();
ProjectDescriptor
::
ProjectDescriptor
(
const
char
*
name
)
:
projectName
(
std
::
string
(
name
)),
tpdFileName
(),
targetExecutableName
(),
projectAbsTpdDir
(),
projectAbsWorkingDir
(),
projectWorkingDir
(),
library
(
false
),
dynamicLinked
(
false
),
referencedProjects
(),
refProjWorkingDirs
(),
libSearchPaths
(),
linkerLibraries
(),
ttcn3ModuleNames
(),
asn1ModuleNames
(),
userSources
(),
userHeaders
(),
ttcnPP
(),
initialized
(
false
)
{}
void
ProjectDescriptor
::
cleanUp
()
{
referencedProjects
.
clear
();
refProjWorkingDirs
.
clear
(),
libSearchPaths
.
clear
();
linkerLibraries
.
clear
();
ttcn3ModuleNames
.
clear
();
asn1ModuleNames
.
clear
();
userSources
.
clear
();
userHeaders
.
clear
();
ttcnPP
.
clear
();
}
bool
ProjectDescriptor
::
isInitialized
()
{
if
(
!
projectName
.
empty
()
&&
!
targetExecutableName
.
empty
()
&&
!
projectAbsTpdDir
.
empty
()
&&
!
projectAbsWorkingDir
.
empty
()
&&
!
projectWorkingDir
.
empty
())
initialized
=
true
;
return
initialized
;
}
void
ProjectDescriptor
::
setTPDFileName
(
const
char
*
name
)
{
const
char
SEPARATOR
=
'/'
;
std
::
string
fileName
(
name
);
size_t
refProjPos
=
fileName
.
find_last_of
(
SEPARATOR
);
if
(
std
::
string
::
npos
==
refProjPos
)
{
tpdFileName
=
fileName
;
}
else
{
tpdFileName
=
fileName
.
substr
(
refProjPos
+
1
);
}
}
void
ProjectDescriptor
::
setProjectAbsWorkingDir
(
const
char
*
name
)
{
if
(
!
name
)
{
ERROR
(
"No path was given to the working directory. Check if 'r' flag is set "
);
return
;
}
projectAbsWorkingDir
=
std
::
string
(
name
);
ProjectGenHelper
::
Instance
().
setRootDirOS
(
name
);
}
void
ProjectDescriptor
::
addToReferencedProjects
(
const
char
*
refProjName
)
{
std
::
vector
<
std
::
string
>::
iterator
it
;
for
(
it
=
referencedProjects
.
begin
();
it
!=
referencedProjects
.
end
();
++
it
)
{
if
(
*
it
==
std
::
string
(
refProjName
))
return
;
}
referencedProjects
.
push_back
(
std
::
string
(
refProjName
));
}
void
ProjectDescriptor
::
addToRefProjWorkingDirs
(
const
std
::
string
&
subProjDir
)
{
std
::
vector
<
std
::
string
>::
iterator
it
;
for
(
it
=
refProjWorkingDirs
.
begin
();
it
!=
refProjWorkingDirs
.
end
();
++
it
)
{
if
(
*
it
==
subProjDir
)
return
;
}
refProjWorkingDirs
.
push_back
(
subProjDir
);
}
bool
ProjectDescriptor
::
hasLinkerLibTo
(
const
std
::
string
&
refProjName
)
const
{
ProjectDescriptor
*
refProj
=
ProjectGenHelper
::
Instance
().
getTargetOfProject
(
refProjName
.
c_str
());
for
(
size_t
i
=
0
;
i
<
referencedProjects
.
size
();
++
i
){
if
(
refProj
&&
refProj
->
library
)
return
true
;
}
return
false
;
}
bool
ProjectDescriptor
::
hasLinkerLib
(
const
char
*
libName
)
const
{
std
::
string
linkerLibName
(
libName
);
std
::
vector
<
std
::
string
>::
const_iterator
it
;
for
(
it
=
linkerLibraries
.
begin
();
it
!=
linkerLibraries
.
end
();
++
it
)
{
if
(
*
it
==
linkerLibName
)
return
true
;
}
return
false
;
}
void
ProjectDescriptor
::
addToLibSearchPaths
(
const
char
*
libSearchPath
)
{
std
::
string
searchPath
(
libSearchPath
);
std
::
vector
<
std
::
string
>::
iterator
it
;
for
(
it
=
libSearchPaths
.
begin
();
it
!=
libSearchPaths
.
end
();
++
it
)
{
if
(
*
it
==
searchPath
)
return
;
}
libSearchPaths
.
push_back
(
libSearchPath
);
}
void
ProjectDescriptor
::
addToLinkerLibs
(
const
char
*
linkerLibs
)
{
std
::
string
llibs
(
linkerLibs
);
std
::
vector
<
std
::
string
>::
iterator
it
;
for
(
it
=
linkerLibraries
.
begin
();
it
!=
linkerLibraries
.
end
();
++
it
)
{
if
(
*
it
==
llibs
)
return
;
}
linkerLibraries
.
push_back
(
linkerLibs
);
}
size_t
ProjectDescriptor
::
getLibSearchPathIndex
(
const
std
::
string
&
subProjName
)
const
{
for
(
size_t
i
=
0
;
i
<
libSearchPaths
.
size
();
++
i
)
{
if
(
std
::
string
::
npos
!=
libSearchPaths
[
i
].
find
(
subProjName
))
return
i
;
}
return
std
::
numeric_limits
<
unsigned
int
>::
max
();
}
const
char
*
ProjectDescriptor
::
getLibSearchPath
(
const
std
::
string
&
subProjName
)
const
{
for
(
size_t
i
=
0
;
i
<
libSearchPaths
.
size
();
++
i
)
{
if
(
std
::
string
::
npos
!=
libSearchPaths
[
i
].
find
(
subProjName
))
return
libSearchPaths
[
i
].
c_str
();
}
return
NULL
;
}
bool
ProjectDescriptor
::
hasTtcn3ModuleName
(
const
char
*
moduleName
)
const
{
std
::
string
modName
(
moduleName
);
std
::
vector
<
std
::
string
>::
const_iterator
it
;
for
(
it
=
ttcn3ModuleNames
.
begin
();
it
!=
ttcn3ModuleNames
.
end
();
++
it
)
{
if
(
*
it
==
modName
)
return
true
;
}
return
false
;
}
bool
ProjectDescriptor
::
hasAsn1ModuleName
(
const
char
*
moduleName
)
const
{
std
::
string
modName
(
moduleName
);
std
::
vector
<
std
::
string
>::
const_iterator
it
;
for
(
it
=
asn1ModuleNames
.
begin
();
it
!=
asn1ModuleNames
.
end
();
++
it
)
{
if
(
*
it
==
modName
)
return
true
;
}
return
false
;
}
bool
ProjectDescriptor
::
hasUserSource
(
const
char
*
userSourceName
)
const
{
std
::
string
sourceName
(
userSourceName
);
std
::
vector
<
std
::
string
>::
const_iterator
it
;
for
(
it
=
userSources
.
begin
();
it
!=
userSources
.
end
();
++
it
)
{
if
(
*
it
==
sourceName
)
return
true
;
}
return
false
;
}
bool
ProjectDescriptor
::
hasUserHeader
(
const
char
*
userHeaderName
)
const
{
std
::
string
headerName
(
userHeaderName
);
std
::
vector
<
std
::
string
>::
const_iterator
it
;
for
(
it
=
userHeaders
.
begin
();
it
!=
userHeaders
.
end
();
++
it
)
{
if
(
*
it
==
headerName
)
return
true
;
}
return
false
;
}
bool
ProjectDescriptor
::
hasTtcn3PP
(
const
char
*
ttcnPPName
)
const
{
std
::
string
ttcnPPFile
(
ttcnPPName
);
std
::
vector
<
std
::
string
>::
const_iterator
it
;
for
(
it
=
ttcnPP
.
begin
();
it
!=
ttcnPP
.
end
();
++
it
)
{
if
(
*
it
==
ttcnPPFile
)
return
true
;
}
return
false
;
}
std
::
string
ProjectDescriptor
::
setRelativePathTo
(
const
std
::
string
&
absPathTo
)
{
if
(
projectAbsWorkingDir
.
empty
())
return
std
::
string
();
const
char
SEPARATOR
=
'/'
;
if
(
projectAbsWorkingDir
.
at
(
0
)
!=
SEPARATOR
||
absPathTo
.
at
(
0
)
!=
SEPARATOR
)