PageRenderTime 35ms CodeModel.GetById 32ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/library/kernel/scanner/json_tokens.e

http://github.com/Eiffel-World/ejson-ise-svn
Specman e | 77 lines | 50 code | 14 blank | 13 comment | 0 complexity | 6283416b9ff6c91387b110b9909487a2 MD5 | raw file
 1note
 2	description: ""
 3	author: "jvelilla"
 4	date: "2008/08/24"
 5	revision: "0.1"
 6
 7class
 8	JSON_TOKENS
 9
10feature -- Access
11
12	j_OBJECT_OPEN: CHARACTER = '{'
13	j_ARRAY_OPEN: CHARACTER = '['
14	j_OBJECT_CLOSE: CHARACTER = '}'
15	j_ARRAY_CLOSE: CHARACTER = ']'
16
17	j_STRING: CHARACTER = '"'
18	j_PLUS: CHARACTER = '+'
19	j_MINUS: CHARACTER = '-'
20	j_DOT: CHARACTER = '.'
21
22feature -- Status report
23
24	is_open_token (c: CHARACTER): BOOLEAN
25			-- Characters which open a type	
26		do
27			inspect c
28			when j_OBJECT_OPEN, j_ARRAY_OPEN, j_STRING, j_PLUS, j_MINUS, j_DOT then
29				Result := True
30			else
31
32			end
33		end
34
35	is_close_token (c: CHARACTER): BOOLEAN
36			-- Characters which close a type	
37		do
38			inspect c
39			when j_OBJECT_CLOSE, j_ARRAY_CLOSE, j_STRING then
40				Result := True
41			else
42
43			end
44		end
45
46	is_special_character (c: CHARACTER): BOOLEAN
47			-- Control Characters
48			-- 	%F  	Form feed
49			-- 	%H  	backslasH
50			--  %N  	Newline
51			--  %R  	carriage Return
52			--  %T  	horizontal Tab
53			--  %B  	Backspace
54		    --  /       Solidus
55		    --  "       Quotation	
56		do
57			inspect c
58			when '%F', '%H', '%N', '%R', '%T', '%B', '/', '"' then
59				Result := True
60			else
61
62			end
63		end
64
65   is_special_control (c: CHARACTER): BOOLEAN
66           --Control Characters
67           -- \b\f\n\r\t
68		do
69			inspect c
70			when 'b', 'f', 'n', 'r', 't' then
71				Result := True
72			else
73
74			end
75		end
76
77end