File: operators.txt

package info (click to toggle)
parser 3.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,612 kB
  • ctags: 5,854
  • sloc: cpp: 27,638; ansic: 8,047; sh: 7,739; yacc: 1,360; makefile: 204; awk: 5
file content (1235 lines) | stat: -rw-r--r-- 54,371 bytes parent folder | download
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
!
X , ,   
  -  



    !^eval()[] ,   ::
        ! #
                   
                 
        !  :
            !|  xor
            !||  xor
            ~  
            \   10\3=3
        !def   defined,
               defined
               defined
             hash  defined
        ^if(method $hash.delete){yes}
        !eq ne lt gt le ge   , 
        !in "/dir/"  
            ["  ,     , 
               ].
        !is 'type'     , 
            ,  , " hash   ?"
        !-f      ,
        !-d      ,
        !  | - ,  |   
             whitespace
        !   0xABC
        !:
           /* logical */
           %left "!||"
           %left "||"
           %left "&&"
           %left '<' '>' "<=" ">="   "lt" "gt" "le" "ge"
           %left "==" "!="  "eq" "ne"
           %left "is" "def" "in" "-f" "-d"
           %left '!'
            ? : 

           /* bitwise */
           %left '!|'
           %left '|'
           %left '&' 
           %left '~'

           /* numerical */
           %left '-' '+'
           %left '*' '/' '%' '\\'
           %left NEG     /* negation: unary - */
        !
           true
           false

           
    !^if(){ }{ }
    !^switch[]{^case[1[;2...]]{}^case[DEFAULT]{  }}
    !^while(){}[[]|{        }]
    !^for[i](0;4){}[[]|{        }]
    !^use[]
    !^try{
        ...
        !^throw[sql.connect[;[;]]] //  ^error[]
        !^throw[
        	$.type[sql.connect]
        	$.source[]
        	$.comment[]
        ]
        ...
    }{
        ^if($exception.type eq "sql"){
            $exception.handled(1|true)  ^rem{,  exception }
            ....
        }
        
        ^switch[$exception.type]{
            ^case[sql;mail]{
                $exception.handled(1)
                ,  sql 
                $exception.type = sql.connect
                $exception.file $exception.lineno $exception.colno [    ]
                $exception.source = 
                $exception.comment = 
            }
            ^case[DEFAULT]{
                ,   
                ^throw[$exception] << re-throw // DON'T! It's default behaviour!
            }
        }
    }
    ^exit[] + -   . 
            401 
    ^return[] + -    , 
          
    !^break[] + -  
    !^continue[] + -   
    !^untaint[[as-is|file-spec|http-header|mail-header|uri|sql|js|xml|html|optimized-html|regex|parser-code]]{}
        default as-is
    !^taint[[lang]][]
        default "just tainted, language unknown"
    !^process[[$caller.CLASS|$object|$:CLASS]]{,   process-ed,  }[
        $.main[   @main]
        $.file[   , ,  ]
        $.lineno(   ,   .  ) 
    ]
    !^process..[][   @main]
       ,    $self [  , $self=$MAIN:CLASS]
    !^connect[protocol:// ]]{  ^sql[...]-}
        !mysql://user:pass@{host[:port]|[/unix/socket]}/database?
            ClientCharset=parser-charset << charset in which parser thinks client works
            charset=cp1251_koi8&
            timeout=3&
            compress=0&
            named_pipe=1&
            multi_statements=1&	allow execute more then one query in one parser :sql{} request
            autocommit=1
            autocommit    0,   commit/rollback

        !pgsql://user:pass@{host[:port]|[local]}/database?
            client_encoding=win,[to-find-out]
            &datestyle=ISO,SQL,Postgres,European,NonEuropean=US,German,DEFAULT=ISO
            &ClientCharset=parser-charset << charset in which parser thinks client works
        
        !oracle://user:pass@service?
            NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&
            NLS_LANGUAGE  language-dependent conventions
            NLS_TERRITORY  territory-dependent conventions
            NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS
            NLS_DATE_LANGUAGE  language for day and month names
            NLS_NUMERIC_CHARACTERS  decimal character and group separator
            NLS_CURRENCY  local currency symbol
            NLS_ISO_CURRENCY  ISO currency symbol
            NLS_SORT  sort sequence
            ORA_ENCRYPT_LOGIN=TRUE
            ClientCharset=parser-charset << charset in which parser thinks client works

        !odbc://DSN=dsn^;UID=user^;PWD=password^;ClientCharset=parser-charset
            ClientCharset << charset in which parser thinks client works
            
        !sqlite://DBfile?
        	ClientCharset=parser-charset& << charset in which parser thinks client works
        	autocommit=1

          connect ,  (    auto.p)
          
#sql drivers
$SQL[
    $.drivers[^table::create{protocol	driver	client
mysql	/www/parser3/libparser3mysql.so	/usr/local/lib/mysql/libmysqlclient.so
pgsql	/www/parser3/libparser3pgsql.so	/usr/local/pgsql/lib/libpq.so
oracle	/www/parser3/libparser3oracle.so	/u01/app/oracle/product/8.1.5/lib/libclntsh.so?ORACLE_HOME=/u01/app/oracle/product/8.1.5&ORA_NLS33=/u01/app/oracle/product/8.1.5/ocommon/nls/admin/data
sqlite	/www/parser3/libparser3sqlite.so	/usr/local/sqlite/lib/sqlite3.so
odbc	c:\drives\y\parser3project\odbc\debug\parser3odbc.dll
}]
]
        !   oracle    
          environment  (     ),
         ,   NLS_ ORA_  ORACLE_,    +
         win32 
             PATH+=^;C:\Oracle\Ora81\bin
         : 
          ORA_NLS33       ( NLS_LANG)
                -,    .drivers,
                  NLS 
             (  ,      NLS_LANG)
          ORACLE_HOME       ,
             ,  ,     ,
             NLS_LANG,  .

        :        oracle&pgsql[  ],
             , ,   
        /**_**/'literal'
    !^rem{}
    !^cache[](){}[{catch }]
        !  
        ! ,       '' 
        ! 0,   ,    
        ! catch  $exception.handled[cache]  ^rem{,  exception }
    !^cache[][expires date]{}[{catch }]
        !  
    X^cache[]   [ ,   ] //  ,   ,  ^cache(0)
    !^cache()
    !^cache[expires date]
        !  ^cache "  - ''/'expires'"
        ! : ^cache(0)  
    !^cache[]   expires date
    X^cache[read] 
          ^cache "  ,  expires",
         bool "/"
	!^sleep(seconds)


    X    /  " "
    !  : ^untaint[html]{}   
        X 

    !      $result,     ,
    ! __   ,    
    !      $caller,     stack frame,
    !  

    !use(^use  @USE)  ...
    !1. ...    /,  ,       
    !  / $MAIN:CLASS_PATH  /    .
        ! /     .
    !2. ...   table $MAIN:CLASS_PATH,  
           auto.p  

    !  $CHARSETS[$.[ ]]
    !    (whitespace, letter, etc),    unicode
    !: tab delimited ,  :
    !    char    white-space    digit    hex-digit    letter    word    lowercase    unicode1    unicode2    
    !    A            x    x    x    a    0x0041    0xFF21
    !  char  lowercase   ,     0x
    !     unicode ,   , 
    !    unicode
    !   UTF-8, 
    !   -  request  response
    !:   case sensitive


    !$[ ]
    !$(   )
    !${  }
    !$ whitespace  ${}   
    !^   
    !$.CLASS  
    !$.CLASS_NAME  
    !$[$.key[] () {}]    - $.key
    !^method[$.key[] () {}]   - $parameter.key
    $CLASS.     

      :  tab linefeed ; ] } ) " < >  + * / % & | = ! ' , ? {}
    .. 
    $,aaaa
         ,  -, 
    ${}-
      +  -    
    !     : $name.subname
    ! subname :
    !    
    !    $
    !    $
    !    [,  ]
    : $[$.(88)] $[$.[]] ^.[$.].format{%05d}

