diff --git a/autotests/folding/test.fbs.fold b/autotests/folding/test.fbs.fold new file mode 100644 index 0000000..5ec644e --- /dev/null +++ b/autotests/folding/test.fbs.fold @@ -0,0 +1,33 @@ +// Example IDL file for our monster's schema. + +namespace MyGame.Sample; + +enum Color:byte { Red = 0, Green, Blue = 2 } + +union Equipment { Weapon } // Optionally add more tables. + +struct Vec3 { + x:float; + y:float; + z:float; +} + +table Monster { + pos:Vec3; // Struct. + mana:short = 150; + hp:short = 100; + name:string; + friendly:bool = false (deprecated); + inventory:[ubyte]; // Vector of scalars. + color:Color = Blue; // Enum. + weapons:[Weapon]; // Vector of tables. + equipped:Equipment; // Union. + path:[Vec3]; // Vector of structs. +} + +table Weapon { + name:string; + damage:short; +} + +root_type Monster; diff --git a/autotests/html/test.fbs.html b/autotests/html/test.fbs.html new file mode 100644 index 0000000..d47ee6e --- /dev/null +++ b/autotests/html/test.fbs.html @@ -0,0 +1,40 @@ + + + +test.fbs + +
+// Example IDL file for our monster's schema.
+
+namespace MyGame.Sample;
+
+enum Color:byte { Red = 0, Green, Blue = 2 }
+
+union Equipment { Weapon } // Optionally add more tables.
+
+struct Vec3 {
+  x:float;
+  y:float;
+  z:float;
+}
+
+table Monster {
+  pos:Vec3; // Struct.
+  mana:short = 150;
+  hp:short = 100;
+  name:string;
+  friendly:bool = false (deprecated);
+  inventory:[ubyte];  // Vector of scalars.
+  color:Color = Blue; // Enum.
+  weapons:[Weapon];   // Vector of tables.
+  equipped:Equipment; // Union.
+  path:[Vec3];        // Vector of structs.
+}
+
+table Weapon {
+  name:string;
+  damage:short;
+}
+
+root_type Monster;
+
diff --git a/autotests/input/test.fbs b/autotests/input/test.fbs new file mode 100644 index 0000000..5ec644e --- /dev/null +++ b/autotests/input/test.fbs @@ -0,0 +1,33 @@ +// Example IDL file for our monster's schema. + +namespace MyGame.Sample; + +enum Color:byte { Red = 0, Green, Blue = 2 } + +union Equipment { Weapon } // Optionally add more tables. + +struct Vec3 { + x:float; + y:float; + z:float; +} + +table Monster { + pos:Vec3; // Struct. + mana:short = 150; + hp:short = 100; + name:string; + friendly:bool = false (deprecated); + inventory:[ubyte]; // Vector of scalars. + color:Color = Blue; // Enum. + weapons:[Weapon]; // Vector of tables. + equipped:Equipment; // Union. + path:[Vec3]; // Vector of structs. +} + +table Weapon { + name:string; + damage:short; +} + +root_type Monster; diff --git a/autotests/reference/test.fbs.ref b/autotests/reference/test.fbs.ref new file mode 100644 index 0000000..9a4112f --- /dev/null +++ b/autotests/reference/test.fbs.ref @@ -0,0 +1,33 @@ +// Example IDL file for our monster's schema.
+
+namespace MyGame.Sample;
+
+enum Color:byte { Red = 0, Green, Blue = 2 }
+
+union Equipment { Weapon } // Optionally add more tables.
+
+struct Vec3 {
+ x:float;
+ y:float;
+ z:float;
+}
+
+table Monster {
+ pos:Vec3; // Struct.
+ mana:short = 150;
+ hp:short = 100;
+ name:string;
+ friendly:bool = false (deprecated);
+ inventory:[ubyte]; // Vector of scalars.
+ color:Color = Blue; // Enum.
+ weapons:[Weapon]; // Vector of tables.
+ equipped:Equipment; // Union.
+ path:[Vec3]; // Vector of structs.
+}
+
+table Weapon {
+ name:string;
+ damage:short;
+}
+
+root_type Monster;
diff --git a/data/syntax/flatbuffers.xml b/data/syntax/flatbuffers.xml new file mode 100644 index 0000000..ae258ac --- /dev/null +++ b/data/syntax/flatbuffers.xml @@ -0,0 +1,114 @@ + + + + + + + namespace + attribute + table + struct + enum + union + rpc_service + root_type + include + file_identifier + file_extension + + + bool + byte + ubyte + short + ushort + int + uint + float + long + ulong + double + int8 + uint8 + int16 + uint16 + int32 + uint32 + int64 + uint64 + float32 + float64 + string + + + true + false + + + deprecated + required + key + hash + id + force_align + bit_flags + original_order + nested_flatbuffer + csharp_partial + streaming + idempotent + cpp_type + cpp_ptr_type + native_inline + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +