313 lines
9.0 KiB
Plaintext
313 lines
9.0 KiB
Plaintext
[/
|
|
(C) Copyright Edward Diener 2011-2015
|
|
Distributed under the Boost Software License, Version 1.0.
|
|
(See accompanying file LICENSE_1_0.txt or copy at
|
|
http://www.boost.org/LICENSE_1_0.txt).
|
|
]
|
|
|
|
[section:vmd_conv Version 1.7 to 1.8 conversion]
|
|
|
|
Since the current version of VMD has been drastically changed
|
|
to make it easier to use VMD functionality this section
|
|
details equivalent functionality for previous version 1.7
|
|
VMD macros.
|
|
|
|
The changes in functionality involve the parsing of sequences.
|
|
The equivalent to all the V1.7 functionality, which looks for
|
|
various data types at the beginning of a sequence, is encompassed
|
|
by the V1.8 macro BOOST_VMD_ELEM(0,sequence,...), where '0' is the first
|
|
sequence element and 'sequence' is the sequence, with its optional
|
|
parameters.
|
|
|
|
[heading Identifier]
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_IDENTIFIER(sequence,keys,...) looked for an identifier at
|
|
the beginning of a sequence and returned a 2-element tuple, where the first
|
|
element is the matching index starting with 1, or 0 if no identifier is found,
|
|
and the second tuple element is the rest of the sequence or emptiness if no
|
|
identifier is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_AFTER,BOOST_VMD_RETURN_INDEX)
|
|
returns a 3-element tuple where the identifier found is the first tuple element,
|
|
the rest of the sequence is the second tuple element, and the matching index, starting with
|
|
0, is the 3rd tuple element. If no identifier is found all elements of the returned tuple are empty.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_BEGIN_IDENTIFIER(sequence,keys,...) looked for an identifier at
|
|
the beginning of a sequence and returned the matching index starting with 1, or
|
|
0 if no identifier is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_INDEX)
|
|
returns a 2-element tuple where the identifier found is the first tuple element
|
|
and the matching index, starting with 0, is the 2nd tuple element. If no identifier
|
|
is found both elements of the returned tuple are empty.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_AFTER_IDENTIFIER(sequence,keys,...) looked for an identifier at the
|
|
beginning of a sequence and returned the rest of the sequence or emptiness if
|
|
no identifier is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER,BOOST_VMD_RETURN_ONLY_AFTER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_IS_BEGIN_IDENTIFIER(sequence,keys,...) returns 1 if input
|
|
begins with an identifier, else 0 if it does not.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,(identifiers),BOOST_VMD_TYPE_IDENTIFIER) returns the identifier found,
|
|
otherwise emptiness if not found. You can use
|
|
BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,identifiers,BOOST_VMD_TYPE_IDENTIFIER)))
|
|
as the exact equivalent.
|
|
|
|
[heading Number]
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_NUMBER(sequence,...) looked for a number at
|
|
the beginning of a sequence and returned a 2-element tuple, where the first
|
|
element is the number and the second tuple element is the rest of the sequence.
|
|
If no number is found both tuple elements are empty.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_AFTER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_BEGIN_NUMBER(sequence,...) looked for a number at
|
|
the beginning of a sequence and returned the number if found or emptiness
|
|
if no number is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_AFTER_NUMBER(sequence,...) looked for a number at the
|
|
beginning of a sequence and returned the rest of the sequence or emptiness if
|
|
no number is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER,BOOST_VMD_RETURN_ONLY_AFTER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_IS_BEGIN_NUMBER(sequence,...) returns 1 if input
|
|
begins with a number, else 0 if it does not.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER) returns the number found,
|
|
otherwise emptiness if not found. You can use
|
|
BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_NUMBER)))
|
|
as the exact equivalent.
|
|
|
|
[heading Array]
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_ARRAY(sequence) looked for an array at
|
|
the beginning of a sequence and returned a 2-element tuple, where the first
|
|
element is the array and the second tuple element is the rest of the sequence.
|
|
If no array is found both tuple elements are empty.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_AFTER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_BEGIN_ARRAY(sequence) looked for an array at
|
|
the beginning of a sequence and returned the array if found or emptiness
|
|
if no array is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_AFTER_ARRAY(sequence) looked for an array at the
|
|
beginning of a sequence and returned the rest of the sequence or emptiness if
|
|
no array is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY,BOOST_VMD_RETURN_ONLY_AFTER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_IS_BEGIN_ARRAY(sequence,...) returns 1 if input
|
|
begins with an array, else 0 if it does not.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY) returns the array found,
|
|
otherwise emptiness if not found. You can use
|
|
BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_ARRAY)))
|
|
as the exact equivalent.
|
|
|
|
[heading List]
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_LIST(sequence) looked for an list at
|
|
the beginning of a sequence and returned a 2-element tuple, where the first
|
|
element is the list and the second tuple element is the rest of the sequence.
|
|
If no list is found both tuple elements are empty.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_AFTER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_BEGIN_LIST(sequence) looked for a list at
|
|
the beginning of a sequence and returned the list if found or emptiness
|
|
if no list is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_AFTER_LIST(sequence) looked for an list at the
|
|
beginning of a sequence and returned the rest of the sequence or emptiness if
|
|
no list is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST,BOOST_VMD_RETURN_ONLY_AFTER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_IS_BEGIN_LIST(sequence,...) returns 1 if input
|
|
begins with an list, else 0 if it does not.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST) returns the list found,
|
|
otherwise emptiness if not found. You can use
|
|
BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_LIST)))
|
|
as the exact equivalent.
|
|
|
|
[heading Seq]
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_SEQ(sequence) looked for a seq at
|
|
the beginning of a sequence and returned a 2-element tuple, where the first
|
|
element is the seq and the second tuple element is the rest of the sequence.
|
|
If no seq is found both tuple elements are empty.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_AFTER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_BEGIN_SEQ(sequence) looked for a seq at
|
|
the beginning of a sequence and returned the seq if found or emptiness
|
|
if no seq is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_AFTER_SEQ(sequence) looked for an seq at the
|
|
beginning of a sequence and returned the rest of the sequence or emptiness if
|
|
no seq is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ,BOOST_VMD_RETURN_ONLY_AFTER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_IS_BEGIN_SEQ(sequence,...) returns 1 if input
|
|
begins with an seq, else 0 if it does not.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ) returns the seq found,
|
|
otherwise emptiness if not found. You can use
|
|
BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_SEQ)))
|
|
as the exact equivalent.
|
|
|
|
[heading Tuple]
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_TUPLE(sequence) looked for an tuple at
|
|
the beginning of a sequence and returned a 2-element tuple, where the first
|
|
element is the tuple and the second tuple element is the rest of the sequence.
|
|
If no tuple is found both tuple elements are empty.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_AFTER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_BEGIN_TUPLE(sequence) looked for a tuple at
|
|
the beginning of a sequence and returned the tuple if found or emptiness
|
|
if no tuple is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_AFTER_TUPLE(sequence) looked for an tuple at the
|
|
beginning of a sequence and returned the rest of the sequence or emptiness if
|
|
no tuple is found.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE,BOOST_VMD_RETURN_ONLY_AFTER)
|
|
is the exact equivalent.
|
|
|
|
V1.7
|
|
|
|
BOOST_VMD_IS_BEGIN_TUPLE(sequence,...) returns 1 if input
|
|
begins with an tuple, else 0 if it does not.
|
|
|
|
V1.8 equivalent
|
|
|
|
BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE) returns the tuple found,
|
|
otherwise emptiness if not found. You can use
|
|
BOOST_PP_COMPL(BOOST_VMD_IS_EMPTY(BOOST_VMD_ELEM(0,sequence,BOOST_VMD_TYPE_TUPLE)))
|
|
as the exact equivalent.
|
|
|
|
[endsect]
|