:=   
:=
    !( )     , 
|    ![]     , 
|    !{}  0     , 
    !  ;  -      


!void
    !^.length[]
        0
    !^.pos[...]
        -1
    !^.left(n)
         
    !^.right(n)
         
    !^.mid(p[;n])
         
    !^.int[]  (default) 
        0  default
    !^.double[] (default)
        0  default
    !^.bool[] (default)
        false  default
    !^void:sql{  }{$.bind[. table::sql]}


!int,double
    !^.int[]    
    !^.double[]+  double  
    !^.bool[] + .bool(true|false)  bool 
    !^.inc(  +)
    !^.dec(  -)
    !^.mul(  *)
    !^.div(  /)
    !^.mod(  %)
    !^.format[]
    !^int/double:sql{query}[[$.limit(2) $.offset(4) $.default{0} $.bind[. table::sql]]]
        ,      / 

!string
    !  
        !def   " ?"
        !/      double,
                 0    

        :
        ^if(def $form:name)  ?
        ^if($user.isAlive) ? [  ,  ?]
    !^string:sql{query}[[$.limit(1) $.offset(4) $.default{n/a} $.bind[. table::sql]]]
             / 
    !^.int[] .int(default)   . 
          ,  default
    !^.double[]+ .double(default)  double  
    !^.bool[] + .bool(default)  bool  
          ,  default
    !^.format[] %d  %.2f %02d...
    !^.match[-|-regex][[ ]]  $prematch $match $postmatch $1 $2...
         =
        i CASELESS
        x whitespace in regex ignored
        s singleline = $    
        m multiline = $   [\n],    
        g   ,   
        '   prematch, match, postmatch
        n      ,     
        U    '?'
    !^.match[-|-regex][ ]{}
         +=
        g   ,   
    !^.split[][[lrhv]][[    ]]
        l   [default]
        r  
        h nameless    0, 1, 2, ...
        v   1  'piece'    [default]
    !^.{l|r}split[]    $piece
          
    !^.upper|lower[] 
    X^.truncate( )  :(
    !^.length[]
    !^.mid(P[;N])
         N - "  "
    !^.left(N)
    !^.right(N)
    !^.pos[]
    !^.pos[](,   )
        <0 =  
    !^.replace[$____]
    !^.save[[append;]]
    !^.save[[;$.charset[   ] $.append(true)]]
    !^.normalize[]   ,       
            match ,   ,   
            
    !^.trim[start|both|end|left|right[;chars]]  chars  //   
        default 'chars' -- whitespace chars
    !^.append[string]
    !^.base64[] encode
    !^string:base64[encoded] decode

!table
      
           " ?"
           count[]
    !^table::create[[nameless]]{}[[$.separator[^#09]]]   "set"
    !^table::create[table][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]]
             
        reverse <<    (    locate,  table::create  )
    !^table::load[[nameless;][;]]
        !  nameless,      
        ! ,       '#',         
        !$.separator[^#09]
        !$.encloser["] -, .
    !^table::sql{query}[[$.limit(2) $.offset(4) $.bind[hash] todo:$.default{ ^table::create[...] }]]
    	bind       
    	    oracle
    	    ":"
    	  bind  hash,   (  ) 
    !^.save[[nameless|append;][;, . load]]
    !$.
    !$.fields   named      Hash
    !^.menu{}[[]]
    !^.offset[]  offset
    !^.offset[[whence]](5) 
        !whence=cur|set
        ! whence -  cur
    !^.count[]
    !^.line[] 1-based offset
    !^.sort{{ }|( )}[{desc|asc}] default=asc
    !^.append{}
    X^.insert{}[(n)]   
           [    n]
    X^.remove(position[;count]) -   
           [    ] 
            [ count ]
    !^.join[][$.limit(1) $.offset(5) $.offset[cur]] -    . 
            .
    !^.flip[]  ,  - ,  
    !^.locate[;][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]] 
          ,  .  bool
    !^.locate( )[[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]]
          ,  .  bool
    !^.hash{[]|{}|()}[[ |table  ]][[$.distinct(1) $.distinct[tables]]]
         $hash.  hash      
             ,     ,  
         distinct  true,       
         distinct  tables,    hash  ,    
    !^.columns[[ ]]+     'column'   
    !$[^.select()] =       ,    
        $adults[^man.select($man.age>=18)]
    ^.color[1;2]


!hash
    !  
        !   " ?"
        !   _count[]
    !$.
        !_default -  ,  , 
            ,   ,  _default  
    !$.fields  $hash.   hash       table
    !^hash::create[[!copy_from_hash|copy_from_hashfile]]
          hash,  
    !^.add[]
         
    !^.sub[]
    !^.union[b] = 
         
    !^.intersection[b] = 
         
    !^.intersects[b] = bool
    !^hash::sql{}[[$.distinct(1) $.limit(2) $.offset(4) todo:$.default{$.field[]...}]]
         hash(=   )
        of hash(=   )
    !^._keys[[   ]]+     $key   
    !^._count[]
    !^.foreach[key;value]{}[[]|{        }]
    !^.delete[]   
    !^.contain[] -      (bool)

!hashfile
    !^hashfile::open[filename]
    !^.clear[]   
    !$.[]   
    !$.[$.value[] $.expires[]}
         expires
        expires   date,   (0= )
    !$.  
    !^.delete[]   
    !^.delete[]   ,  
    !^.hash[]
           hash
           
    !^.foreach[key;value]{}[[]|{        }]
    !^.release[]
            .
              .
    !^.cleanup[]        .

    :
    $sessions[^hashfile::open[/db/sessions]]
   
    $sid[^math:uuid[]]
    $sessions.$sid[$.value[$uid] $.expires(1)]
    $uid[$sessions.$sid]


!form
    [      GET,    POST]
    !$form: = string/file 
    !$form:nameless =       "?value&...", "...&value&...", "...&value"
    !$form:qtail =       "?xxxxx",     ',' [imap]
    !$form:fields = hash    
    !$form:tables. = table    "field"   ""
    !$form:files. = hash     ,  - 0, 1, ...,  - 
    !$form:imap =    'x'  'y'
          ?1,2    server-site image map


!env
    !$env:
    !$env:PARSER   ,     parser.cgi


!cookie
    !$cookie:    
    !$cookie:[]  90 
    !$cookie:[$.value[]  $.expires[] $.secure(true)]
    !  expires   'session', date,   (0=session)
    !  ,      "Sun, 25-Aug-2002 12:03:45 GMT"
    !   bool ,  $.secure(true), $.httponly(true)
    !$cookie:fields = hash   cookies


!request
    !$request:query    
    !$request:body unprocessed POST request body
    !$request:uri
    !$request:document-root
        ,      parser, - = $env:DOCUMENT_ROOT
         ,   hosting -  
    !$request:argv = hash    .  0, 1, ... [0 --   ].
    X!$request:browser   hash, :
        !$type = ie/nn  !$version = ,  5.5       
    X$request:user
    X$request:password
    !$request:charset
           
        !  upper/lower  match[][i]
        :  form       auto  MAIN
           $request/response:charset    .  .


!response
    !$response:[]      -- $response:
        !   string    hash:
        ! $value[abc] field: {abc}<<
        ! $attribute[zzz] field: abc; {attribute=zzz}<<
        !      string  date
        !  ,      "Sun, 25-Aug-2002 12:03:45 GMT"
    !$response:headers  
    !$response:body[DATA]    
    !$response:download[DATA]    , 
    	 ,  browser  download
    !$response:status
    !^response:clear[]    response 
    !$response:charset
          .. , 
        1)     $form:    browser'
        2)         browser
        3)       uri
           content-type ,  ,    
        :  form       auto  MAIN
           $request/response:charset    .  .


!regex
    !  
        !    true
        !      .
    !^regex::create[-][[ ]]
    !^.size[]    
            --     pcre , ,  .
    !^.study_size[]  study-. ==0 --     ""
    ^.save[filespec]
    ^.load[filespec]


!reflection
    !^reflection:create[;[;;[[;]]]]      (  100 )
    !^reflection:classes[]                    .  --  ,   methoded (  )  void
    !^reflection:class[]               
    !^reflection:class_name[]           
    !^reflection:base[]                 
    !^reflection:base_name[]             
    !^reflection:methods[]                 ,  --  'native'  'parser'
    !^reflection:fields[  ]             
    !^reflection:method_info[;]       
         $.inherited[]                 ,     (       )
          native   :
             .min_params(   )
             .max_params(   )
             .call_type[dynamic|static|any]
          parser   :
              --   (0, 1, ...),  -  
    !^reflection:dynamical[[object or class, caller if absent]]     true,       
                                                                       true,    ,
                                                                   false  


!mail
    !$mail.received=MESSAGE:
        .from
        .reply-to
        .subject
        .date  date
        .message-id
        .raw[
            ._--
        ]
        $.{text|html|file#}[ <<     mail:send (text, text2, ...) (file, file2, ...)
            $.content-type[
                $.value[{text|...|x-unknown}/{plain|html|...|x-unknown}]
                [$.charset[windows-1251]] <<   ,   
                $.--
            ]
            $.description
            $.content-id
            $.content-md5
            $.content-location
            .raw[
                ._--
            ]
            $.value[|FILE]
        ]
        $.message#[MESSAGE] (message, message2, ...)

    !^mail:send[
    	$.options[-odd]
	        unix: ,       sendmail
	            -odd  "      email"
	        win32: 
        $.charset[    ] 
        $.any-header-field 
        $.text[string]
        $.text[
           $.any-header-field 
           $.value[string]
        ]
        $.html{string}
        $.html[
            $.any-header-field 
            $.value{string}
        ]
        $.file#[FILE]
        $.file#[
            $.any-header-field 
            $value[FILE]
        ]
    ]
    ! charset ,     charset
    !content-type.charset    
    !     # 
        ^mail:send[
#           -,   source encoding.
#             body
            $.charset[windows-1251] 
#            
            $.content-type[$.value[text/plain] $.charset[windows-1251]]
            $.from["" <vasya@design.ru>]
            $.to["" <petya@design.ru>]
            $.subject[ ]
            $.body[
                
            ]
        ]
    !:send[$.header-field[] $.charset[ ] $.body[ body  , 
         hash,  multipart ]]
    ! charset ,     charset
    !content-type.charset    
    !      ,     .
    ! body  ,    ,  .
    ! body  hash,   ,    ,  
    !  ,    
    !      text,    .
    !      file,   ,  ::
        !$file[$.format[!uue|!base64] $.value[DATA] $.name[user-file-name]]
    !:  multipart   content-type
        ^mail:send[
#           -,   source encoding.
#             body
            $.charset[windows-1251] 
#            
            $.content-type[$.value[text/plain] $.charset[windows-1251]]
            $.from["" <vasya@design.ru>]
            $.to["" <petya@design.ru>]
            $.subject[ ]
            $.body[
                
            ]
        ]
        ^mail:send[
            $.from["" <vasya@design.ru>]
            $.to["" <petya@design.ru>]
            $.subject[ ]
            $.body[
                $.text[
#                     body
                    $.charset[windows-1251]
#                    
                    $.content-type[$.value[text/plain] $.charset[windows-1251]]
                    $.body[]
                ]
#       ,     multipart
                $.file[
                   $.value[^file::load[my beloved.doc]]
                   $.name[ .doc]
                   $.format[base64]
                ]
                $.file2[
                   $.value[^file::load[my beloved.doc]]
                   $.name[ .doc]
               ]
            ]
        ]
    !  
     unix    ,  
        $MAIL.sendmail[]
           , ,   
        /usr/sbin/sendmail 
        /usr/lib/sendmail
        ,  ,     "-t".    
     win32  SMTP ,   
        $MAIL.SMTP[smtp.domain.ru]

