/********************************************************
       This file is meant to try every definition
    of the idl langage in order to test the idl parser
*********************************************************/

/************************/
/* First, try each rule */
/************************/

// Rule 0 : preprocessor
#include "testparser_include.idl"
#line 500
#line 14
#pragma toto

// Rule 1
const short const1 = 412;

// Rule 2
typedef long long1;
const short const2 = 2;
exception exception1 {};
interface interface1 {};
module module3 {const short const1 = 3;};
valuetype valuetype1 {};

// Rule 3
module module4 {const short const1 = 3;};
module module5 {const short const1 = 3;
		const short const2 = 3;};

// Rule 4
interface interface2;
interface interface2 {};

// Rule 5
interface interface3 {long echo_long (in long l);};

// Rule 6
interface interface4;
abstract interface interface5;
interface interface4 {};
abstract interface interface5 {};

// Rule 7
interface interface6 {};
abstract interface interface7 {};
interface interface8 : interface6 {};
abstract interface interface9 : interface7 {};

// Rule 8
interface interface10 {};
interface interface11 {long echo_long (in long l);};

// Rule 9
interface interface12 {
   typedef long long1;
   const short const2 = 2;
   exception exception1 {};
   attribute long attr1;
   long echo_long (in long l);
};

// Rule 10
interface interface13 : interface6 {};
interface interface14 : interface6, interface12 {};
interface interface15 : interface6, interface12, interface13 {};

// Rule 11
module module6 {
  interface inter {};
};
interface interface16 : ::module6::inter {};

// Rule 12
module module7 {
   typedef long type1;
};
typedef long type1;
typedef type1 type2;
typedef type2 type3;
typedef module7::type1 type4;
typedef ::module7::type1 type5;

// Rule 13
valuetype value1{};
abstract valuetype value2{};
valuetype value3 long;
valuetype value4;
valuetype value4{};

// Rule 14
valuetype value5;
valuetype value5{};
abstract valuetype value6;
abstract valuetype value6{};

// Rule 15
valuetype value7 long;

// Rule 16
abstract valuetype value8  {};
abstract valuetype value9  {const short a = 2;};
abstract valuetype value10  {const short a = 2;const short b = 2;};
abstract valuetype value11 : value6 {};
abstract valuetype value12 : value6 {const short a = 2;};
abstract valuetype value13 : value6 {const short a = 2;const short b = 2;};

// Rule 17
valuetype value14 {};
valuetype value15 {const short a = 2;};
valuetype value16 {const short a = 2;const short b = 2;};

// Rule 18
valuetype value17 {};
custom valuetype value18 {};
valuetype value19 : value17 {};
custom valuetype value20 : value19 {};

// Rule 19
valuetype value21 : value17 {};
valuetype value22 : value17, value8 {};
valuetype value23 : value17, value8, value9 {};
valuetype value24 : truncatable value17 {};
valuetype value25 : truncatable value17, value8 {};
valuetype value26 : truncatable value17, value8, value9 {};
valuetype value27 supports interface6 {};
valuetype value28 supports interface6, interface5 {};
valuetype value29 supports interface6, interface5, interface7 {};
valuetype value30 : value17 supports interface6 {};
valuetype value31 : value17 supports interface6, interface5 {};
valuetype value32 : value17 supports interface6, interface5, interface7 {};
valuetype value33 : truncatable value17 supports interface6 {};
valuetype value34 : truncatable value17 supports interface6, interface5 {};
valuetype value35 : truncatable value17 supports interface6, interface5, interface7 {};

// Rule 20
module module8 {
   valuetype value {};
};
valuetype value36 : ::module8::value {};

// Rule 21
valuetype value37 {
   const short a = 2;
   public long l;
   factory f();
};

// Rule 22
valuetype value38 {
   public long l;
   private short s;
};

// Rule 23
valuetype value39 {
   factory f();
   factory g(in short s);
};

// Rule 24
valuetype value40 {
   factory f(in short s);
   factory g(in short s, in long l);
};

// Rule 25
valuetype value41 {
   factory f(in short s);
};

// Rule 26
valuetype value42 {
   factory f(in short s);
};

// Rule 27
const short const3 = 3;

// Rule 28

const short const4 = 3;
const char const5 = 'd';
const wchar const6 = L'd';
const boolean const7 = TRUE;
const float const8 = 3.14;
const string const9 = "string";
const wstring const10 = L"wstring";
const fixed<5,3> const11 = 3.141d;
typedef long type6;
const type6 const12 = 5;
typedef type6 type7;
const type7 const13 = 5;
const octet const14 = 2;

// Rule 29
const short const15 = 5;

// Rule 30
const short const16 = 3 | 28;
const short const17 = 3 | 28 | 12;

// Rule 31
const short const18 = 3 ^ 28;
const short const19 = 3 ^ 28 ^ 12;

// Rule 32
const short const20 = 3 & 28;
const short const21 = 3 & 28 & 12;

