Hessian 2.0 Grammar

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
 
(9 intermediate revisions by one user not shown)
Line 1: Line 1:
 
[[Category:Hessian]]
 
[[Category:Hessian]]
  
Draft Grammar of Hessian 1.1
+
Draft Grammar of Hessian 2.0.  Notes and explanation are at [[Hessian 2.0]].  The spec development process has just begun.
  
See [[Hessian 1.0 Grammar]]
+
The following is the complete grammar for Hessian 2.0.  All integers are big-endian, i.e. starting with the most-significant byte first.
 
+
[[Category: Hessian]]
+
 
+
The following is the complete grammar for Hessian 1.1.  All integers are big-endian, i.e. starting with the most-significant byte first.
+
  
 
  top    ::= call
 
  top    ::= call
 
         ::= reply
 
         ::= reply
 
   
 
   
  call    ::= c x01 x00 header* method object* z
+
  call    ::= c x02 x00 header* method object* z
 
   
 
   
  reply  ::= r x01 x00 header* object z
+
  reply  ::= r x02 x00 header* object z
         ::= r x01 x00 header* fault z
+
         ::= r x02 x00 header* fault z
 
   
 
   
 
  object  ::= null
 
  object  ::= null
Line 30: Line 26:
 
         ::= list
 
         ::= list
 
         ::= map
 
         ::= map
 +
        ::= class
 +
        ::= instance
 
   
 
   
 
  header  ::= H b1 b0 header-string object
 
  header  ::= H b1 b0 header-string object
Line 37: Line 35:
 
   
 
   
 
  list    ::= V type? length? object* z
 
  list    ::= V type? length? object* z
 +
        ::= [x10 - x1f] <int> object*
 +
 
  map    ::= M type? (object object)* z
 
  map    ::= M type? (object object)* z
remote  ::= r type? string
 
 
   
 
   
 +
remote  ::= r type? string
 +
 
 
  type    ::= t b1 b0 type-string
 
  type    ::= t b1 b0 type-string
 +
        ::= T <int>
 +
 
  length  ::= l b3 b2 b1 b0
 
  length  ::= l b3 b2 b1 b0
         ::= 0x0b b0
+
         ::= x0f b0
        ::= 0x0c b1 b0
+
 
   
 
   
 
  null    ::= N
 
  null    ::= N
 +
 
  boolean ::= T
 
  boolean ::= T
 
         ::= F
 
         ::= F
 
   
 
   
 
  int    ::= I b3 b2 b1 b0
 
  int    ::= I b3 b2 b1 b0
         ::= 0x80 - 0xaf
+
         ::= [x80 - 0xcf]
         ::= 0x01 b0
+
         ::= x01 b0
         ::= 0x02 b1 b0
+
         ::= x02 b1 b0
 
   
 
   
 
  long    ::= L b7 b6 b5 b4 b3 b2 b1 b0
 
  long    ::= L b7 b6 b5 b4 b3 b2 b1 b0
         ::= 0xb0 - 0xcf
+
         ::= [x20 - x3f]
         ::= 0x03 b0
+
         ::= x03 b0
         ::= 0x04 b1 b0
+
         ::= x04 b1 b0
         ::= 0x05 b3 b2 b1 b0
+
         ::= x05 b3 b2 b1 b0
 
   
 
   
 
  double  ::= D b7 b6 b5 b4 b3 b2 b1 b0
 
  double  ::= D b7 b6 b5 b4 b3 b2 b1 b0
         ::= 0x06
+
         ::= x06
         ::= 0x07
+
         ::= x07
         ::= 0x08 int
+
         ::= x08 b0
 
+
        ::= x09 b1 b0
 +
        ::= x0b b3 b2 b1 b0
 +
        ::= x0c b1 b0
 +
        ::= x0e b3 b2 b1 b0
 +
 
  date    ::= d b7 b6 b5 b4 b3 b2 b1 b0
 
  date    ::= d b7 b6 b5 b4 b3 b2 b1 b0
 
   
 
   
 
  string  ::= (s b1 b0 string-data)* S b1 b0 string-data
 
  string  ::= (s b1 b0 string-data)* S b1 b0 string-data
 +
        ::= [xd0 - xef] string-data
 
   
 
   
 
  xml    ::= (x b1 b0 xml-data)* X b1 b0 xml-data
 
  xml    ::= (x b1 b0 xml-data)* X b1 b0 xml-data
 
   
 
   
 
  binary  ::= (b b1 b0 binary-data)* B b1 b0 binary-data
 
  binary  ::= (b b1 b0 binary-data)* B b1 b0 binary-data
 +
        ::= [xf0 - xff] binary-data
 
   
 
   
 
  ref    ::= R b3 b2 b1 b0
 
  ref    ::= R b3 b2 b1 b0
 +
        ::= x5b b0
 +
        ::= x5c b1 b1
 +
 +
class    ::= O int string-data int string* object*
 +
 +
instance ::= o int object*

Latest revision as of 20:50, 23 June 2006


Draft Grammar of Hessian 2.0. Notes and explanation are at Hessian 2.0. The spec development process has just begun.

The following is the complete grammar for Hessian 2.0. All integers are big-endian, i.e. starting with the most-significant byte first.

top     ::= call
        ::= reply

call    ::= c x02 x00 header* method object* z

reply   ::= r x02 x00 header* object z
        ::= r x02 x00 header* fault z

object  ::= null
        ::= boolean
        ::= int
        ::= long
        ::= double
        ::= date
        ::= string
        ::= xml
        ::= binary
        ::= remote
        ::= ref
        ::= list
        ::= map
        ::= class
        ::= instance

header  ::= H b1 b0 header-string object
method  ::= m b1 b0 method-string

fault   ::= f (object object)*

list    ::= V type? length? object* z
        ::= [x10 - x1f] <int> object*

map     ::= M type? (object object)* z

remote  ::= r type? string
 
type    ::= t b1 b0 type-string
        ::= T <int>

length  ::= l b3 b2 b1 b0
        ::= x0f b0

null    ::= N

boolean ::= T
        ::= F

int     ::= I b3 b2 b1 b0
        ::= [x80 - 0xcf]
        ::= x01 b0
        ::= x02 b1 b0

long    ::= L b7 b6 b5 b4 b3 b2 b1 b0
        ::= [x20 - x3f]
        ::= x03 b0
        ::= x04 b1 b0
        ::= x05 b3 b2 b1 b0

double  ::= D b7 b6 b5 b4 b3 b2 b1 b0
        ::= x06
        ::= x07
        ::= x08 b0
        ::= x09 b1 b0
        ::= x0b b3 b2 b1 b0
        ::= x0c b1 b0
        ::= x0e b3 b2 b1 b0

date    ::= d b7 b6 b5 b4 b3 b2 b1 b0

string  ::= (s b1 b0 string-data)* S b1 b0 string-data
        ::= [xd0 - xef] string-data

xml     ::= (x b1 b0 xml-data)* X b1 b0 xml-data

binary  ::= (b b1 b0 binary-data)* B b1 b0 binary-data
        ::= [xf0 - xff] binary-data 

ref     ::= R b3 b2 b1 b0
        ::= x5b b0
        ::= x5c b1 b1

class    ::= O int string-data int string* object*

instance ::= o int object*
Personal tools