!image
    !$[^image::measure[DATA]]
          .ext case insensitive, 
            .gif  .jpg .jpeg
    !$.exif << hash  measure jpeg  exif  
        !$image.exif.DateTime & co 
            [  . http://www.ba.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html]
        !  int/double,
        !  date
        !   hash   0..count-1
    !$.src .width .height
    !$.line-width  = 
       !$.line-style =  '*** * '='*** * *** * *** * '
    !^.html[[hash]] = <img ...>
    !^image::load[.gif]
         gif 
    !^image::create( X; Y[;  default ]])
    !^.line(x0;y0;x1;y1;0xffFFff)
    !^.fill(x;y;0xffFFff)
    !^.rectangle(x0;y0;x1;y1;0xffFFff)
    !^.bar(x0;y0;x1;y1;0xffFFff)
    !^.replace(hex-1;hex-2)[table x:y _]
    !^.polyline+()[table x:y ]
    !^.polygon()[table x:y _]
    !^.polybar()[table x;y _]
    !^.font[_;__.gif][(_[;_])]
          =  /   
          _,  monospaced,  0,  _ =  gif
    !^.font[_;__.gif;
           $.space(_)             //   =  gif
           $.width(_)             // . ,   proportional
           $.spacing(  ) //   = 1
     ]
    !^.text(x;y)[_] AS_IS
    !^.length[_] AS_IS
    !^.gif[,  ] --   FILE  content-type=image/gif
             $response:download
    !^.arc(center x;center y;width;height;start in degrees;end in degrees;color)
    !^.sector(center x;center y;width;height;start in degrees;end in degrees;color)
    !^.circle(center x;center y;r;color)
    !^.copy[source](src x;src y;src w;src h;dst x;dst y[;dest w[;dest h[;tolerance]]])
          dest_w/dest_h    
               resample
                []   /pie,
             thumbnais  .
           dest_h  aspect ratio
        tolerance -  [   RGB    ], 
              [default=150]
             -   ,    
             -   ,    
    !^.pixel(x;y)[(color)]
            


