diff --git a/compiler2/Type_chk.cc b/compiler2/Type_chk.cc index 53a91a01cd8d8094723f59ac837aa3948d538ed9..2fedc25a56738c594e9cad6e51f9a802c9a60599 100644 --- a/compiler2/Type_chk.cc +++ b/compiler2/Type_chk.cc @@ -3013,6 +3013,7 @@ void Type::chk_xer() { // XERSTUFF semantic check } void Type::chk_oer() { + if (!enable_oer()) return; if (oerattrib == NULL) { oerattrib = new OerAST(); } diff --git a/compiler2/main.cc b/compiler2/main.cc index 523d2ee89cafd5c68cd414dd1f9574b3b31dfffe..068ac83d90d3b1923b8c983e9b3c8bc029185628 100644 --- a/compiler2/main.cc +++ b/compiler2/main.cc @@ -151,7 +151,8 @@ Modules *modules = NULL; // Features can be disabled in the license or by commandline switches static bool raw_disabled = false, ber_disabled = false, per_disabled = false, - text_disabled = false, xer_disabled = false, json_disabled = false; + text_disabled = false, xer_disabled = false, json_disabled = false, + oer_disabled = false; static bool attribute_validation_disabled = FALSE; #ifdef LICENSE static bool has_raw_feature = false, has_ber_feature = false, @@ -235,8 +236,7 @@ boolean enable_json() boolean enable_oer() { - // TODO: temp while no new compiler flag - return TRUE; + return !oer_disabled; } boolean disable_attribute_validation() @@ -422,6 +422,7 @@ static void usage() " -n: activate debugger (generates extra code for debugging)\n" " -N: ignore UNTAGGED encoding instruction on top level unions (legacy behaviour)\n" " -o dir: output files will be placed into dir\n" + " -O: disable OER encoder/decoder functions\n" " -p: parse only (no semantic check or code generation)\n" " -P pduname: define top-level pdu\n" " -q: suppress all messages (quiet mode)\n" @@ -499,7 +500,7 @@ int main(int argc, char *argv[]) Sflag = false, Kflag = false, jflag = false, zflag = false, Fflag = false, Mflag = false, Eflag = false, nflag = false, Bflag = false, errflag = false, print_usage = false, ttcn2json = false, Nflag = false, Dflag = false, - eflag = false; + eflag = false, Oflag = false; CodeGenHelper cgh; @@ -595,7 +596,7 @@ int main(int argc, char *argv[]) if (!ttcn2json) { for ( ; ; ) { - int c = getopt(argc, argv, "aA:bBcC:dDeEfFgijJ:K:lLMnNo:pP:qQ:rRsStT:uU:vV:wxXyYz:0-"); + int c = getopt(argc, argv, "aA:bBcC:dDeEfFgijJ:K:lLMnNo:OpP:qQ:rRsStT:uU:vV:wxXyYz:0-"); if (c == -1) break; switch (c) { case 'a': @@ -684,6 +685,10 @@ int main(int argc, char *argv[]) SET_FLAG(o); output_dir = optarg; break; + case 'O': + SET_FLAG(O); + oer_disabled = TRUE; + break; case 'Y': SET_FLAG(Y); enable_set_bound_out_param = TRUE; @@ -834,7 +839,7 @@ int main(int argc, char *argv[]) bflag || fflag || iflag || lflag || oflag || pflag || qflag || rflag || sflag || tflag || uflag || wflag || xflag || Xflag || Rflag || Uflag || yflag || Kflag || jflag || zflag || Fflag || Mflag || Eflag || - nflag || Bflag || Dflag || eflag) { + nflag || Bflag || Dflag || eflag || Oflag) { errflag = true; print_usage = true; } diff --git a/usrguide/referenceguide.doc b/usrguide/referenceguide.doc index 7b2dd2e5409004847081863e214b20fd909d28fb..7b9f2a9a019e97a2f39259d78642fed85c06b336 100644 Binary files a/usrguide/referenceguide.doc and b/usrguide/referenceguide.doc differ