-
Notifications
You must be signed in to change notification settings - Fork 15
/
json_parser.pks
57 lines (45 loc) · 1.26 KB
/
json_parser.pks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
CREATE OR REPLACE
PACKAGE json_parser IS
------------
-- OVERVIEW
--
-- ...
--
--
-----------
-- EXAMPLE
--
--
-------------
-- RESOURCES
--
--
----------------------------------------------------------
-- GLOBAL PUBLIC TYPES
----------------------------------------------------------
-- scanner tokens: '{', '}', ',', ':', '[', ']', STRING, NUMBER, TRUE, FALSE, NULL
TYPE rToken IS RECORD
(
type_name VARCHAR2(7),
line PLS_INTEGER,
col PLS_INTEGER,
data VARCHAR2(32767),
data_overflow clob
);
TYPE lTokens IS TABLE OF rToken INDEX BY PLS_INTEGER;
TYPE json_src IS RECORD (len NUMBER, offset NUMBER, src VARCHAR2(32767), s_clob CLOB);
----------------------------------------------------------
-- GLOBAL PUBLIC CONSTANTS
----------------------------------------------------------
---------------------------------------------------------
-- GLOBAL VARIABLES
----------------------------------------------------------
json_strict BOOLEAN NOT NULL := FALSE;
----------------------------------------------------------
-- GLOBAL PUBLIC MODULES
----------------------------------------------------------
FUNCTION parser(str CLOB) RETURN jsonNodes;
FUNCTION parse_list(str CLOB) RETURN jsonNodes;
FUNCTION parse_any(str CLOB) RETURN jsonNodes;
END json_parser;
/