|
IDL compiler front-end library
|
The AST builder. More...
#include <Builder.h>
Public Member Functions | |
| const std::filesystem::path * | file () const noexcept |
| Currently parsed IDL file path. | |
| Location | location () const |
| bool | is_main_file () const noexcept |
| Test if currently parsed file is main. | |
| const std::string & | prefix () const |
| void | type_prefix (const ScopedName &name, const Variant &s, const Location &id_loc) |
Set repository id prefix for item. See the typeprefix IDL keyword. | |
| void | type_id (const ScopedName &name, const Variant &id, const Location &id_loc) |
Set repository id for item. See the typeid IDL keyword. | |
| void | pragma_version (const ScopedName &name, const Version &ver, const Location &loc) |
Set repository id version for item. See #pragma version. | |
| const Item * | cur_parent () const |
| void | native (const SimpleDeclarator &name) |
| Create native type. | |
| void | module_begin (const SimpleDeclarator &name) |
| Begin module. | |
| void | module_end () |
| End module. | |
| void | interface_decl (const SimpleDeclarator &name, InterfaceKind ik=InterfaceKind()) |
| Create interface forward declaration. | |
| void | interface_begin (const SimpleDeclarator &name, InterfaceKind ik=InterfaceKind()) |
| Begin interface definition. | |
| void | interface_bases (const ScopedNames &bases) |
| Set current interface bases. | |
| void | operation_begin (bool oneway, Type &&type, const SimpleDeclarator &name) |
| Begin operation definition for the current interface or valuetype. | |
| void | parameter (Parameter::Attribute att, Type &&type, const SimpleDeclarator &name) |
| Add parameter to the current operation. | |
| void | raises (const ScopedNames &names) |
| Set raises for the current operation. | |
| void | operation_context (const Variants &strings) |
| Set context for the current operation. | |
| void | operation_end () |
| End of the operation definition. | |
| void | attribute (bool readonly, Type &&type, const SimpleDeclarators &declarators) |
| Add attributes to the current interface or valuetype. | |
| void | attribute_begin (bool readonly, Type &&type, const SimpleDeclarator &name) |
| Begin attribute definition for the current interface or valuetype. | |
| void | getraises (const ScopedNames &names) |
| Set getraises for the current attribute. | |
| void | setraises (const ScopedNames &names) |
| Set setraises for the current attribute. | |
| void | attribute_end () |
| End of the attribute definition. | |
| void | interface_end () |
| End of the interface definition. | |
| void | type_def (Type &&type, const Declarators &declarators) |
| Create type alias. | |
| void | struct_decl (const SimpleDeclarator &name) |
| Create structure forward declaration. | |
| void | struct_begin (const SimpleDeclarator &name) |
| Begin of the structure definition. | |
| const NamedItem * | struct_end () |
| End of the structure definition. | |
| void | exception_begin (const SimpleDeclarator &name) |
| Begin of the exception definition. | |
| void | exception_end () |
| End of the exception definition. | |
| void | member (Type &&type, const Declarators &names) |
| Add members to the current structure or exception. | |
| void | union_decl (const SimpleDeclarator &name) |
| Create union forward declaration. | |
| void | union_begin (const SimpleDeclarator &name, const Type &switch_type, const Location &type_loc) |
| Begin of the union definition. | |
| void | union_label (const Variant &label, const Location &loc) |
| Create label for the current union. | |
| void | union_default (const Location &loc) |
| Create default label for the current union. | |
| void | union_element (Type &&type, const Declarator &decl) |
| Create union element for the current label. | |
| const NamedItem * | union_end () |
| End of the union definition. | |
| const NamedItem * | enum_type (const SimpleDeclarator &name, const SimpleDeclarators &items) |
| Create enum type. | |
| void | valuetype_decl (const SimpleDeclarator &name, bool is_abstract=false) |
| Create valuetype forward declaration. | |
| void | valuetype_begin (const SimpleDeclarator &name, ValueType::Modifier mod=ValueType::Modifier::NONE) |
| Begin valuetype definition. | |
| void | valuetype_bases (bool truncatable, const ScopedNames &bases) |
| Set current valuetype bases. | |
| void | valuetype_supports (const ScopedNames &interfaces) |
| Set current valuetype supported interfaces. | |
| void | state_member (bool is_public, Type &&type, const Declarators &names) |
| Add members to the current valuetype. | |
| void | valuetype_factory_begin (const SimpleDeclarator &name) |
| Begin valuetype factory. | |
| void | valuetype_factory_end () |
| End valuetype factory. | |
| void | valuetype_end () |
| End of the valuetype definition. | |
| void | valuetype_box (const SimpleDeclarator &name, Type &&type) |
| Create value box definition. | |
| void | constant (Type &&t, const SimpleDeclarator &name, Variant &&val, const Location &loc) |
| Create constant definition. | |
| void | constant (Type &&t, const SimpleDeclarator &name) |
| Create interface constant definition (Nirvana extension). | |
| Type | lookup_type (const ScopedName &scoped_name) |
| Find type by name. | |
Additional Inherited Members | |
| Message types. More... | |
| Location AST::Builder::location | ( | ) | const |
|
inlinenoexcept |
| const std::string & AST::Builder::prefix | ( | ) | const |
typeprefix IDL keyword. | void AST::Builder::type_prefix | ( | const ScopedName & | name, |
| const Variant & | s, | ||
| const Location & | id_loc | ||
| ) |
Set repository id prefix for item. See the typeprefix IDL keyword.
| name | Item name. |
| s | Prefix string. |
| id_loc | typeprefix location. |
|
inline |
|
inline |
| const Item * AST::Builder::cur_parent | ( | ) | const |
nullptr if parent item is invalid. | void AST::Builder::native | ( | const SimpleDeclarator & | name | ) |
Create native type.
| name | Native type name. |
| void AST::Builder::module_begin | ( | const SimpleDeclarator & | name | ) |
| void AST::Builder::interface_decl | ( | const SimpleDeclarator & | name, |
| InterfaceKind | ik = InterfaceKind() |
||
| ) |
Create interface forward declaration.
| name | The interface name. |
| ik | The interface kind. |
| void AST::Builder::interface_begin | ( | const SimpleDeclarator & | name, |
| InterfaceKind | ik = InterfaceKind() |
||
| ) |
Begin interface definition.
| name | The interface name. |
| ik | The interface kind. |
| void AST::Builder::interface_bases | ( | const ScopedNames & | bases | ) |
Set current interface bases.
| bases | Base names. |
| void AST::Builder::operation_begin | ( | bool | oneway, |
| Type && | type, | ||
| const SimpleDeclarator & | name | ||
| ) |
Begin operation definition for the current interface or valuetype.
| oneway | true for oneway operations. |
| type | Return type. |
| name | The operation name. |
| void AST::Builder::parameter | ( | Parameter::Attribute | att, |
| Type && | type, | ||
| const SimpleDeclarator & | name | ||
| ) |
Add parameter to the current operation.
| att | The parameter attribute. |
| type | The parameter type. |
| name | The parameter name. |
| void AST::Builder::raises | ( | const ScopedNames & | names | ) |
Set raises for the current operation.
| names | Exception names. |
| void AST::Builder::operation_context | ( | const Variants & | strings | ) |
Set context for the current operation.
| strings | Context strings. |
| void AST::Builder::attribute | ( | bool | readonly, |
| Type && | type, | ||
| const SimpleDeclarators & | declarators | ||
| ) |
Add attributes to the current interface or valuetype.
| readonly | true if attributes are read-only. |
| type | The attributes type. |
| declarators | The attribute names. |
| void AST::Builder::attribute_begin | ( | bool | readonly, |
| Type && | type, | ||
| const SimpleDeclarator & | name | ||
| ) |
Begin attribute definition for the current interface or valuetype.
| readonly | true if attribute is read-only. |
| type | The attribute type. |
| name | The attribute name. |
| void AST::Builder::getraises | ( | const ScopedNames & | names | ) |
Set getraises for the current attribute.
| names | Exception names. |
| void AST::Builder::setraises | ( | const ScopedNames & | names | ) |
Set setraises for the current attribute.
| names | Exception names. |
| void AST::Builder::type_def | ( | Type && | type, |
| const Declarators & | declarators | ||
| ) |
Create type alias.
| type | The type. |
| declarators | Type aliases. |
| void AST::Builder::struct_decl | ( | const SimpleDeclarator & | name | ) |
Create structure forward declaration.
| name | The structure name. |
| void AST::Builder::struct_begin | ( | const SimpleDeclarator & | name | ) |
Begin of the structure definition.
| name | The structure name. |
|
inline |
| void AST::Builder::exception_begin | ( | const SimpleDeclarator & | name | ) |
Begin of the exception definition.
| name | The exception name. |
| void AST::Builder::member | ( | Type && | type, |
| const Declarators & | names | ||
| ) |
Add members to the current structure or exception.
| type | The members type. |
| names | The member names. |
| void AST::Builder::union_decl | ( | const SimpleDeclarator & | name | ) |
Create union forward declaration.
| name | The union name. |
| void AST::Builder::union_begin | ( | const SimpleDeclarator & | name, |
| const Type & | switch_type, | ||
| const Location & | type_loc | ||
| ) |
Begin of the union definition.
| name | The union name. |
| switch_type | The union discriminator type. |
| type_loc | Discriminator type location. |
Create label for the current union.
| label | The constant. |
| loc | The label location. |
| void AST::Builder::union_default | ( | const Location & | loc | ) |
Create default label for the current union.
| loc | The label location. |
| void AST::Builder::union_element | ( | Type && | type, |
| const Declarator & | decl | ||
| ) |
Create union element for the current label.
| type | The element type. |
| decl | The element name. |
| const NamedItem * AST::Builder::union_end | ( | ) |
End of the union definition.
| const NamedItem * AST::Builder::enum_type | ( | const SimpleDeclarator & | name, |
| const SimpleDeclarators & | items | ||
| ) |
Create enum type.
| name | The enum type name. |
| items | The enum items. |
| void AST::Builder::valuetype_decl | ( | const SimpleDeclarator & | name, |
| bool | is_abstract = false |
||
| ) |
Create valuetype forward declaration.
| name | The valuetype name. |
| is_abstract | true for abstract valuetype. |
| void AST::Builder::valuetype_begin | ( | const SimpleDeclarator & | name, |
| ValueType::Modifier | mod = ValueType::Modifier::NONE |
||
| ) |
Begin valuetype definition.
| name | The valuetype name. |
| mod | The valuetype modifier. |
| void AST::Builder::valuetype_bases | ( | bool | truncatable, |
| const ScopedNames & | bases | ||
| ) |
Set current valuetype bases.
| truncatable | true if valuetype is truncatable. |
| bases | Base names. |
| void AST::Builder::valuetype_supports | ( | const ScopedNames & | interfaces | ) |
Set current valuetype supported interfaces.
| interfaces | Supported interface names. |
| void AST::Builder::state_member | ( | bool | is_public, |
| Type && | type, | ||
| const Declarators & | names | ||
| ) |
Add members to the current valuetype.
| is_public | true for public members. |
| type | The members type. |
| names | The member names. |
| void AST::Builder::valuetype_factory_begin | ( | const SimpleDeclarator & | name | ) |
Begin valuetype factory.
| name | The valuetype factory name. |
|
inline |
| void AST::Builder::valuetype_box | ( | const SimpleDeclarator & | name, |
| Type && | type | ||
| ) |
Create value box definition.
| name | The value box name. |
| type | Boxed type. |
| void AST::Builder::constant | ( | Type && | t, |
| const SimpleDeclarator & | name, | ||
| Variant && | val, | ||
| const Location & | loc | ||
| ) |
Create constant definition.
| t | The constant type. |
| name | The constant name. |
| val | The constant value. |
| loc | The constant value location. |
| void AST::Builder::constant | ( | Type && | t, |
| const SimpleDeclarator & | name | ||
| ) |
Create interface constant definition (Nirvana extension).
| t | The constant type. |
| name | The constant name. |
| Type AST::Builder::lookup_type | ( | const ScopedName & | scoped_name | ) |