<Id>@0xdbb9ad1f14bf0b36</Id><Separator Symbol>;</Separator Symbol><Normal Text>  </Normal Text><Comment># unique file ID, generated by `capnp id`</Comment><br/>
<Keyword>struct</Keyword><Normal Text> Foo </Normal Text><Id>@0x8db435604d0d3723</Id><Normal Text> </Normal Text><Block Symbol>{</Block Symbol><Normal Text> </Normal Text><Block Symbol>}</Block Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>struct</Keyword><Normal Text> Person </Normal Text><Block Symbol>{</Block Symbol><br/>
<Normal Text>  name </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Text</Built-in Type><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  birthdate </Normal Text><Id>@3</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Type>Date</Type><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  phones </Normal Text><Id>@2</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>List</Built-in Type><Type>(PhoneNumber)</Type><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>  </Normal Text><Keyword>struct</Keyword><Normal Text> PhoneNumber </Normal Text><Block Symbol>{</Block Symbol><br/>
<Normal Text>    type </Normal Text><Id>@1</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Type>Type</Type><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>    </Normal Text><Keyword>enum</Keyword><Normal Text> Type </Normal Text><Block Symbol>{</Block Symbol><br/>
<Normal Text>      mobile </Normal Text><Id>@0</Id><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>      home </Normal Text><Id>@1</Id><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>      work </Normal Text><Id>@2</Id><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>    </Normal Text><Block Symbol>}</Block Symbol><br/>
<Normal Text>  </Normal Text><Block Symbol>}</Block Symbol><br/>
<Block Symbol>}</Block Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>struct</Keyword><Normal Text> Dummy </Normal Text><Block Symbol>{</Block Symbol><br/>
<Normal Text>  byName </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Type>Map(</Type><Built-in Type>Text</Built-in Type><Type>, Person)</Type><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>  foo </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Int32</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><Number>123</Number><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  bar </Normal Text><Id>@1</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Text</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><String>"blah"</String><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  baz </Normal Text><Id>@2</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>List</Built-in Type><Type>(</Type><Built-in Type>Bool</Built-in Type><Type>) </Type><Field Assignement>=</Field Assignement><Value> </Value><Symbol>[</Symbol><Value> </Value><Constant>true</Constant><Separator Symbol>,</Separator Symbol><Value> </Value><Constant>false</Constant><Separator Symbol>,</Separator Symbol><Value> </Value><Constant>false</Constant><Separator Symbol>,</Separator Symbol><Value> </Value><Constant>true</Constant><Value> </Value><Symbol>]</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  qux </Normal Text><Id>@3</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Type>Person </Type><Field Assignement>=</Field Assignement><Value> </Value><Symbol>(</Symbol><Value>name </Value><Value Assignement>=</Value Assignement><Value> </Value><String>"Bob"</String><Separator Symbol>,</Separator Symbol><Value> email </Value><Value Assignement>=</Value Assignement><Value> </Value><String>"bob@example.com"</String><Symbol>)</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  corge </Normal Text><Id>@4</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Void</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> void</Value><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  grault </Normal Text><Id>@5</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Data</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><Number Prefix>0x</Number Prefix><String>"a1 40 33"</String><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>  </Normal Text><Keyword>union</Keyword><Normal Text> </Normal Text><Block Symbol>{</Block Symbol><br/>
<Normal Text>    circle </Normal Text><Id>@1</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Float64</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><Number>nan</Number><Separator Symbol>;</Separator Symbol><Normal Text>      </Normal Text><Comment># radius</Comment><br/>
<Normal Text>    square </Normal Text><Id>@2</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Float64</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><Number>12.23e+2</Number><Separator Symbol>;</Separator Symbol><Normal Text> </Normal Text><Comment># width</Comment><br/>
<Normal Text>  </Normal Text><Block Symbol>}</Block Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>  address </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>group</Built-in Type><Type> </Type><Block Symbol>{</Block Symbol><br/>
<Normal Text>    </Normal Text><Comment># Note:  This is a terrible way to use groups, and meant</Comment><br/>
<Normal Text>    </Normal Text><Comment>#        only to demonstrate the syntax.</Comment><br/>
<Normal Text>    houseNumber </Normal Text><Id>@8</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>UInt32</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><Number Prefix>0</Number Prefix><Number>123</Number><Error>8</Error><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>    city </Normal Text><Id>@10</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Text</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><String>"abc</String><String Char>\n</String Char><String>def</String><Error>\</Error><String>p</String><Error>\xa</Error><String>x</String><String Char>\xab</String Char><String>c"</String><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  </Normal Text><Block Symbol>}</Block Symbol><br/>
<Block Symbol>}</Block Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>const</Keyword><Normal Text> pi </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Float32</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><Number>3.14159</Number><Separator Symbol>;</Separator Symbol><br/>
<Keyword>const</Keyword><Normal Text> foo </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Int32</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><Number Prefix>0x</Number Prefix><Number>123</Number><Separator Symbol>;</Separator Symbol><br/>
<Keyword>const</Keyword><Normal Text> bar </Normal Text><Type Symbol>:</Type Symbol><Type>SomeStruct </Type><Field Assignement>=</Field Assignement><Value> </Value><Symbol>(</Symbol><Value>id </Value><Value Assignement>=</Value Assignement><Value> .foo</Value><Separator Symbol>,</Separator Symbol><Value> message </Value><Value Assignement>=</Value Assignement><Value> .bar</Value><Symbol>)</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>interface</Keyword><Normal Text> Directory </Normal Text><Keyword>extends</Keyword><Symbol>(</Symbol><Normal Text>Node</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Block Symbol>{</Block Symbol><br/>
<Normal Text>  list </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>list </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>List</Built-in Type><Type>(Entry)</Type><Symbol>)</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  create </Normal Text><Id>@1</Id><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>name </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Text</Built-in Type><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>file </Normal Text><Type Symbol>:</Type Symbol><Type>File</Type><Symbol>)</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  delete </Normal Text><Id>@4</Id><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>name </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Text</Built-in Type><Symbol>)</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  link </Normal Text><Id>@5</Id><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>name </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Text</Built-in Type><Separator Symbol>,</Separator Symbol><Normal Text> node </Normal Text><Type Symbol>:</Type Symbol><Type>Node</Type><Symbol>)</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  read </Normal Text><Id>@1</Id><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>startAt </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>UInt64</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><Number>0</Number><Separator Symbol>,</Separator Symbol><Normal Text> amount </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>UInt64</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><Number Prefix>0x</Number Prefix><Number>ffffffffffffffff</Number><Symbol>)</Symbol><br/>
<Normal Text>       </Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>data </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Data</Built-in Type><Symbol>)</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Block Symbol>}</Block Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>interface</Keyword><Normal Text> Assignable</Normal Text><Symbol>(</Symbol><Normal Text>T</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Block Symbol>{</Block Symbol><br/>
<Normal Text>  </Normal Text><Comment># A generic interface, with non-generic methods.</Comment><br/>
<Normal Text>  get </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>value </Normal Text><Type Symbol>:</Type Symbol><Type>T</Type><Symbol>)</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  set </Normal Text><Id>@1</Id><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>value </Normal Text><Type Symbol>:</Type Symbol><Type>T</Type><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Symbol>()</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Block Symbol>}</Block Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>interface</Keyword><Normal Text> AssignableFactory </Normal Text><Block Symbol>{</Block Symbol><br/>
<Normal Text>  newAssignable </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Symbol>[</Symbol><Normal Text>T</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>initialValue </Normal Text><Type Symbol>:</Type Symbol><Type>T</Type><Symbol>)</Symbol><br/>
<Normal Text>      </Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>assignable </Normal Text><Type Symbol>:</Type Symbol><Type>Assignable(T)</Type><Symbol>)</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  </Normal Text><Comment># A generic method.</Comment><br/>
<Block Symbol>}</Block Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>newUnsetAssignable </Normal Text><Id>@1</Id><Normal Text> </Normal Text><Symbol>[</Symbol><Normal Text>T</Normal Text><Symbol>]</Symbol><Normal Text> </Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>assignable </Normal Text><Type Symbol>:</Type Symbol><Type>Assignable(T)</Type><Symbol>)</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>getNamedAssignable </Normal Text><Id>@2</Id><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>name </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Text</Built-in Type><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>assignable </Normal Text><Type Symbol>:</Type Symbol><Type>Assignable</Type><Symbol>)</Symbol><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>struct</Keyword><Normal Text> Baz </Normal Text><Block Symbol>{</Block Symbol><br/>
<Normal Text>  bar </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Type>Foo.Bar</Type><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>  </Normal Text><Keyword>using</Keyword><Normal Text> Foo.Bar</Normal Text><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  bar </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Type>Bar</Type><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>  </Normal Text><Keyword>using</Keyword><Normal Text> T </Normal Text><Field Assignement>=</Field Assignement><Value> Foo.Bar</Value><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  bar </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Type>T</Type><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Normal Text>  baz </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Type>import </Type><String Type>"</String Type><Type>bar.capnp</Type><String Type>"</String Type><Type>.Baz</Type><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  </Normal Text><Comment># Use type "Baz" defined in bar.capnp.</Comment><br/>
<Block Symbol>}</Block Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>using</Keyword><Normal Text> Bar </Normal Text><Field Assignement>=</Field Assignement><Value> import </Value><String>"bar.capnp"</String><Separator Symbol>;</Separator Symbol><br/>
<Keyword>using</Keyword><Normal Text> </Normal Text><Keyword>import</Keyword><Normal Text> "bar.capnp".Baz</Normal Text><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>annotation</Keyword><Normal Text> foo</Normal Text><Symbol>(</Symbol><Keyword>struct</Keyword><Separator Symbol>,</Separator Symbol><Normal Text> </Normal Text><Keyword>enum</Keyword><Symbol>)</Symbol><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Text</Built-in Type><Separator Symbol>;</Separator Symbol><br/>
<Comment># Declare an annotation 'foo' which applies to struct and enum types.</Comment><br/>
<Normal Text></Normal Text><br/>
<Keyword>struct</Keyword><Normal Text> MyType </Normal Text><Annotation Symbol>$</Annotation Symbol><Annotation>foo(</Annotation><String Annotation>"</String Annotation><Annotation>bar</Annotation><String Annotation>"</String Annotation><Annotation>) </Annotation><Block Symbol>{</Block Symbol><br/>
<Normal Text>  </Normal Text><Comment># ...</Comment><br/>
<Block Symbol>}</Block Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>annotation</Keyword><Normal Text> baz</Normal Text><Symbol>(</Symbol><Normal Text>*</Normal Text><Symbol>)</Symbol><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Int32</Built-in Type><Separator Symbol>;</Separator Symbol><br/>
<Keyword>annotation</Keyword><Normal Text> myAnnotation</Normal Text><Symbol>(</Symbol><Keyword>struct</Keyword><Symbol>)</Symbol><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Int32</Built-in Type><Type> </Type><Annotation Symbol>$</Annotation Symbol><Annotation>baz(10)</Annotation><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Annotation Symbol>$</Annotation Symbol><Annotation>baz(1)</Annotation><Separator Symbol>;</Separator Symbol><Normal Text>  </Normal Text><Comment># Annotate the file.</Comment><br/>
<Normal Text></Normal Text><br/>
<Keyword>struct</Keyword><Normal Text> MyStruct </Normal Text><Annotation Symbol>$</Annotation Symbol><Annotation>baz(2) </Annotation><Block Symbol>{</Block Symbol><br/>
<Normal Text>  myField </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Text</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><String>"default"</String><Value> </Value><Annotation Symbol>$</Annotation Symbol><Annotation>baz(3)</Annotation><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  number </Normal Text><Id>@1</Id><Normal Text> </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Int32</Built-in Type><Type> </Type><Annotation Symbol>$</Annotation Symbol><Annotation>qux</Annotation><Separator Symbol>;</Separator Symbol><br/>
<Normal Text>  myUnion </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>union</Built-in Type><Type> </Type><Annotation Symbol>$</Annotation Symbol><Annotation>baz(4) </Annotation><Block Symbol>{</Block Symbol><br/>
<Normal Text>    </Normal Text><Comment># ...</Comment><br/>
<Normal Text>  </Normal Text><Block Symbol>}</Block Symbol><br/>
<Block Symbol>}</Block Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>interface</Keyword><Normal Text> MyInterface </Normal Text><Annotation Symbol>$</Annotation Symbol><Annotation>baz(7) </Annotation><Block Symbol>{</Block Symbol><br/>
<Normal Text>  myMethod </Normal Text><Id>@0</Id><Normal Text> </Normal Text><Symbol>(</Symbol><Normal Text>myParam </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Text</Built-in Type><Type> </Type><Annotation Symbol>$</Annotation Symbol><Annotation>baz(9)</Annotation><Symbol>)</Symbol><Normal Text> </Normal Text><Symbol>-></Symbol><Normal Text> </Normal Text><Symbol>()</Symbol><Normal Text> </Normal Text><Annotation Symbol>$</Annotation Symbol><Annotation>baz(8)</Annotation><Separator Symbol>;</Separator Symbol><br/>
<Block Symbol>}</Block Symbol><br/>
<Normal Text></Normal Text><br/>
<Keyword>const</Keyword><Normal Text> myConst </Normal Text><Type Symbol>:</Type Symbol><Built-in Type>Int32</Built-in Type><Type> </Type><Field Assignement>=</Field Assignement><Value> </Value><Number>123</Number><Value> </Value><Annotation Symbol>$</Annotation Symbol><Annotation>baz(11)</Annotation><Separator Symbol>;</Separator Symbol><br/>
<Normal Text></Normal Text><br/>
<Annotation Symbol>$</Annotation Symbol><Annotation>corge(string = </Annotation><String Annotation>"</String Annotation><Annotation>hello</Annotation><String Annotation>"</String Annotation><Annotation>, number = 123)</Annotation><Separator Symbol>;</Separator Symbol><br/>
<Annotation Symbol>$</Annotation Symbol><Annotation>grault()</Annotation><Separator Symbol>;</Separator Symbol><Normal Text>  </Normal Text><Comment># value defaults to 123</Comment><br/>
