74 lines
1.8 KiB
Plaintext
74 lines
1.8 KiB
Plaintext
================================================================================
|
|
Simple Structure
|
|
================================================================================
|
|
|
|
struct Foo {
|
|
x <int>
|
|
y <float>
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(statement_kind
|
|
(type_definition
|
|
(struct_definition
|
|
(identifier)
|
|
(identifier)
|
|
(type_specification
|
|
(type))
|
|
(identifier)
|
|
(type_specification
|
|
(type)))))))
|
|
|
|
================================================================================
|
|
Nested Structure
|
|
================================================================================
|
|
|
|
struct Foo {
|
|
x <int>
|
|
y <float> = 0.0
|
|
|
|
bar <Bar> = new Bar {
|
|
baz = 42
|
|
}
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(statement_kind
|
|
(type_definition
|
|
(struct_definition
|
|
(identifier)
|
|
(identifier)
|
|
(type_specification
|
|
(type))
|
|
(identifier)
|
|
(type_specification
|
|
(type))
|
|
(statement
|
|
(statement_kind
|
|
(expression
|
|
(value
|
|
(float)))))
|
|
(identifier)
|
|
(type_specification
|
|
(type
|
|
(identifier)))
|
|
(statement
|
|
(statement_kind
|
|
(expression
|
|
(value
|
|
(struct_instance
|
|
(identifier)
|
|
(map
|
|
(identifier)
|
|
(statement
|
|
(statement_kind
|
|
(expression
|
|
(value
|
|
(integer))))))))))))))))
|