diff options
author | Björn Gustavsson <[email protected]> | 2017-01-18 15:33:56 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-02-03 13:34:23 +0100 |
commit | ce431409d0daba5630e36173dcb751f0ab65e5bb (patch) | |
tree | bd5003cc65432db7752ac80d23cc1c9c540e36fe /lib/asn1/src/asn1_records.hrl | |
parent | 5fa478d4550d8a55b3c89f8f6a7deef5b6fd9b0e (diff) | |
download | otp-ce431409d0daba5630e36173dcb751f0ab65e5bb.tar.gz otp-ce431409d0daba5630e36173dcb751f0ab65e5bb.tar.bz2 otp-ce431409d0daba5630e36173dcb751f0ab65e5bb.zip |
Refactor code generation options
Most options to the code generation pass are passed through the
process dictionary. At the same time, an Erule or Erules argument
is passed to most code generation functions. The Erule argument
is only an atom indicating the encoding rules ('ber', 'per', or
'uper').
Introduce a new record #gen{} to contain code generation options
and parameters. Pass it as the Erule argument (renaming it to Gen
in functions that we will have to touch anyway). In this commit,
eliminate the use of the variable 'encoding_options' in the process
dictionary.
Diffstat (limited to 'lib/asn1/src/asn1_records.hrl')
-rw-r--r-- | lib/asn1/src/asn1_records.hrl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/asn1/src/asn1_records.hrl b/lib/asn1/src/asn1_records.hrl index af10c1771c..4b800f17c7 100644 --- a/lib/asn1/src/asn1_records.hrl +++ b/lib/asn1/src/asn1_records.hrl @@ -96,6 +96,16 @@ error_context %Top-level thingie (contains line numbers) }). +%% Code generation parameters and options. +-record(gen, + {erule=ber :: 'ber' | 'per', + der=false :: boolean(), + aligned=false :: boolean(), + rec_prefix="" :: string(), + macro_prefix="" :: string(), + options=[] :: [any()] + }). + %% state record used by back-end at partial decode %% active is set to 'yes' when a partial decode function is generated. %% prefix is set to 'dec-inc-' or 'dec-partial-' is for |