|
Porytiles
|
Represents a parsed C struct variable declaration with its initializer fields. More...
#include <struct_initializer_declaration.hpp>
Public Member Functions | |
| StructInitializerDeclaration (std::string struct_type, std::string variable_name, std::vector< DesignatedInitializerField > fields, SourcePosition position) | |
| Constructs a StructInitializerDeclaration. | |
| const std::string & | struct_type () const |
| Returns the struct type name. | |
| const std::string & | variable_name () const |
| Returns the variable name. | |
| const std::vector< DesignatedInitializerField > & | fields () const |
| Returns all designated initializer fields. | |
| const SourcePosition & | position () const |
| Returns the source position of the variable name. | |
| std::optional< std::string > | field_value (const std::string &field_name) const |
| Looks up the value of a field by name. | |
Represents a parsed C struct variable declaration with its initializer fields.
StructInitializerDeclaration captures the full structure of C struct variable declarations including the designated initializer fields:
This extends StructVariableDeclaration by also parsing and storing the initializer fields, enabling extraction of tileset metadata like isSecondary and variable references.
Definition at line 37 of file struct_initializer_declaration.hpp.
|
inline |
Constructs a StructInitializerDeclaration.
| struct_type | The struct type name (e.g., "Tileset") |
| variable_name | The variable name (e.g., "gTileset_General") |
| fields | The designated initializer fields |
| position | The source position of the variable name |
Definition at line 47 of file struct_initializer_declaration.hpp.
|
inline |
Looks up the value of a field by name.
| field_name | The name of the field to look up |
Definition at line 103 of file struct_initializer_declaration.hpp.
|
inline |
Returns all designated initializer fields.
Definition at line 82 of file struct_initializer_declaration.hpp.
|
inline |
Returns the source position of the variable name.
Definition at line 92 of file struct_initializer_declaration.hpp.
|
inline |
Returns the struct type name.
Definition at line 62 of file struct_initializer_declaration.hpp.
|
inline |
Returns the variable name.
Definition at line 72 of file struct_initializer_declaration.hpp.