!file
    !$__post.name 
    !$__post.size 
    !$t_post.text
    !^.save[text|binary; [;$.charset[   ]]]
    !^file:delete[ ]
    !^file:find[ ][{  }]
    !^file:list[[;-|-regex]] = table   name
    !^file::load[text|binary;!big.zip[;!domain_press_release_2001_03_01.zip][;]]
    !^file::create[text;;data]
    !^file::create[text;;data[;$.charset[    ]]]
    !$___loaded.size
    !$___loaded__created.mode = text/binary
    !^file::stat[ ]
    !$___stated__loaded.size !.adate !.mdate !.cdate
    !^file::cgi[[text|binary;] [;env hash +options[;1cmd[;2line[;3ar[;4g[;5s]]]]]]]
            $
        $status
        $stderr
    !^file::exec[[text|binary;] [;env hash[;1cmd[;2line[;3ar[;4g[;5s;...under unix max 50 args]]]]]]]
        options:
            $.stdin[]    ,     HTTP-POST 
    !^file:move[  ;  ] 
            [win32:     ]
          dest    775
           ,   move   
    !^file:copy[ ;  ] 
           
    !^file:lock[ ]{}
           
        
         
        
    Xchmod[...]    ,     executable  ,   ftp  chmod.
    !^file:dirname[/a/some.tar.gz]=/a
    !^file:dirname[/a/b/]=/a
    !^file:basename[/a/some.tar.gz]=some.tar.gz
    !^file:justname[/a/some.tar.gz]=some.tar
    !^file:justext[/a/some.tar.gz]=gz
    !/some/page.html: ^file:fullpath[a.gif] => /some/a.gif
    !^.sql-string[]  ^connect   escaped ,     
    X^file::sql[[___download]]{}
    !^file::sql{}[[
    	$.name[___download]
    	$.content-type[ content-type]
    ]]
    	    " ".
    	:
    	  - 
    	   -   
    	   -  content-type
    !^.base64[] encode
    !^file:base64[ ] encode
    !^file::base64[encoded string] decode
    !^file:crc32[ ]
        crc32    
    !^.crc32[]
		 crc32 
	!^.md5[]
	!^file:md5[ ]
         digest ,  16    , 
          digest   hex , ,   