// Rule 33
const long const22 = 345 << 8;
const long const23 = 345 << 2 << 6;
const short const24 = 345 >> 8;
const short const25 = 345 >> 2 >> 6;

// Rule 34
const short const26 = 345 + 8;
const short const27 = 345 + 2 + 6;
const short const28 = 345 - 8;
const short const29 = 345 - 2 - 6;
const short const30 = 345 - 2 + 6;
const short const31 = 345 + 2 - 6;

// Rule 35
const short const32 = 345 * 8;
const short const33 = 345 * 2 * 4;
const short const34 = 345 / 8;
const short const35 = 345 / 2 / 4;
const short const36 = 345 % 8;
const short const37 = 347 % 4 % 2;
const short const38 = 345 * 4 / 2;
const short const39 = 345 / 4 * 2;
const short const40 = 345 * 4 % 5;
const short const41 = 345 % 4 * 5;
const short const42 = 345 / 4 % 5;
const short const43 = 345 % 4 / 5;

// Rule 36
const short const44 = - 17;

// Rule 37
const short const45 = - 17;
const short const46 = + 17;
const short const47 = ~ 17;

// Rule 38
module module9 {
   const short c = 2;
};
const short const48 = ::module9::c;
const short const49 = module9::c;
const short const50 = 18;
const short const51 = ( 1 | 3 ^ 200 >> 3 & 7 << 2 + -7 - -11 * 13 / 15 % ~17);

// Rule 39
const short const52 = 12;
const short const53 = 014;
const short const54 = 0xC;
const string const55 = "a string";
const wstring const56 = L"a wide string";
const char const57 = 'r';
const char const58 = '\n';
const char const59 = '\60';
const char const60 = '\xab';
const wchar const61 = L'r';
const wchar const62 = L'\n';
const wchar const63 = L'\12';
const wchar const64 = L'\xab';
const wchar const65 = L'\uabc';
const fixed<5,3> const66 = 12d;
const fixed<3,1> const67 = 3.4d;
const float const68 = 1.45;
const float const69 = 5e3;
const float const70 = 3E4;
const boolean const71 = TRUE;

// Rule 40
const boolean const72 = TRUE;
const boolean const73 = FALSE;

// Rule 41
const fixed<4,2> const74 = 12d;

// Rule 42
typedef long type8;
struct struct1 { long l; };
union union1 switch (boolean) { default : long l; };
enum enum1 { e1, e2 };
native native1;

// Rule 43
typedef long type9;

// Rule 44
typedef long type10;
typedef enum enum2 { e3, e4 } type11;

// Rule 45
typedef long type12;
typedef string type13;
module module10 {
  typedef long type;
};
typedef type10 type14;
typedef module10::type type15;
typedef ::module10::type type16;

// Rule 46
typedef float type17;
typedef long type18;
typedef char type19;
typedef wchar type20;
typedef boolean type21;
typedef octet type22;
typedef any type23;
typedef Object type24;
typedef ValueBase type25;

// Rule 47
typedef sequence<long> type26;
typedef string type27;
typedef wstring type28;
typedef fixed<4,4> type29;

// Rule 48
typedef struct struct2 { long l; } type30;
typedef union union2 switch (boolean) { default : long l; } type31;
typedef enum enum3 { e5, e6 } type32;

// Rule 49
typedef long type33;
typedef long type34, type35;
typedef long type36, type37, type38;

// Rule 50
typedef long type39;
typedef long type40[5];

// Rule 51
typedef long type41;

// Rule 52
typedef long type42[5];

// Rule 53
typedef float type43;
typedef double type44;
typedef long double type45;

// Rule 54
typedef short type46;
typedef unsigned short type47;

// Rule 55
typedef short type48;
typedef long type49;
typedef long long type50;

// Rule 56
typedef short type51;

// Rule 57
typedef long type52;

// Rule 58
typedef long long type53;

// Rule 59
typedef unsigned short type54;
typedef unsigned long type55;
typedef unsigned long long type56;

// Rule 60
typedef unsigned short type57;

// Rule 61
typedef unsigned long type58;

// Rule 62
typedef unsigned long long type59;

// Rule 63
typedef char type60;

// Rule 64
typedef wchar type61;

// Rule 65
typedef boolean type62;

// Rule 66
typedef octet type63;

// Rule 67
typedef any type64;

// Rule 68
typedef Object type65;

// Rule 69
typedef struct struct3 { char c; } type66;

// Rule 70
struct struct4 { 
   char c; 
};
struct struct5 { 
   char c; 
   string s; 
};

// Rule 71
struct struct6 { 
   char c; 
};

// Rule 72
union union3 switch (boolean) {
  case TRUE : short s;
  default : long l; 
};

// Rule 73
union union4 switch (short) { 
  case 0 : short s;
  default : long l; 
};
union union5 switch (char) { 
  case 'c' : short s;
  default : long l; 
};
union union6 switch (boolean) { 
  case TRUE : short s;
  default : long l; 
};
union union7 switch (enum enum4 {e7, e8}) { 
  case e7 : short s;
  default : long l; 
};
module module11 {
  typedef boolean type;
};
union union8 switch (module11::type) { 
  case TRUE : short s;
  default : long l; 
};

