e warnings FATAL => 'all';
package MarpaX::ESLIF::JSON;
use MarpaX::ESLIF::JSON::Encoder;
use MarpaX::ESLIF::JSON::Decoder;
# ABSTRACT: ESLIF's JSON interface
our $AUTHORITY = 'cpan:JDDPAUSE'; # AU
w {
my $class = shift;
return bless { encoder => MarpaX::ESLIF::JSON::Encoder->new(@_), decoder => MarpaX::ESLIF::JSON::Decoder->new(@_) }, $class
}
sub encode {
my ($self, $value) = @_
::JSON - ESLIF's JSON interface
=head1 VERSION
version 6.0.35.1
=head1 DESCRIPTION
This is JSON's strict and relax encoder/decoder writen directly in L<MarpaX::ESLIF> library.
There are two JSON
SLIF::JSON::Decoder;
use parent qw/MarpaX::ESLIF::Grammar/;
use MarpaX::ESLIF::JSON::Decoder::RecognizerInterface;
#
# Base required class methods
#
sub _ALLOCATE { return \&MarpaX::ESLIF::JSON::Deco
($definedStrict && $_definedStrict && ($strict == $args_ref->[1]))
}
}
# ABSTRACT: ESLIF's JSON decoder interface
our $AUTHORITY = 'cpan:JDDPAUSE'; # AUTHORITY
our $VERSION = '6.0.35.1'; # VE
ub decode {
my ($self, $string, %options) = @_;
my $recognizerInterface = MarpaX::ESLIF::JSON::Decoder::RecognizerInterface->new($string, $options{encoding});
return $self->_decode($recog
t;
use warnings FATAL => 'all';
package MarpaX::ESLIF::JSON::Decoder::RecognizerInterface;
use Carp qw/croak/;
# ABSTRACT: MarpaX::ESLIF::JSON Recognizer Interface
our $VERSION = '6.0.35.1'; # VERS
NAME
MarpaX::ESLIF::JSON::Decoder::RecognizerInterface - MarpaX::ESLIF::JSON Recognizer Interface
=head1 VERSION
version 6.0.35.1
=head1 SYNOPSIS
use MarpaX::ESLIF::JSON::Decoder::Recognizer
Interface;
my $recognizerInterface = MarpaX::ESLIF::JSON::Decoder::RecognizerInterface->new();
=head1 DESCRIPTION
MarpaX::ESLIF::JSON's Decoder Recognizer Interface
=head1 SUBROUTINES/METHODS
=> 'all';
package MarpaX::ESLIF::JSON::Encoder;
use parent qw/MarpaX::ESLIF::Grammar/;
#
# Base required class methods
#
sub _ALLOCATE { return \&MarpaX::ESLIF::JSON::Encoder::allocate }
sub _EQ {
T: ESLIF's JSON encoder interface
our $AUTHORITY = 'cpan:JDDPAUSE'; # AUTHORITY
our $VERSION = '6.0.35.1'; # VERSION
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MarpaX::ESLIF::JSON::Encoder
PTION
This is JSON's strict and relax encoder writen directly in L<MarpaX::ESLIF> library.
There are two JSON modes:
=over
=item Strict
Encoder is strict, as per L<ECMA-404 The JSON Data Intercha
fore the XS loader
#
our $true;
our $false;
BEGIN {
use JSON::MaybeXS 1.004000 qw//;
$true = JSON::MaybeXS::true();
$false = JSON::MaybeXS::false();
}
#
# Bootstrap
#
BEGIN {
#
ou
IF::Grammar::Rule::Properties;
use MarpaX::ESLIF::Grammar::Symbol::Properties;
use MarpaX::ESLIF::JSON;
use MarpaX::ESLIF::Logger::Level;
use MarpaX::ESLIF::Recognizer;
use MarpaX::ESLIF::Symbol;
use
Type;
use MarpaX::ESLIF::Rule::PropertyBitSet;
sub getInstance {
goto &new
}
*is_bool = \&JSON::MaybeXS::is_bool;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MarpaX::ESLIF - ESLIF is Ex
arp;
MarpaX_ESLIF_constants_t *constantsp;
} MarpaX_ESLIF_Grammar_t, MarpaX_ESLIF_JSON_Encoder_t, MarpaX_ESLIF_JSON_Decoder_t;
/* Symbol type */
typedef struct MarpaX_ESLIF_Symbol {
SV
ESLIF_constants_t *constantsp);
PERL_STATIC_INLINE short marpaESLIFPerl_JSONDecodePositiveInfinityAction(void *userDatavp, char *strings, size_t stringl, marpaESLIFValueResul
lueResultp, short confidenceb);
PERL_STATIC_INLINE short marpaESLIFPerl_JSONDecodeNegativeInfinityAction(void *userDatavp, char *strings, size_t stringl, marpaESLIFValueResul
mpact on how ESLIF will represent *inputcp depending on serialization context */
/* (e.g. the :json action). */
/* The default v
mbol is verbose */
} marpaESLIFSymbolProperty_t;
/* Whenever marpaESLIF fails to parse exactly a JSON number it will call the proposal callback if defined. */
/* It will always propose either UNDEF o
rt (*marpaESLIFJSONProposalAction_t)(void *userDatavp, char *strings, size_t stringl, marpaESLIFValueResult_t *marpaESLIFValueResultp, short confidenceb);
typedef struct marpaESLIFJSONDecodeOption {
or both rule and symbol actions.
=item C<::json>
Creates a value of type STRING in the UTF-8 encoding, containing a strict JSON string as per original JSON specification, i.e. it is using UTF-16 sur
l for both rule and symbol actions.
=item C<::jsonf>
Creates a value of type STRING in the UTF-8 encoding, containing a JSON string as per original JSON specification plus infinity and nan extension
| '::false'
| '::json'
| '::jsonf'
| '::row'
'::false' */
#define G1_ACTION_ACTION_NAME_11 "::ascii" /* <action name> ::= '::json' */
#define G1_ACTION_ACTION_NAME_12 "::ascii" /* <action name> ::= '::row' */
"::ascii" /* <symbol action name> ::= '::json' */
#define G1_ACTION_SYMBOLACTION_NAME_11 "::ascii" /* <symbol action name> ::= '::jsonf' */
#define G1_ACTION_SYMBOLACTION_NAME_12
#ifndef MARPAESLIF_INTERNAL_JSON_H
#define MARPAESLIF_INTERNAL_JSON_H
static const char *jsonStringRegexsp[_MARPAESLIF_JSON_TYPE_LAST] = {
/* Strict */
"\"(?C50)(?:((?:[^\"\\\\\\x00-\\x1F]+)|(?:\
ic const char *jsonStringRegexModifiersp[_MARPAESLIF_JSON_TYPE_LAST] = {
/* Strict */
"u",
/* Extended */
"u"
};
static const char *jsonConstantOrNumberRegexsp[_MARPAESLIF_JSON_TYPE_LAST] =
6)|(?:-?NaN)(?C67)"
};
static const char *jsonConstantOrNumberRegexModifiersp[_MARPAESLIF_JSON_TYPE_LAST] = {
/* Strict */
"",
/* Extended */
"i"
};
#endif /* MARPAESLIF_INTERNAL_JSON_H */
F_lua_functiondecl marpaESLIF_lua_functiondecl_t;
typedef enum marpaESLIF_json_type marpaESLIF_json_type_t;
typedef struct marpaESLIF_pcre2_callout_context marpaESLIF_pcre2_callou
MARPAESLIF_INTERNAL_RULE_ACTION___FALSE,
MARPAESLIF_INTERNAL_RULE_ACTION___JSON,
MARPAESLIF_INTERNAL_RULE_ACTION___JSONF,
MARPAESLIF_INTERNAL_RULE_ACTION___ROW,
MARPAESLIF_INTERNAL_RULE_ACTION
ESLIF_INTERNAL_SYMBOL_ACTION___FALSE,
MARPAESLIF_INTERNAL_SYMBOL_ACTION___JSON,
MARPAESLIF_INTERNAL_SYMBOL_ACTION___JSONF
} marpaESLIF_internal_symbol_action_t;
/* Symbol types */
enum marpaESLIF
tem Embedded lua language into the grammar
=item Bindings to java, lua and perl languages
=item JSON (strict and extended) grammars for decoding/encoding
=item Declarative lua action directly into
he method C<MarpaX::ESLIF::is_bool> is used to determine the boolean nature. Default is to call C<JSON::MaybeXS::is_bool>.
=item [2]
If input is a IV only scalar, storage is decided when comparing t
fault implementations of C<$MarpaX::ESLIF::true> and C<$MarpaX::ESLIF::false> are C<JSON::MaybeXS::true()> and C<JSON::MaybeXS::false()>, respectively.
=item [6]
If the encoding is "UTF-8", returns
1_TERMINAL_ANY_CHARACTER,
G1_TERMINAL___TRUE,
G1_TERMINAL___FALSE,
G1_TERMINAL___JSON,
G1_TERMINAL___JSONF,
G1_TERMINAL___ROW,
G1_TERMINAL___TABLE,
G1_TERMINAL_IF_ACTION,
G1_TERMINAL_R
TERMINAL___JSON, MARPAESLIF_TERMINAL_TYPE_STRING, 0, NULL,
"'::json'", NULL, NULL,
#ifndef MARPAESLIF_NTRACE
"::json", "::jso"
#else
NULL, NULL
#endif
},
{ G1_TERMINAL___JSONF, MARPAES
LIF_TERMINAL_TYPE_STRING, 0, NULL,
"'::jsonf'", NULL, NULL,
#ifndef MARPAESLIF_NTRACE
"::jsonf", "::json"
#else
NULL, NULL
#endif
},
{ G1_TERMINAL___ROW, MARPAESLIF_TERMINAL_TYPE_STRIN