MarpaX::ESLIF::JSON::Decoder - ESLIF's JSON decoder interface
version 6.0.12
This is JSON's strict and relax decoder writen directly in MarpaX::ESLIF library.
There are two JSON modes:
Encoder and decoder are strict, as per ECMA-404 The JSON Data Interchange Standard.
This is strict grammar extended with:
[\x00-\x1F]
my $eslifJSONDecoder = MarpaX::ESLIF::JSON::Decoder->new($eslif);
Returns a JSON grammar instance, noted $eslifJSONDecoder later. Parameters are:
$eslifJSONDecoder
$eslif
MarpaX::ESLIF object instance. Required.
$strict
A true value means strict JSON, else relax JSON. Default is a true value.
my $value = $eslifJSONDecoder->decode($string);
Returns a value containing decoded $string. In relax mode, special floating point are supported:
$string
+Infinity
Positive infinity, either as a native floating point number if the underlying system supports that, or as a Math::BigInt-binf()> instance.
Math::BigInt-
-Infinity
Negative infinity, either as a native floating point number if the underlying system supports that, or as a Math::BigInt-binf('-')> instance.
NaN
Not-a-Number, either as a native floating point number if the underlying system supports that, or as a Math::BigInt-bnan()> instance.
Supported options are:
Input encoding. Can be undef.
undef
A true value will disallow duplicate keys. Default is a false value.
Maximum depth. Default is 0, meaning no limit.
A true value will disallow UTF-8 replacement character for invalid UTF-16 surrogates. Default is a false value.
Formally, the JSON implementation is only a grammar coded directly in the ESLIF library, therefore this module inherits from MarpaX::ESLIF::Grammar.
Jean-Damien Durand <jeandamiendurand@free.fr>
This software is copyright (c) 2017 by Jean-Damien Durand.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install MarpaX::ESLIF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MarpaX::ESLIF
CPAN shell
perl -MCPAN -e shell install MarpaX::ESLIF
For more information on module installation, please visit the detailed CPAN module installation guide.