Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Thrift Wiki" for change 
notification.

The following page has been changed by ChadWalters:
http://wiki.apache.org/thrift/ThriftIDL

------------------------------------------------------------------------------
  
  Here is a description of the Thrift IDL:
  
- {{{Document      ::=  Header* Definition*}}}
+ {{{Document        ::=  Header* Definition*}}}
  
- {{{Header        ::=  Include | CppInclude | Namespace | XsdNamespace}}}
+ {{{Header          ::=  Include | CppInclude | Namespace | XsdNamespace}}}
  
- {{{Include       ::=  'include' Literal}}}
+ {{{Include         ::=  'include' Literal}}}
  
- {{{CppInclude    ::=  'cpp_include' Literal}}}
+ {{{CppInclude      ::=  'cpp_include' Literal}}}
  
- {{{Namespace     ::=  'namespace' ( ( NamespaceType Identifier ) |}}}[[BR]]
+ {{{Namespace       ::=  'namespace' ( ( NamespaceType Identifier ) |}}}[[BR]]
  {{{                     ( 'smalltalk.category' STIdentifier ) )}}}
  
- {{{NamespaceType ::=  '*' | LangID | 'smalltalk.prefix'}}}
+ {{{NamespaceType   ::=  '*' | LangID | 'smalltalk.prefix'}}}
  
- {{{LangID        ::=  'cpp' | 'java' | 'php' | 'py' | 'perl' | 'rb' |}}}[[BR]]
+ {{{LangID          ::=  'cpp' | 'java' | 'php' | 'py' | 'perl' | 'rb' 
|}}}[[BR]]
  {{{                     'cocoa' | 'csharp'}}}
  
- {{{XsdNamespace  ::=  'xsd_namespace' Literal}}}
+ {{{XsdNamespace    ::=  'xsd_namespace' Literal}}}
  
- {{{Definition    ::=  Const | Typedef | Enum | Senum | Struct | Xception | 
Service}}}
+ {{{Definition      ::=  Const | Typedef | Enum | Senum | Struct | Xception | 
Service}}}
  
- {{{Const         ::=}}}
+ {{{Const           ::=  'const' FieldType Identifier '=' ConstValue}}}
  
- {{{Typedef       ::=}}}
+ {{{Typedef         ::=  'typedef' DefinitionType Identifier}}}
  
- {{{Enum          ::=}}}
+ {{{Enum            ::=}}}
  
- {{{Senum         ::=}}}
+ {{{Senum           ::=}}}
  
- {{{Struct        ::=  'struct' Identifier XSDAll? '{' FieldList '}'}}}
+ {{{Struct          ::=  'struct' Identifier 'xsd_all'? '{' Field* '}'}}}
  
- {{{Xception      ::=}}}
+ {{{Xception        ::=  'exception' Identifier '{' Field* '}' }}}
  
- {{{Service       ::=  'service' Identifier ( 'extends' Identifier )? '{' 
FunctionList '}'}}}
+ {{{Service         ::=  'service' Identifier ( 'extends' Identifier )? '{' 
Function* '}'}}}
  
- {{{XSDAll        ::=}}}
+ {{{Field           ::=  FieldID? FieldReq? Identifier ('= ConstValue)? 
XsdFieldOptions}}}
  
- {{{FieldList     ::=}}}
+ {{{FieldID         ::=  IntConstant ':'}}}
  
- {{{FunctionList  ::=}}}
+ {{{XsdFieldOptions ::=  'xsd_optional'? 'xsd_nillable'? XsdAttrs?}}}
  
- {{{Literal       ::=  ('"' [^"]* '"') | ("'" [^']* "'")}}}
+ {{{XsdAttrs        ::=  'xsd_attrs' '{' Field* '}'}}}
  
- {{{Identifier    ::=  ( Letter | '_' ) ( Letter | Digit | '.' | '_' )*}}}
+ {{{FieldType       ::=  Identifier | BaseType | ContainerType}}}
  
- {{{STIdentifier  ::=  ( Letter | '_' ) ( Letter | Digit | '.' | '_' | '-' 
)*}}}
+ {{{FieldReq        ::=  'required' | 'optional'}}}
  
- {{{Letter        ::=  ['A'-'Z'] | ['a'-'z']}}}
+ {{{DefinitionType  ::=  BaseType | ContainerType}}}
  
+ {{{BaseType        ::=  'bool' | 'byte' | 'i16' | 'i32' | 'i64' | 'idouble' 
|}}}
+ {{{                    'string' | 'binary' | 'slist'}}}
+ 
+ {{{ContainerType   ::=  MapType | SetType | ListType}}}
+ 
+ {{{MapType         ::=  'map' CppType? '<' FieldType ',' FieldType '>'}}}
+ 
+ {{{SetType         ::=  'set' CppType? '<' FieldType '>'}}}
+ 
+ {{{ListType        ::=  'list' '<' FieldType '>' CppType?}}}
+ 
+ {{{CppType         ::=  'cpp_type' Literal}}}
+ 
+ {{{Function        ::=}}}
+ 
+ {{{FunctionType    ::=  FieldType | 'void'}}}
+ 
+ {{{ConstValue      ::=}}}
+ 
+ {{{IntConstant     ::=  ('+' | '-')? Digit+}}}
+ 
+ {{{Literal         ::=  ('"' [^"]* '"') | ("'" [^']* "'")}}}
+ 
+ {{{Identifier      ::=  ( Letter | '_' ) ( Letter | Digit | '.' | '_' )*}}}
+ 
+ {{{STIdentifier    ::=  ( Letter | '_' ) ( Letter | Digit | '.' | '_' | '-' 
)*}}}
+ 
+ {{{Letter          ::=  ['A'-'Z'] | ['a'-'z']}}}
+ 
- {{{Digit         ::=  ['0'-'9']}}}
+ {{{Digit           ::=  ['0'-'9']}}}
  
  = Examples =
  
@@ -66, +95 @@

  
  ''To be added''
  
+ 
+ = To Do/Questions =
+ 
+ What is 'slist'?
+ 
+ Why does CppType vary between SetType and ListType?
+ 
+ Why can't DefinitionType be the same as FieldType (ie: include Identifier)?
+ 

Reply via email to