// Rule 74
union union9 switch (short) { 
  case 0 : short s;
};
union union10 switch (short) { 
  case 0 : short r;
  case 1 : short s;
};
union union11 switch (short) { 
  case 0 : short r;
  case 1 : short s;
  case 2 : short t;
};
union union12 switch (short) { 
  default : short s;
};
union union13 switch (short) { 
  case 0 : short r;
  default : short s;
};
union union14 switch (short) { 
  case 0 : short r;
  case 1 : short s;
  default : short t;
};
union union15 switch (short) { 
  default : short r;
  case 1 : short s;
};

// Rule 75
union union16 switch (short) { 
  case 0 : short s;
};
union union17 switch (short) { 
  case 0 :
  case 1 : short s;
};
union union18 switch (short) { 
  case 0 :
  case 1 :
  case 2 : short s;
};

// Rule 76
union union19 switch (boolean) { 
  case TRUE : short s;
  default : long l; 
};

// Rule 77
union union20 switch (boolean) { 
  case TRUE : short s;
};

// Rule 78
enum enum5 { e9 };
enum enum6 { e10, e11 };
enum enum7 { e12, e13, e14 };

// Rule 79
enum enum8 { e15 };

// Rule 80
typedef sequence<long,5> type67;
typedef sequence<long> type68;

// Rule 81
typedef string<5> type69;
typedef string type70;

// Rule 82
typedef wstring<5> type71;
typedef wstring type72;

// Rule 83
typedef short type73[1];
typedef short type74[1][2];
typedef short type75[1][2][3];

// Rule 84
typedef short type76[17];

// Rule 85
interface interface17 {
  attribute short attribute1;
  readonly attribute long attribute2;
  attribute short attribute3, attribute4;
  readonly attribute boolean attribute5, attribute6;
  attribute short attribute7, attribute8, attribute9;
  readonly attribute float attribute10, attribute11, attribute12;  
};

// Rule 86
exception exception2 {};
exception exception3 { short s; };
exception exception4 { short s; long l; };

// Rule 87
interface interface18 {
  exception e{};
  long op1 ();
  oneway long op2 ();
  long op3 () raises (e);
  oneway long op4 () raises (e);
  long op5 () context ("context");
  oneway long op6 () context ("context");
  long op7 () raises (e) context ("context");
  oneway long op8 () raises (e) context ("context");
};

// Rule 88
interface interface19 {
  oneway long op1 ();
};

// Rule 89
interface interface20 {
  long op1 ();
  void op2 ();
};

// Rule 90
interface interface21 {
  long op1 ();
  long op2 (in short p1);
  long op3 (in short p1,out short p2);
  long op4 (in short p1,out short p2,inout short p3);
};

// Rule 91
interface interface22 {
  long op1 (in short p1);
};

// Rule 92
interface interface23 {
  long op1 (in short p1,out short p2,inout short p3);
};

// Rule 93
interface interface24 {
  exception e1 {};
  exception e2 {};
  exception e3 {};
  long op1 () raises (e1);
  long op2 () raises (e1,e2);
  long op3 () raises (e1,e2,e3);
};

// Rule 94
interface interface25 {
  long op1 () context ("c1");
  long op2 () context ("c1","c2");
  long op3 () context ("c1","c2","c3");
};

// Rule 95
module module12 {
  typedef long type;
};
interface interface26 {
  long op1 (in short p1);
  long op2 (in string p1);
  long op3 (in wstring p1);
  long op4 (in ::module12::type p1);
};

// Rule 96
const fixed<4,1> const75 = 12d;

// Rule 97
const fixed<4,1> const76 = 12d;

// Rule 98
typedef ValueBase type77;


/*******************************/
/* Now, try each miscellaneous */
/*  point of the Idl langage   */
/*******************************/

// scoped names
module moduleA {
  typedef short typeA;
  interface interfaceA {
    typedef long typeA;
    typedef moduleA::typeA typeB;
    typedef moduleA::interfaceA::typeA typeC;
  };
};

// sequences of sequences
typedef sequence<long> sequenceA;
typedef sequence<sequence<long> > sequenceB;
typedef sequence<sequence<long>> sequenceC;
typedef sequence<sequence<long,8>> sequenceD;
typedef sequence<sequence<long,8>>1>> sequenceE;
typedef sequence<sequence<long,8>>1>,5>>1> sequenceF;
typedef sequence<sequence<sequence<long>>> sequenceG;

// reopening of modules
module moduleB {
  const long constA = 0;
};
typedef short typeA;
module moduleB {
  typedef typeA typeB;
  const long constB = constA;
};

// native type as parameter of a function
interface interfaceA {
  native nativeA;
  void methodA (in nativeA argA);
};