!math
    !$math:PI
    !^math:round floor ceiling 
    !^math:trunc frac
    !^math:abs sign 
    !^math:exp log 
    !^math:sin asin cos acos tan atan 
    !^math:degrees radians
    !^math:pow sqrt
    !^math:random( )
    !^math:uuid[]
        22C0983C-E26E-4169-BD07-77ECE9405BA5
        win32:  cryptapi
        unix:  /dev/urandom, 
             , /dev/random, 
             , rand 
            [ solaris /dev/random  ]
    !^math:uid64[]
       BA39BAB6340BE370
    !^math:md5[string]
         digest ,  16    , 
          digest   hex , ,   
    !^math:crypt[password;salt]
       salt prefix $apr1$   MD5 , 
            salt,   
       $1$  MD5   OS 'crypt',   [   solaris].
        salt     OS 'crypt'.
    !^math:crc32[string]
        crc32 
    !^math:sha1[string]


!inet
    !^inet:ntoa(long)
    !^inet:aton[IP]


!date
    !  time    ,  
           epoch [1  1970 (UTC)], 
    !   localtime, 
    !    parser  OS
    $date:UTC-offset     ,   local 
    $date:TZ    , ,   (-     )
    !^date::now[]
    !^date::now(  )  +
    !^date::create(  epoch) //   set
    !^date::create(year;month[;day[;hour[;minute[;second]]]]) //   set
    !^date::create[   %Y-%m-%d %H:%M:%S]
              
        1: %Y[-%m[-%d[ %H[:%M[:%S]]]]]
        2: %H:%M[:%S]
    !^date::unix-timestamp()
    !^.unix-timestamp[]
    !$.year month day  hour minute second  weekday yearday(0...) daylightsaving TZ weekyear
        read-only
        TZ="" <<  
    !^.roll[year|month|day](+-)  
    !^.roll[TZ; ] ,    -  :   .hour & Co
    !^.sql-string[] %Y-%m-%d %H:%M:%S
        where published='^.sql-string[]'
    !^date:calendar[rus|eng](;)    
        : 0..6, week, year
    !^date:calendar[rus|eng](;;)   
        : year, month, day, weekday
    !^date:last-day(;)    
    !^.last-day[]     $
    !^.gmt-string[]  Fri, 23 Mar 2001 09:32:23 GMT


