struct Element

Defined at line 59 of file ../../tools/fidl/fidlc/src/flat_ast.h

Public Members

Kind kind
unique_ptr attributes
Availability availability

Public Methods

void Element (const Element & )

Defined at line 91 of file ../../tools/fidl/fidlc/src/flat_ast.h

void Element (Element && )

Defined at line 92 of file ../../tools/fidl/fidlc/src/flat_ast.h

Element & operator= (Element && )

Defined at line 93 of file ../../tools/fidl/fidlc/src/flat_ast.h

void ~Element ()

Defined at line 94 of file ../../tools/fidl/fidlc/src/flat_ast.h

void Element (Kind kind, std::unique_ptr<AttributeList> attributes)

Defined at line 96 of file ../../tools/fidl/fidlc/src/flat_ast.h

bool IsDecl ()

Returns true if this element is a decl.

Decl * AsDecl ()

Asserts that this element is a decl.

ModifierList * GetModifiers ()

Returns the element's modifiers, or null if it has none.

void ForEachModifier (const fit::function<void (Modifier *)> & fn)

Runs a function on every modifier of the element, if it has any.

bool IsAnonymousLayout ()

Returns true if this is an anonymous layout (i.e. a layout not

directly bound to a type declaration as in `type Foo = struct { ... };`).

std::string_view GetName ()

Returns the element's unqualified name, e.g. "MyProtocol" or "MyMethod".

SourceSpan GetNameSource ()

Returns the source where GetName() comes from, to use in error messages.

Its contents are different from GetName() is the case of anonymous layouts.

std::optional<AbiKind> abi_kind ()

Returns the element's ABI kind, if it has one.

std::optional<AbiValue> abi_value ()

Returns the element's ABI value, if it has one.

Enumerations

enum class Kind : uint8_t
Name Value Comments
kLibrary 0

Special

kModifier 1

Special

kAlias 2

Decls

kBits 3

Decls

kBuiltin 4

Decls

kConst 5

Decls

kEnum 6

Decls

kNewType 7

Decls

kOverlay 8

Decls

kProtocol 9

Decls

kResource 10

Decls

kService 11

Decls

kStruct 12

Decls

kTable 13

Decls

kUnion 14

Decls

kBitsMember 15

Members

kEnumMember 16

Members

kOverlayMember 17

Members

kProtocolCompose 18

Members

kProtocolMethod 19

Members

kResourceProperty 20

Members

kServiceMember 21

Members

kStructMember 22

Members

kTableMember 23

Members

kUnionMember 24

Members

Defined at line 60 of file ../../tools/fidl/fidlc/src/flat_ast.h