|
Porytiles
|
Represents a parsed C enum declaration. More...
#include <enum_declaration.hpp>
Public Member Functions | |
| EnumDeclaration (std::vector< EnumMember > members, SourcePosition position) | |
| Constructs an anonymous enum declaration. | |
| EnumDeclaration (std::string name, std::vector< EnumMember > members, SourcePosition position) | |
| Constructs a named enum declaration. | |
| bool | has_name () const |
| Checks if this enum has a name. | |
| const std::optional< std::string > & | name () const |
| Returns the enum name if present. | |
| const std::vector< EnumMember > & | members () const |
| Returns the enum members. | |
| const SourcePosition & | position () const |
Returns the source position of the enum keyword. | |
Represents a parsed C enum declaration.
EnumDeclaration captures the complete structure of a C enum, including its optional name (anonymous enums have no name) and all its members. The original source position of the enum keyword is preserved for error reporting.
Example enums this class can represent:
Definition at line 25 of file enum_declaration.hpp.
|
inline |
Constructs an anonymous enum declaration.
| members | The enum members |
| position | The source position of the enum keyword |
Definition at line 33 of file enum_declaration.hpp.
|
inline |
Constructs a named enum declaration.
| name | The enum name |
| members | The enum members |
| position | The source position of the enum keyword |
Definition at line 45 of file enum_declaration.hpp.
|
inline |
Checks if this enum has a name.
Definition at line 55 of file enum_declaration.hpp.
|
inline |
Returns the enum members.
Definition at line 75 of file enum_declaration.hpp.
|
inline |
Returns the enum name if present.
Definition at line 65 of file enum_declaration.hpp.
|
inline |
Returns the source position of the enum keyword.
Definition at line 85 of file enum_declaration.hpp.