xdoc(xnode)
    !$xdoc.search-namespaces hash, where keys=prefixes, values=urls
    
    DOM1 attributes:
    !readonly attribute DocumentType doctype
    Xreadonly attribute DOMImplementation implementation
    !readonly attribute Element documentElement

    DOM1 methods:
    !Element createElement(in DOMString tagName)
    !DocumentFragment createDocumentFragment()
    !Text createTextNode(in DOMString data)
    !Comment createComment(in DOMString data)
    !CDATASection createCDATASection(in DOMString data)
    !ProcessingInstruction createProcessingInstruction(in DOMString target,in DOMString data)
    !Attr createAttribute(in DOMString name)
    !EntityReference createEntityReference(in DOMString name)
    !NodeList getElementsByTagName(in DOMString tagname)

    DOM2 some methods:
    !^.getElementById[elementId] = xnode
        The DOM implementation must have information that says which attributes are of type ID. 
        Attributes with the name "ID" are not of type ID unless so defined. 
        Implementations that do not know whether attributes are of type ID or not 
        are expected to return null.

    !     $.encoding 
    !    ,
        $response:charset
    ::sql{...}
    !::create[[URI]]{<?xml?><string/>}   'set'
    !::create[[URI]][qualifiedName]
      URI default = disk path to requested document
         / 
    !::create[file] can be usable:
    	$f[^file::load[binary;http://;some HTTP options here...]]
    	$x[^xdoc::create[$f]]
    !::load[file.xml[;]]
    !.transform[rules.xsl|xdoc][[params hash]]  dom
         ,       ,
            " .stamp"[  stamp ]
        <xsl:output
        !method = "xml" | "html" | "text"
            X| qname-but-not-ncname 
        !version = nmtoken 
        !encoding = string 
        !omit-xml-declaration = "yes" | "no"
        !standalone = "yes" | "no"
        X[,  xsltSaveResultTo   ]doctype-public = string 
            X   "-//W3C//DTD XHTML"    XHTML
        X[,  xsltSaveResultTo   ]doctype-system = string 
        !cdata-section-elements = qnames 
        !indent = "yes" | "no"
        !media-type = string /> 
        !   ,  xpath 

    !.string[[output options]]
    !.save[file.xml[;output options]]  
    !.file[[output options]] = file
        output options   xsl:output 
            [:  cdata-section-elements,  , ]
         media-type   $response:body[]


	!    :
	    parser://method/param/to/that/method
	         ^MAIN:method[/param/to/that/method]
	    [:      /, ,     ]

!xnode
    DOM1 attributes:
    !$node.nodeName
    !$node.nodeValue
    	!read
    	!write
    !$node.nodeType = int
      ELEMENT_NODE                   = 1 
      ATTRIBUTE_NODE                 = 2 
      TEXT_NODE                      = 3 
      CDATA_SECTION_NODE             = 4 
      ENTITY_REFERENCE_NODE          = 5 
      ENTITY_NODE                    = 6 
      PROCESSING_INSTRUCTION_NODE    = 7 
      COMMENT_NODE                   = 8 
      DOCUMENT_NODE                  = 9 
      DOCUMENT_TYPE_NODE             = 10 
      DOCUMENT_FRAGMENT_NODE         = 11 
      NOTATION_NODE                  = 12 
            $vasyaNode.type==$xnode:ELEMENT_NODE
    !$node.parentNode
    !$node.childNodes = array of nodes
    !$node.firstChild
    !$node.lastChild
    !$node.previousSibling
    !$node.nextSibling
    !$node.ownerDocument = xdoc
    !$node.prefix
    !$node.namespaceURI
    !$element_node.attributes = hash of xnodes
    !$element_node.tagName
    !$attribute_node.specified = boolean
        true if the attribute received its value explicitly in the XML document, 
        or if a value was assigned programatically with the setValue function.
        false if the attribute value came from the default value declared in the document's DTD. 
    !$attribute_node.name
    !$attribute_node.value
    $text_node/cdata_node/comment_node.substringData
    !$pi_node.target = target of this processing instruction
        XML defines this as being the first token following the markup 
        that begins the processing instruction.
    !$pi_node.data = The content of this processing instruction
        This is from the first non white space character after the target 
        to the character immediately preceding the ?>. 
    document_node.
        readonly attribute DocumentType doctype
        readonly attribute DOMImplementation implementation    
        readonly attribute Element documentElement
    document_type_node.
        !readonly attribute DOMString name
        readonly attribute NamedNodeMap entities
        readonly attribute NamedNodeMap notations
    !notation_node.
        !readonly attribute DOMString publicId
        !readonly attribute DOMString systemId

    !DOM1 node methods:
    !Node insertBefore(in Node newChild,in Node refChild)
    !Node replaceChild(in Node newChild,in Node oldChild)
    !Node removeChild(in Node oldChild)
    !Node appendChild(in Node newChild)
    !boolean hasChildNodes()
    !Node cloneNode(in boolean deep)

    !DOM1 element methods:
    !DOMString getAttribute(in DOMString name)
    !void setAttribute(in DOMString name, in DOMString value) raises(DOMException)
    !void removeAttribute(in DOMString name) raises(DOMException)
    !Attr getAttributeNode(in DOMString name)
    !Attr setAttributeNode(in Attr newAttr) raises(DOMException)
    !Attr removeAttributeNode(in Attr oldAttr) raises(DOMException)
    !NodeList getElementsByTagName(in DOMString name)
    !void normalize()


    !Introduced in DOM Level 2:
    !Node importNode(in Node importedNode, in boolean deep) raises(DOMException)
    !NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString localName)
    !boolean hasAttributes()

    !XPath:
    !^node.select[xpath/query/expression] = array of nodes, 
        empty array if nothing found
    !^node.selectSingle[xpath/query/expression] = first node if any
    !^node.selectBool[xpath/query/expression] = bool if any or die
    !^node.selectNumber[xpath/query/expression] = double if any or die
    !^node.selectString[xpath/query/expression] = string if any or die

    !error codes(       ):
        INDEX_SIZE_ERR
        If index or size is negative, or greater
        than the allowed value
        DOMSTRING_SIZE_ERR
        If the specified range of text does not
        fit into a DOMString
        HIERARCHY_REQUEST_ERR
        If any node is inserted somewhere it
        doesn't belong
        WRONG_DOCUMENT_ERR
        If a node is used in a different
        document than the one that created it
        (that doesn't support it)
        INVALID_CHARACTER_ERR
        If an invalid character is specified,
        such as in a name.
        NO_DATA_ALLOWED_ERR
        If data is specified for a node which
        does not support data
        NO_MODIFICATION_ALLOWED_ERR
        If an attempt is made to modify an
            object where modifications are not
        allowed
        NOT_FOUND_ERR
        If an attempt was made to reference a
        node in a context where it does not
        exist
        NOT_SUPPORTED_ERR
        If the implementation does not support
        the type of object requested
        INUSE_ATTRIBUTE_ERR
        If an attempt is made to add an
        attribute that is already inuse
        elsewhere

!memory
    !^memory:compact[]  ,     
    (:     )
       XSL transform.

!status
    !   ,  apache   
    <Location /parser-status.html>
    ParserStatusAllowed
    </Location>
    ! cgi  
    ! isapi   

    !$status:sql hash
        !cache table
            url    time    
            url    time    
            url    time    
    !$status:stylesheet
        !cache table
            file    time
            file    time
            file    time

    !$status:rusage hash
        !utime user time used
        !stime system time used
        !maxrss max resident set size
        !ixrss integral shared text memory size
        !idrss integral unshared data size
        !isrss integral unshared stack size
        !tv_sec
        !tv_usec
           $s[$status:rusage]
           ^s.tv_sec.format[%.0f].^s.tv_usec.format[%06.0f]

    !$status:memory hash
        !used
            Includes some pages that were allocated but never written.		

        !free

        !ever_allocated_since_compact
            Return the number of bytes allocated since the last collection.	

        !ever_allocated_since_start
            Return the total number of bytes [EVER(c)PAF] allocated in this process.		
            Never decreases.							

    !$status:pid process id
    !$status:tid thread id

console
    $console:timeout
    !$console:line
        read/write 

DATA::=string | file | hash

!hash 
[
	$.file[   ]
	$.name[   ]
	$.mdate[date]
]

!MAIN
     ,      auto.p, 
     auto.p   :
        ! auto.p 
            cgi: 
                1.       CGI_PARSER_SITE_CONFIG
                       parser' 
            isapi: windows directory
            apache module: 
                1) ParserConfig [can be in .htaccess]
        !auto.p   DOCUMENT_ROOT/        
         ,    
       MAIN,    
    
    !  MAIN    @main[]
    !     @postprocess[data] if($data is string) ...
    !   

!    try  ,     , 
    !
    !@unhandled_exception[exception;stack]
    !$exception.type   " "
    !$exception.file $exception.lineno $exception.colno ,   ,    [    ]
    !$exception.source , -   
    !$exception.comment  english
    !stack    file line name,
             [name]   [file line] 
        /,   .

!   (file::load, table::load, xdoc::load)     :
    !http://domain/document[?params<<deprecated, use $.form[...]]
    ! , ,  :
        !$.method[GET|POST|HEAD]
        !$.timeout(3)  <<  , - =2
        !$.cookies[
        	$.[]
        ]
        !$.headers[
        !    $.[] <<   ,  $response:
        !]
        $.enctype[multipart/form-data]
        $.form[
            !$.field1[string]
            !$.field2[^table::create{one_column_only^#0Avalue1^#0Avalue2}]
            $.field3[file]
        ]
        !$.body[string]
        	|file
        !-, user-agent=parser3
        !-,  http status != 200 >>  http.status ,
        !  , 
        !$.any-status(1)
        !$.charset[   -] <<    content-type:charset=_
        !$.user[]
        !$.password[]
    !file::load    
        !: (    )
        !tables <<   ->table    "value". 
                  . ,  set-cookies
            todo:  cookies

!  :
    !parser.compile       ^test[}                 ( , ...)
    !parser.runtime       ^if(0).                 (/,  ,   , ...)
    !number.zerodivision  ^eval(1/0) ^eval(1%0)
    !number.format        ^eval(abc*5)
    !file.lock                                                        shared/exclusive lock error
    !file.missing         ^file:delete[delme]                         not found
    !file.access          ^table::load[.]                             no rights
    !file.read            ^file::load[...]                            error while reading file
    !file.seek                                                        seek failed
    !file.execute         ^file::cgi[...]                             incorrect cgi header/can't execute
    !image.format         ^image::measure[index.html]                 not gif/jpg
    !sql.connect          ^connect[mysql://baduser:pass@host/db]{}    not found/timeout
    !sql.execute          ^void:sql{select bad}                       syntax error
    sql.duplicate
    sql.access
    sql.missing
    sql.xxx [serge asked]
    !xml                  ^xdoc::create{<forgot?>}                    any error in xml/xslt libs
    !smtp.connect                                                     not found/timeout
    !smtp.execute                                                     communication error
    !email.format         hren tam@null.ru                            wrong email format(bad chars/empty)
    !email.send           $MAIL.sendmail[/shit]                       sendmail not executable
    !http.host            ^file::load[http://notfound/there]          host not found
    !http.connect         ^file::load[http://not_accepting/there]     host found, but do not accept connections
    !http.timeout         ^file::load[http://host/doc]                whole load operation failed to complete in # seconds
    !http.response        ^file::load[http://ok/there]                host found, connection accepted, bad answer
    !http.status          ^file::load[http://ok/there]                host found, connection accepted, status!=200
    !date.range           ^date::create(1950;1;1)                     date out of valid range

!   apache: CharsetDisable on

X  MAIN    $ORIGINS(1)      
           

!  MAIN  $SIGPIPE(1)   ,     , 
	     parser3.log (   )

!      result   
    (   )
             -,