Commit 2b489d28 authored by Arpad Lovassy's avatar Arpad Lovassy Committed by Gerrit Code Review
Browse files

Merge "Implemented object-oriented features - stage 6.4 (bug 552011)"

parents fffd1734 93fd0543
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
compiler \- TTCN-3 and ASN.1 to C++ translator compiler \- TTCN-3 and ASN.1 to C++ translator
.SH SYNOPSIS .SH SYNOPSIS
.B compiler .B compiler
.RB "[\| " \-abcdDeEfFgiIjlLMnNpqrRsStuwxXyY0 " \|]" .RB "[\| " \-abcdDeEfFgiIjklLMnNpqrRsStuwxXyY0 " \|]"
.RB "[\| " \-V .RB "[\| " \-V
.IR " verb_level" " \|]" .IR " verb_level" " \|]"
.RB "[\| " \-J .RB "[\| " \-J
...@@ -131,6 +131,9 @@ Disables JSON encoder/decoder functions. ...@@ -131,6 +131,9 @@ Disables JSON encoder/decoder functions.
.BI \-J " file" .BI \-J " file"
Read a list of input files from the provided file. Read a list of input files from the provided file.
.TP .TP
.B \-k
Enables object-oriented features.
.TP
.BI \-K " file" .BI \-K " file"
Enables selective code coverage. Enables selective code coverage.
.TP .TP
......
...@@ -395,7 +395,7 @@ static boolean is_valid_asn1_filename(const char* file_name) ...@@ -395,7 +395,7 @@ static boolean is_valid_asn1_filename(const char* file_name)
static void usage() static void usage()
{ {
fprintf(stderr, "\n" fprintf(stderr, "\n"
"usage: %s [-abcdDeEfFgiIjlLMnNOpqrRsStuwxXyY0] [-J file] [-K file] [-z file] [-V verb_level]\n" "usage: %s [-abcdDeEfFgiIjklLMnNOpqrRsStuwxXyY0] [-J file] [-K file] [-z file] [-V verb_level]\n"
" [-o dir] [-U none|type|'number'] [-P modulename.top_level_pdu_name] [-Q number] ...\n" " [-o dir] [-U none|type|'number'] [-P modulename.top_level_pdu_name] [-Q number] ...\n"
" [-T] module.ttcn [-A] module.asn ...\n" " [-T] module.ttcn [-A] module.asn ...\n"
" or %s -v\n" " or %s -v\n"
...@@ -417,6 +417,7 @@ static void usage() ...@@ -417,6 +417,7 @@ static void usage()
" -I: enable real-time testing features\n" " -I: enable real-time testing features\n"
" -j: disable JSON encoder/decoder functions\n" " -j: disable JSON encoder/decoder functions\n"
" -J file: read input files from file\n" " -J file: read input files from file\n"
" -k: enable object-oriented features\n"
" -K file: enable selective code coverage\n" " -K file: enable selective code coverage\n"
" -l: include source line info in C++ code\n" " -l: include source line info in C++ code\n"
" -L: add source line info for logging\n" " -L: add source line info for logging\n"
......
...@@ -276,6 +276,7 @@ struct makefile_struct { ...@@ -276,6 +276,7 @@ struct makefile_struct {
boolean enable_legacy_encoding; boolean enable_legacy_encoding;
boolean disable_userinfo; boolean disable_userinfo;
boolean realtime_features; boolean realtime_features;
boolean oop_features;
struct string_list* solspeclibraries; /* not owned */ struct string_list* solspeclibraries; /* not owned */
struct string_list* sol8speclibraries; /* not owned */ struct string_list* sol8speclibraries; /* not owned */
struct string_list* linuxspeclibraries; /* not owned */ struct string_list* linuxspeclibraries; /* not owned */
...@@ -348,6 +349,7 @@ static void init_makefile_struct(struct makefile_struct *makefile) ...@@ -348,6 +349,7 @@ static void init_makefile_struct(struct makefile_struct *makefile)
makefile->enable_legacy_encoding = FALSE; makefile->enable_legacy_encoding = FALSE;
makefile->disable_userinfo = FALSE; makefile->disable_userinfo = FALSE;
makefile->realtime_features = FALSE; makefile->realtime_features = FALSE;
makefile->oop_features = FALSE;
makefile->solspeclibraries = NULL; makefile->solspeclibraries = NULL;
makefile->sol8speclibraries = NULL; makefile->sol8speclibraries = NULL;
makefile->linuxspeclibraries = NULL; makefile->linuxspeclibraries = NULL;
...@@ -2255,7 +2257,7 @@ static void print_makefile(struct makefile_struct *makefile) ...@@ -2255,7 +2257,7 @@ static void print_makefile(struct makefile_struct *makefile)
"AR = ar\n" "AR = ar\n"
"ARFLAGS = \n\n" "ARFLAGS = \n\n"
"# Flags for the TTCN-3 and ASN.1 compiler:\n" "# Flags for the TTCN-3 and ASN.1 compiler:\n"
"COMPILER_FLAGS =%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n\n" "COMPILER_FLAGS =%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n\n"
"# Execution mode: (either ttcn3 or ttcn3-parallel)\n" "# Execution mode: (either ttcn3 or ttcn3-parallel)\n"
"TTCN3_LIB = ttcn3%s%s%s\n\n" "TTCN3_LIB = ttcn3%s%s%s\n\n"
#ifdef LICENSE #ifdef LICENSE
...@@ -2304,6 +2306,7 @@ static void print_makefile(struct makefile_struct *makefile) ...@@ -2304,6 +2306,7 @@ static void print_makefile(struct makefile_struct *makefile)
(makefile->profiled_file_list ? " -z $(PROFILED_FILE_LIST)" : ""), (makefile->profiled_file_list ? " -z $(PROFILED_FILE_LIST)" : ""),
(makefile->disable_userinfo ? " -D" : ""), (makefile->disable_userinfo ? " -D" : ""),
(makefile->realtime_features ? " -I" : ""), (makefile->realtime_features ? " -I" : ""),
(makefile->oop_features ? " -k" : ""),
/* end of COMPILER FLAGS */ /* end of COMPILER FLAGS */
(makefile->use_runtime_2 ? "-rt2" : ""), /* TTCN3_LIB */ (makefile->use_runtime_2 ? "-rt2" : ""), /* TTCN3_LIB */
(makefile->single_mode ? "" : "-parallel"), (makefile->single_mode ? "" : "-parallel"),
...@@ -4685,7 +4688,7 @@ static void generate_makefile(size_t n_arguments, char *arguments[], ...@@ -4685,7 +4688,7 @@ static void generate_makefile(size_t n_arguments, char *arguments[],
boolean linenumbersonlymsg, boolean includesourceinfo, boolean addsourcelineinfo, boolean suppresswarnings, boolean linenumbersonlymsg, boolean includesourceinfo, boolean addsourcelineinfo, boolean suppresswarnings,
boolean outparamboundness, boolean omit_in_value_list, boolean warnings_for_bad_variants, boolean activate_debugger, boolean outparamboundness, boolean omit_in_value_list, boolean warnings_for_bad_variants, boolean activate_debugger,
boolean ignore_untagged_on_top_union, boolean disable_predef_ext_folder, boolean enable_legacy_encoding, boolean disable_userinfo, boolean ignore_untagged_on_top_union, boolean disable_predef_ext_folder, boolean enable_legacy_encoding, boolean disable_userinfo,
boolean realtime_features, struct string_list* solspeclibraries, struct string_list* sol8speclibraries, boolean realtime_features, boolean oop_features, struct string_list* solspeclibraries, struct string_list* sol8speclibraries,
struct string_list* linuxspeclibraries, struct string_list* freebsdspeclibraries, struct string_list* linuxspeclibraries, struct string_list* freebsdspeclibraries,
struct string_list* win32speclibraries, const char* ttcn3preprocessor, struct string_list* linkerlibraries, struct string_list* win32speclibraries, const char* ttcn3preprocessor, struct string_list* linkerlibraries,
struct string_list* additionalObjects, struct string_list* linkerlibsearchpath, char* generatorCommandOutput, struct string_list* additionalObjects, struct string_list* linkerlibsearchpath, char* generatorCommandOutput,
...@@ -4746,6 +4749,7 @@ static void generate_makefile(size_t n_arguments, char *arguments[], ...@@ -4746,6 +4749,7 @@ static void generate_makefile(size_t n_arguments, char *arguments[],
makefile.enable_legacy_encoding = enable_legacy_encoding; makefile.enable_legacy_encoding = enable_legacy_encoding;
makefile.disable_userinfo = disable_userinfo; makefile.disable_userinfo = disable_userinfo;
makefile.realtime_features = realtime_features; makefile.realtime_features = realtime_features;
makefile.oop_features = oop_features;
makefile.solspeclibraries = solspeclibraries; makefile.solspeclibraries = solspeclibraries;
makefile.sol8speclibraries = sol8speclibraries; makefile.sol8speclibraries = sol8speclibraries;
makefile.linuxspeclibraries = linuxspeclibraries; makefile.linuxspeclibraries = linuxspeclibraries;
...@@ -4912,6 +4916,7 @@ static void usage(void) ...@@ -4912,6 +4916,7 @@ static void usage(void)
" -i: enable real-time testing features\n" " -i: enable real-time testing features\n"
" -I path: Add path to the search paths when using TPD files\n" " -I path: Add path to the search paths when using TPD files\n"
" -J file: The names of files taken from file instead of command line\n" " -J file: The names of files taken from file instead of command line\n"
" -k: enable object-oriented features\n"
" -K file: enable selective code coverage\n" " -K file: enable selective code coverage\n"
" -l: use dynamic linking\n" " -l: use dynamic linking\n"
" -L: create makefile with library archive as the default target\n" " -L: create makefile with library archive as the default target\n"
...@@ -4967,7 +4972,7 @@ int main(int argc, char *argv[]) ...@@ -4967,7 +4972,7 @@ int main(int argc, char *argv[])
Sflag = FALSE, Vflag = FALSE, Dflag = FALSE, Wflag = FALSE, Sflag = FALSE, Vflag = FALSE, Dflag = FALSE, Wflag = FALSE,
djflag = FALSE, doerflag = FALSE, Zflag = FALSE, Hflag = FALSE, Mflag = FALSE, djflag = FALSE, doerflag = FALSE, Zflag = FALSE, Hflag = FALSE, Mflag = FALSE,
diflag = FALSE, zflag = FALSE, Eflag = FALSE, nflag = FALSE, diflag = FALSE, zflag = FALSE, Eflag = FALSE, nflag = FALSE,
Nflag = FALSE, Gflag = FALSE, duflag = FALSE, iflag = FALSE; Nflag = FALSE, Gflag = FALSE, duflag = FALSE, iflag = FALSE, kflag = FALSE;
boolean error_flag = FALSE; boolean error_flag = FALSE;
char *output_file = NULL; char *output_file = NULL;
char *ets_name = NULL; char *ets_name = NULL;
...@@ -5028,7 +5033,7 @@ int main(int argc, char *argv[]) ...@@ -5028,7 +5033,7 @@ int main(int argc, char *argv[])
} }
for ( ; ; ) { for ( ; ; ) {
int c = getopt(argc, argv, "O:ab:c" C_flag "dDe:EfFgGiI:J:K:o:lLmMnNpP:rRsSt:TU:vVwWXYz:ZH"); int c = getopt(argc, argv, "O:ab:c" C_flag "dDe:EfFgGiI:J:kK:o:lLmMnNpP:rRsSt:TU:vVwWXYz:ZH");
if (c == -1) break; if (c == -1) break;
switch (c) { switch (c) {
case 'O': case 'O':
...@@ -5200,6 +5205,9 @@ int main(int argc, char *argv[]) ...@@ -5200,6 +5205,9 @@ int main(int argc, char *argv[])
case 'Z': case 'Z':
SET_FLAG(Z); SET_FLAG(Z);
break; break;
case 'k':
SET_FLAG(k);
break;
default: default:
error_flag = TRUE; error_flag = TRUE;
break; break;
...@@ -5212,7 +5220,7 @@ int main(int argc, char *argv[]) ...@@ -5212,7 +5220,7 @@ int main(int argc, char *argv[])
if ( aflag || bflag || cflag || Cflag || dflag || eflag || fflag || Fflag || gflag if ( aflag || bflag || cflag || Cflag || dflag || eflag || fflag || Fflag || gflag
|| mflag || oflag || lflag || pflag || Pflag || rflag || Rflag || sflag || Gflag || mflag || oflag || lflag || pflag || Pflag || rflag || Rflag || sflag || Gflag
|| tflag || Tflag || Vflag || wflag || Xflag || Kflag || Dflag || Wflag || Yflag || tflag || Tflag || Vflag || wflag || Xflag || Kflag || Dflag || Wflag || Yflag
|| Zflag || Hflag || Mflag || zflag || Eflag || nflag || iflag || Zflag || Hflag || Mflag || zflag || Eflag || nflag || iflag || kflag
|| n_other_files > 0 || n_search_paths > 0) || n_other_files > 0 || n_search_paths > 0)
error_flag = TRUE; error_flag = TRUE;
} }
...@@ -5417,7 +5425,7 @@ int main(int argc, char *argv[]) ...@@ -5417,7 +5425,7 @@ int main(int argc, char *argv[])
create_symlink_list, ttcn3_prep_includes, ttcn3_prep_defines, ttcn3_prep_undefines, prep_includes, prep_defines, prep_undefines, &csmode, create_symlink_list, ttcn3_prep_includes, ttcn3_prep_defines, ttcn3_prep_undefines, prep_includes, prep_defines, prep_undefines, &csmode,
&quflag, &dsflag, &cxxcompiler, &optlevel, &optflags, &linkerOptions, &semantic_check_only, &disable_attibute_validation, &quflag, &dsflag, &cxxcompiler, &optlevel, &optflags, &linkerOptions, &semantic_check_only, &disable_attibute_validation,
&dbflag, &drflag, &dtflag, &dxflag, &djflag, &doerflag, &fxflag, &doflag, &gfflag, &lnflag, &isflag, &dbflag, &drflag, &dtflag, &dxflag, &djflag, &doerflag, &fxflag, &doflag, &gfflag, &lnflag, &isflag,
&asflag, &temp_wflag, &Yflag, &Mflag, &Eflag, &nflag, &Nflag, &diflag, &Gflag, &duflag, &iflag, &asflag, &temp_wflag, &Yflag, &Mflag, &Eflag, &nflag, &Nflag, &diflag, &Gflag, &duflag, &iflag, &kflag,
solspeclibraries, sol8speclibraries, linuxspeclibraries, freebsdspeclibraries, win32speclibraries, &ttcn3prep, solspeclibraries, sol8speclibraries, linuxspeclibraries, freebsdspeclibraries, win32speclibraries, &ttcn3prep,
linkerlibraries, additionalObjects, linkerlibsearchpath, Vflag, Dflag, &Zflag, &Hflag, linkerlibraries, additionalObjects, linkerlibsearchpath, Vflag, Dflag, &Zflag, &Hflag,
&generatorCommandOutput, target_placement_list, Wflag, run_command_list, required_configs, &profiled_file_list, search_paths, n_search_paths, &makefileScript); &generatorCommandOutput, target_placement_list, Wflag, run_command_list, required_configs, &profiled_file_list, search_paths, n_search_paths, &makefileScript);
...@@ -5468,7 +5476,7 @@ int main(int argc, char *argv[]) ...@@ -5468,7 +5476,7 @@ int main(int argc, char *argv[])
cxxcompiler, optlevel, optflags, linkerOptions, cxxcompiler, optlevel, optflags, linkerOptions,
semantic_check_only, disable_attibute_validation, dbflag, drflag, dtflag, dxflag, djflag, doerflag, semantic_check_only, disable_attibute_validation, dbflag, drflag, dtflag, dxflag, djflag, doerflag,
fxflag, doflag, gfflag, lnflag, isflag, asflag, wflag, Yflag, Mflag, Eflag, nflag, Nflag, diflag, fxflag, doflag, gfflag, lnflag, isflag, asflag, wflag, Yflag, Mflag, Eflag, nflag, Nflag, diflag,
Gflag, duflag, iflag, solspeclibraries, sol8speclibraries, linuxspeclibraries, Gflag, duflag, iflag, kflag, solspeclibraries, sol8speclibraries, linuxspeclibraries,
freebsdspeclibraries, win32speclibraries, ttcn3prep, linkerlibraries, additionalObjects, freebsdspeclibraries, win32speclibraries, ttcn3prep, linkerlibraries, additionalObjects,
linkerlibsearchpath, generatorCommandOutput, target_placement_list); linkerlibsearchpath, generatorCommandOutput, target_placement_list);
if (makefileScript != NULL) { if (makefileScript != NULL) {
......
...@@ -7475,6 +7475,9 @@ namespace Ttcn { ...@@ -7475,6 +7475,9 @@ namespace Ttcn {
checked = true; checked = true;
Error_Context cntxt(this, "In external function definition `%s'", Error_Context cntxt(this, "In external function definition `%s'",
id->get_dispname().c_str()); id->get_dispname().c_str());
if (!ext_keyword && my_scope->get_scope_class()->is_external()) {
error("Missing function body or `external' keyword");
}
fp_list->chk(asstype); fp_list->chk(asstype);
if (return_type) { if (return_type) {
Error_Context cntxt2(return_type, "In return type"); Error_Context cntxt2(return_type, "In return type");
......
...@@ -1550,6 +1550,7 @@ namespace Ttcn { ...@@ -1550,6 +1550,7 @@ namespace Ttcn {
// pretty or compact printing for json or xml // pretty or compact printing for json or xml
Ttcn::PrintingType *printing; Ttcn::PrintingType *printing;
bool deterministic; bool deterministic;
bool ext_keyword;
/// Copy constructor disabled /// Copy constructor disabled
Def_ExtFunction(const Def_ExtFunction& p); Def_ExtFunction(const Def_ExtFunction& p);
/// %Assignment disabled /// %Assignment disabled
...@@ -1568,12 +1569,12 @@ namespace Ttcn { ...@@ -1568,12 +1569,12 @@ namespace Ttcn {
*/ */
Def_ExtFunction(bool p_deterministic, Identifier *p_id, FormalParList *p_fpl, Def_ExtFunction(bool p_deterministic, Identifier *p_id, FormalParList *p_fpl,
Type *p_return_type, bool returns_template, Type *p_return_type, bool returns_template,
template_restriction_t p_template_restriction) template_restriction_t p_template_restriction, bool p_ext_keyword)
: Def_Function_Base(true, p_id, p_fpl, p_return_type, returns_template, : Def_Function_Base(true, p_id, p_fpl, p_return_type, returns_template,
p_template_restriction), p_template_restriction),
function_type(EXTFUNC_MANUAL), encoding_type(Type::CT_UNDEF), function_type(EXTFUNC_MANUAL), encoding_type(Type::CT_UNDEF),
encoding_options(0), eb_list(0), printing(0), encoding_options(0), eb_list(0), printing(0),
deterministic(p_deterministic) { } deterministic(p_deterministic), ext_keyword(p_ext_keyword) { }
~Def_ExtFunction(); ~Def_ExtFunction();
virtual Def_ExtFunction *clone() const; virtual Def_ExtFunction *clone() const;
virtual void set_fullname(const string& p_fullname); virtual void set_fullname(const string& p_fullname);
......
...@@ -3318,7 +3318,9 @@ namespace Ttcn { ...@@ -3318,7 +3318,9 @@ namespace Ttcn {
if (final && abstract) { if (final && abstract) {
error("Final classes cannot be abstract"); error("Final classes cannot be abstract");
} }
// TODO: external? if (external && abstract) {
error("External classes cannot be abstract");
}
if (base_type != NULL) { if (base_type != NULL) {
Error_Context cntxt(base_type, "In superclass definition"); Error_Context cntxt(base_type, "In superclass definition");
base_type->chk(); base_type->chk();
...@@ -3335,6 +3337,9 @@ namespace Ttcn { ...@@ -3335,6 +3337,9 @@ namespace Ttcn {
if (base_class->final) { if (base_class->final) {
base_type->error("The superclass cannot be final"); base_type->error("The superclass cannot be final");
} }
if (external && !base_class->external) {
base_type->error("An external class cannot extend an internal class");
}
} }
} }
...@@ -3480,6 +3485,25 @@ namespace Ttcn { ...@@ -3480,6 +3485,25 @@ namespace Ttcn {
finally_block->chk(); finally_block->chk();
} }
if (external) {
for (size_t i = 0; i < members->get_nof_asss(); ++i) {
Common::Assignment* ass = members->get_ass_byIndex(i, false);
switch (ass->get_asstype()) {
case Common::Assignment::A_EXT_FUNCTION:
case Common::Assignment::A_EXT_FUNCTION_RVAL:
case Common::Assignment::A_EXT_FUNCTION_RTEMP:
// OK
break;
default:
ass->error("An external class cannot contain a %s", ass->get_assname());
break;
}
}
if (finally_block != NULL) {
finally_block->error("An external class cannot have a destructor");
}
}
if (abstract) { if (abstract) {
// create a map of all abstract functions (including inherited ones) // create a map of all abstract functions (including inherited ones)
if (base_class != NULL && base_class->abstract) { if (base_class != NULL && base_class->abstract) {
......
...@@ -791,6 +791,7 @@ public: ...@@ -791,6 +791,7 @@ public:
void set_my_def(Def_Type* p_def); void set_my_def(Def_Type* p_def);
Def_Type* get_my_def() { return my_def; } Def_Type* get_my_def() { return my_def; }
boolean is_abstract() const { return abstract; } boolean is_abstract() const { return abstract; }
boolean is_external() const { return external; }
void set_fullname(const string& p_fullname); void set_fullname(const string& p_fullname);
void set_my_scope(Scope* p_scope); void set_my_scope(Scope* p_scope);
......
...@@ -3654,12 +3654,20 @@ ClassFunctionDef: ...@@ -3654,12 +3654,20 @@ ClassFunctionDef:
$9.template_restriction); $9.template_restriction);
$$->set_location(infile, @$); $$->set_location(infile, @$);
} }
| ExtKeyword FunctionKeyword optFinalModifier optAbstractModifier | ExtKeyword FunctionKeyword optFinalModifier
optDeterministicModifier IDentifier '(' optFunctionFormalParList ')' optDeterministicModifier IDentifier '(' optFunctionFormalParList ')'
optReturnType optReturnType
{ {
$$ = new Def_ExtFunction($5, $6, $8, $10.type, $10.returns_template, $$ = new Def_ExtFunction($4, $5, $7, $9.type, $9.returns_template,
$10.template_restriction); $9.template_restriction, true);
$$->set_location(infile, @$);
}
| FunctionKeyword optFinalModifier
optDeterministicModifier IDentifier '(' optFunctionFormalParList ')'
optReturnType
{
$$ = new Def_ExtFunction($3, $4, $6, $8.type, $8.returns_template,
$8.template_restriction, false);
$$->set_location(infile, @$); $$->set_location(infile, @$);
} }
; ;
...@@ -5634,7 +5642,7 @@ ExtFunctionDef: // 276 ...@@ -5634,7 +5642,7 @@ ExtFunctionDef: // 276
{ {
$6->set_location(infile, @5, @7); $6->set_location(infile, @5, @7);
$$ = new Def_ExtFunction($3, $4, $6, $8.type, $8.returns_template, $$ = new Def_ExtFunction($3, $4, $6, $8.type, $8.returns_template,
$8.template_restriction); $8.template_restriction, true);
$$->set_location(infile, @$); $$->set_location(infile, @$);
} }
; ;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
ttcn3_makefilegen \- Makefile Generator ttcn3_makefilegen \- Makefile Generator
.SH SYNOPSIS .SH SYNOPSIS
.B ttcn3_makefilegen .B ttcn3_makefilegen
.RB "[\| " \-acdEfgilMnpRsSw " \|]" .RB "[\| " \-acdEfgiklMnpRsSw " \|]"
.RB "[\| " \-e .RB "[\| " \-e
.IR " ETS_name" " \|]" .IR " ETS_name" " \|]"
.RB "[\| " \-o .RB "[\| " \-o
...@@ -86,6 +86,9 @@ during search. However if the tpdName attribute is missing then the value ...@@ -86,6 +86,9 @@ during search. However if the tpdName attribute is missing then the value
of the name attribute is taken with the .tpd suffix and used during the of the name attribute is taken with the .tpd suffix and used during the
search. search.
.TP .TP
.B \-k
Enables object-oriented features.
.TP
.BI \-o " dir|file" .BI \-o " dir|file"
Write the Makefile to the given directory or file. Write the Makefile to the given directory or file.
The current working directory is the default otherwise. The current working directory is the default otherwise.
......
...@@ -1270,7 +1270,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char* tpdName, c ...@@ -1270,7 +1270,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char* tpdName, c
boolean* p_dbflag, boolean* p_drflag, boolean* p_dtflag, boolean* p_dxflag, boolean* p_djflag, boolean* p_doerflag, boolean* p_dbflag, boolean* p_drflag, boolean* p_dtflag, boolean* p_dxflag, boolean* p_djflag, boolean* p_doerflag,
boolean* p_fxflag, boolean* p_doflag, boolean* p_gfflag, boolean* p_lnflag, boolean* p_isflag, boolean* p_fxflag, boolean* p_doflag, boolean* p_gfflag, boolean* p_lnflag, boolean* p_isflag,
boolean* p_asflag, boolean* p_swflag, boolean* p_Yflag, boolean* p_Mflag, boolean *p_Eflag, boolean* p_nflag, boolean* p_Nflag, boolean* p_asflag, boolean* p_swflag, boolean* p_Yflag, boolean* p_Mflag, boolean *p_Eflag, boolean* p_nflag, boolean* p_Nflag,
boolean* p_diflag, boolean* p_enable_legacy_encoding, boolean* p_disable_userinfo, boolean* p_realtime_features, boolean* p_diflag, boolean* p_enable_legacy_encoding, boolean* p_disable_userinfo, boolean* p_realtime_features, boolean* p_oop_features,
struct string_list* solspeclibs, struct string_list* sol8speclibs, struct string_list* solspeclibs, struct string_list* sol8speclibs,
struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs, char** ttcn3prep, struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs, char** ttcn3prep,
struct string_list* linkerlibs, struct string_list* additionalObjects, struct string_list* linkerlibsearchp, boolean Vflag, boolean Dflag, struct string_list* linkerlibs, struct string_list* additionalObjects, struct string_list* linkerlibsearchp, boolean Vflag, boolean Dflag,
...@@ -1292,7 +1292,7 @@ extern "C" tpd_result process_tpd(const char **p_tpd_name, const char *actcfg, ...@@ -1292,7 +1292,7 @@ extern "C" tpd_result process_tpd(const char **p_tpd_name, const char *actcfg,
boolean* p_dbflag, boolean* p_drflag, boolean* p_dtflag, boolean* p_dxflag, boolean* p_djflag, boolean* p_doerflag, boolean* p_dbflag, boolean* p_drflag, boolean* p_dtflag, boolean* p_dxflag, boolean* p_djflag, boolean* p_doerflag,
boolean* p_fxflag, boolean* p_doflag, boolean* p_gfflag, boolean* p_lnflag, boolean* p_isflag, boolean* p_fxflag, boolean* p_doflag, boolean* p_gfflag, boolean* p_lnflag, boolean* p_isflag,
boolean* p_asflag, boolean* p_swflag, boolean* p_Yflag, boolean* p_Mflag, boolean* p_Eflag, boolean* p_nflag, boolean* p_Nflag, boolean* p_asflag, boolean* p_swflag, boolean* p_Yflag, boolean* p_Mflag, boolean* p_Eflag, boolean* p_nflag, boolean* p_Nflag,
boolean* p_diflag, boolean* p_enable_legacy_encoding, boolean* p_disable_userinfo, boolean* p_realtime_features, boolean* p_diflag, boolean* p_enable_legacy_encoding, boolean* p_disable_userinfo, boolean* p_realtime_features, boolean* p_oop_features,
struct string_list* solspeclibs, struct string_list* sol8speclibs, struct string_list* solspeclibs, struct string_list* sol8speclibs,
struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs, char** ttcn3prep, struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs, char** ttcn3prep,
string_list* linkerlibs, string_list* additionalObjects, string_list* linkerlibsearchp, boolean Vflag, boolean Dflag, boolean *p_Zflag, string_list* linkerlibs, string_list* additionalObjects, string_list* linkerlibsearchp, boolean Vflag, boolean Dflag, boolean *p_Zflag,
...@@ -1325,7 +1325,7 @@ extern "C" tpd_result process_tpd(const char **p_tpd_name, const char *actcfg, ...@@ -1325,7 +1325,7 @@ extern "C" tpd_result process_tpd(const char **p_tpd_name, const char *actcfg,
p_fxflag, p_doflag, p_gfflag, p_lnflag, p_isflag, p_fxflag, p_doflag, p_gfflag, p_lnflag, p_isflag,
p_asflag, p_swflag, p_Yflag, p_Mflag, p_Eflag, p_nflag, p_Nflag, p_asflag, p_swflag, p_Yflag, p_Mflag, p_Eflag, p_nflag, p_Nflag,
p_diflag, p_enable_legacy_encoding, p_disable_userinfo, p_diflag, p_enable_legacy_encoding, p_disable_userinfo,
p_realtime_features, solspeclibs, sol8speclibs, p_realtime_features, p_oop_features, solspeclibs, sol8speclibs,
linuxspeclibs, freebsdspeclibs, win32speclibs, ttcn3prep, linuxspeclibs, freebsdspeclibs, win32speclibs, ttcn3prep,
linkerlibs, additionalObjects, linkerlibsearchp, Vflag, Dflag, p_Zflag, linkerlibs, additionalObjects, linkerlibsearchp, Vflag, Dflag, p_Zflag,
p_Hflag, generatorCommandOutput, target_placement_list, prefix_workdir, p_Hflag, generatorCommandOutput, target_placement_list, prefix_workdir,
...@@ -1356,7 +1356,7 @@ extern "C" tpd_result process_tpd(const char **p_tpd_name, const char *actcfg, ...@@ -1356,7 +1356,7 @@ extern "C" tpd_result process_tpd(const char **p_tpd_name, const char *actcfg,
p_fxflag, p_doflag, p_gfflag, p_lnflag, p_isflag, p_fxflag, p_doflag, p_gfflag, p_lnflag, p_isflag,
p_asflag, p_swflag, p_Yflag, p_Mflag, p_Eflag, p_nflag, p_Nflag, p_asflag, p_swflag, p_Yflag, p_Mflag, p_Eflag, p_nflag, p_Nflag,
p_diflag, p_enable_legacy_encoding, p_disable_userinfo, p_diflag, p_enable_legacy_encoding, p_disable_userinfo,
p_realtime_features, solspeclibs, sol8speclibs, p_realtime_features, p_oop_features, solspeclibs, sol8speclibs,
linuxspeclibs, freebsdspeclibs, win32speclibs, ttcn3prep, linuxspeclibs, freebsdspeclibs, win32speclibs, ttcn3prep,
linkerlibs, additionalObjects, linkerlibsearchp, Vflag, Dflag, p_Zflag, linkerlibs, additionalObjects, linkerlibsearchp, Vflag, Dflag, p_Zflag,
p_Hflag, generatorCommandOutput, target_placement_list, prefix_workdir, p_Hflag, generatorCommandOutput, target_placement_list, prefix_workdir,
...@@ -1462,7 +1462,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c ...@@ -1462,7 +1462,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c
boolean* p_dbflag, boolean* p_drflag, boolean* p_dtflag, boolean* p_dxflag, boolean* p_djflag, boolean* p_doerflag, boolean* p_dbflag, boolean* p_drflag, boolean* p_dtflag, boolean* p_dxflag, boolean* p_djflag, boolean* p_doerflag,
boolean* p_fxflag, boolean* p_doflag, boolean* p_gfflag, boolean* p_lnflag, boolean* p_isflag, boolean* p_fxflag, boolean* p_doflag, boolean* p_gfflag, boolean* p_lnflag, boolean* p_isflag,
boolean* p_asflag, boolean* p_swflag, boolean* p_Yflag, boolean* p_Mflag, boolean* p_Eflag, boolean* p_nflag, boolean* p_Nflag, boolean* p_asflag, boolean* p_swflag, boolean* p_Yflag, boolean* p_Mflag, boolean* p_Eflag, boolean* p_nflag, boolean* p_Nflag,
boolean* p_diflag, boolean* p_enable_legacy_encoding, boolean* p_disable_userinfo, boolean* p_realtime_features, boolean* p_diflag, boolean* p_enable_legacy_encoding, boolean* p_disable_userinfo, boolean* p_realtime_features, boolean* p_oop_features,
struct string_list* solspeclibs, struct string_list* sol8speclibs, struct string_list* solspeclibs, struct string_list* sol8speclibs,
struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs, char** ttcn3prep, struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs, char** ttcn3prep,
string_list* linkerlibs, string_list* additionalObjects, string_list* linkerlibsearchp, boolean Vflag, boolean Dflag, boolean *p_Zflag, string_list* linkerlibs, string_list* additionalObjects, string_list* linkerlibsearchp, boolean Vflag, boolean Dflag, boolean *p_Zflag,
...@@ -2074,6 +2074,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c ...@@ -2074,6 +2074,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c
xsdbool2boolean(xpathCtx, actcfg, "enableLegacyEncoding", p_enable_legacy_encoding); xsdbool2boolean(xpathCtx, actcfg, "enableLegacyEncoding", p_enable_legacy_encoding);
xsdbool2boolean(xpathCtx, actcfg, "disableUserInformation", p_disable_userinfo); xsdbool2boolean(xpathCtx, actcfg, "disableUserInformation", p_disable_userinfo);
xsdbool2boolean(xpathCtx, actcfg, "enableRealtimeTesting", p_realtime_features); xsdbool2boolean(xpathCtx, actcfg, "enableRealtimeTesting", p_realtime_features);
xsdbool2boolean(xpathCtx, actcfg, "enableOOP", p_oop_features);
projDesc = projGenHelper.getTargetOfProject(*p_project_name); projDesc = projGenHelper.getTargetOfProject(*p_project_name);
if (projDesc) projDesc->setLinkingStrategy(*p_lflag); if (projDesc) projDesc->setLinkingStrategy(*p_lflag);
...@@ -2981,6 +2982,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c ...@@ -2981,6 +2982,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c
my_duflag = 0; my_duflag = 0;
boolean my_enable_legacy_encoding = 0; boolean my_enable_legacy_encoding = 0;
boolean my_realtime_features = 0; boolean my_realtime_features = 0;
boolean my_oop_features = 0;
char *my_ets = NULL; char *my_ets = NULL;
char *my_proj_name = NULL; char *my_proj_name = NULL;
...@@ -3033,7 +3035,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c ...@@ -3033,7 +3035,7 @@ static tpd_result process_tpd_internal(const char **p_tpd_name, char *tpdName, c
&my_quflag, &my_dsflag, cxxcompiler, optlevel, optflags, linkerOptions, semantic_check_only, disable_attibute_validation, &my_quflag, &my_dsflag, cxxcompiler, optlevel, optflags, linkerOptions, semantic_check_only, disable_attibute_validation,
&my_dbflag, &my_drflag, &my_dtflag, &my_dxflag, &my_djflag, &my_doerflag, &my_fxflag, &my_doflag, &my_dbflag, &my_drflag, &my_dtflag, &my_dxflag, &my_djflag, &my_doerflag, &my_fxflag, &my_doflag,
&my_gfflag, &my_lnflag, &my_isflag, &my_asflag, &my_swflag, &my_Yflag, &my_Mflag, &my_Eflag, &my_nflag, &my_Nflag, &my_diflag, &my_gfflag, &my_lnflag, &my_isflag, &my_asflag, &my_swflag, &my_Yflag, &my_Mflag, &my_Eflag, &my_nflag, &my_Nflag, &my_diflag,
&my_enable_legacy_encoding, &my_duflag, &my_realtime_features, solspeclibs, sol8speclibs, linuxspeclibs, freebsdspeclibs, win32speclibs, &my_enable_legacy_encoding, &my_duflag, &my_realtime_features, &my_oop_features, solspeclibs, sol8speclibs, linuxspeclibs, freebsdspeclibs, win32speclibs,
ttcn3prep, linkerlibs, additionalObjects, linkerlibsearchp, Vflag, FALSE, &my_Zflag, ttcn3prep, linkerlibs, additionalObjects, linkerlibsearchp, Vflag, FALSE, &my_Zflag,
&my_Hflag, NULL, NULL, prefix_workdir, run_command_list, seen_tpd_files, required_configs, profiled_file_list, &my_Hflag, NULL, NULL, prefix_workdir, run_command_list, seen_tpd_files, required_configs, profiled_file_list,
search_paths, n_search_paths, makefileScript, all_configs); search_paths, n_search_paths, makefileScript, all_configs);
......
...@@ -289,7 +289,7 @@ tpd_result process_tpd(const char **p_tpd_name, const char *actcfg, ...@@ -289,7 +289,7 @@ tpd_result process_tpd(const char **p_tpd_name, const char *actcfg,
boolean *forcexerinasn, boolean *defaultasomit, boolean *gccmessageformat, boolean *forcexerinasn, boolean *defaultasomit, boolean *gccmessageformat,
boolean *linenumber, boolean *includesourceinfo, boolean *addsourcelineinfo, boolean *suppresswarnings, boolean *linenumber, boolean *includesourceinfo, boolean *addsourcelineinfo, boolean *suppresswarnings,
boolean *outparamboundness, boolean *omit_in_value_list, boolean *warnings_for_bad_variants, boolean *activate_debugger, boolean* ignore_untagged_union, boolean *outparamboundness, boolean *omit_in_value_list, boolean *warnings_for_bad_variants, boolean *activate_debugger, boolean* ignore_untagged_union,
boolean *disable_predef_exp_folder, boolean* enable_legacy_encoding, boolean* disable_userinfo, boolean* realtime_features, boolean *disable_predef_exp_folder, boolean* enable_legacy_encoding, boolean* disable_userinfo, boolean* realtime_features, boolean* oop_features,
struct string_list* solspeclibs, struct string_list* sol8speclibs, struct string_list* solspeclibs, struct string_list* sol8speclibs,
struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs, struct string_list* linuxspeclibs, struct string_list* freebsdspeclibs, struct string_list* win32speclibs,
char** ttcn3preprocessor, struct string_list* linkerlibs, struct string_list* additionalObjects, struct string_list* linkerlibsearchpath, boolean Vflag, boolean Dflag, char** ttcn3preprocessor, struct string_list* linkerlibs, struct string_list* additionalObjects, struct string_list* linkerlibsearchpath, boolean Vflag, boolean Dflag,
......
...@@ -398,7 +398,7 @@ type class C37 { ...@@ -398,7 +398,7 @@ type class C37 {
create() {} create() {}
} }
function f_left_hand_side() { //^In function definition// function f_global_left_hand_side() { //^In function definition//
var C37 x := C37.create; var C37 x := C37.create;
x.c := 2; //^In variable assignment// //Reference to a variable or template variable was expected instead of constant `@oop_SE.C37.c'// x.c := 2; //^In variable assignment// //Reference to a variable or template variable was expected instead of constant `@oop_SE.C37.c'//
x.t := *; //^In variable assignment// //Reference to a variable or template variable was expected instead of template `@oop_SE.C37.t'// x.t := *; //^In variable assignment// //Reference to a variable or template variable was expected instead of template `@oop_SE.C37.t'//
...@@ -407,18 +407,59 @@ function f_left_hand_side() { //^In function definition// ...@@ -407,18 +407,59 @@ function f_left_hand_side() { //^In function definition//
x.f2() := "x"; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C37.f2'// x.f2() := "x"; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C37.f2'//
} }
type class C38 extends C37 { //^In type definition//
public function f1() return Rec { return { 3, "b" }; }
public function f2() return template charstring { return omit; }
function f_class_left_hand_side() { //^In function definition//
this := null; //^In variable assignment// //Reference to a variable or template variable was expected instead of type `@oop_SE.C38'//
this.c := 4; //^In variable assignment// //Reference to a variable or template variable was expected instead of constant `@oop_SE.C37.c'//
this.t := ?; //^In variable assignment// //Reference to a variable or template variable was expected instead of template `@oop_SE.C37.t'//
this.f1().str := "x"; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C38.f1'//
this.f2() := ?; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C38.f2//
super.f1().str := "x"; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C38.f1'//
super.f2() := ?; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C38.f2//