BodyParser
class BodyParser
This class parses object and macro bodies.
class IfNestingprivate
method add_clause
| void add_clause | ( | Expression condition | ); |
| PARAMETER | DESCRIPTION |
|---|---|
condition |
method body
| Body body | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Body |
method operator[]
| Body * operator[] | ( | size_t index | ); |
| PARAMETER | DESCRIPTION |
|---|---|
index |
| RETURNS | DESCRIPTION |
|---|---|
Body * |
method sizeconst
| size_t size | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
size_t |
member clausesprivate
class Nestingprivate
destructor ~Nestingvirtual
| virtual ~Nesting | ( | ); |
method as
| T * as | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
T * |
method asconst
| const T * as | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
const T * |
method bodyvirtual
| virtual Body body | ( | ) | = 0; |
| RETURNS | DESCRIPTION |
|---|---|
Body |
method isconst
| bool is | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method operator[]virtual
| virtual Body * operator[] | ( | size_t index | ) | = 0; |
| PARAMETER | DESCRIPTION |
|---|---|
index |
| RETURNS | DESCRIPTION |
|---|---|
Body * |
class NestingIndexprivate
constructor NestingIndex
| NestingIndex | ( | size_t nesting_index, | |
| size_t sub_index | ); |
| PARAMETER | DESCRIPTION |
|---|---|
nesting_index |
|
sub_index |
member nesting_index
member sub_index
class RepeatNestingprivate
constructor RepeatNesting
| RepeatNesting | ( | Symbol variable, | |
| Location variable_location, | |||
| std::optional< Expression > start, | |||
| Expression end, | |||
| std::shared_ptr< Scope > containing_scope | ); |
| PARAMETER | DESCRIPTION |
|---|---|
variable |
|
variable_location |
|
start |
|
end |
|
containing_scope |
method body
| Body body | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Body |
method operator[]
| Body * operator[] | ( | size_t index | ); |
| PARAMETER | DESCRIPTION |
|---|---|
index |
| RETURNS | DESCRIPTION |
|---|---|
Body * |
member containing_scopeprivate
member endprivate
member inner_bodyprivate
member startprivate
member variableprivate
member variable_locationprivate
class ScopeNestingprivate
method body
| Body body | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Body |
method operator[]
| Body * operator[] | ( | size_t index | ); |
| PARAMETER | DESCRIPTION |
|---|---|
index |
| RETURNS | DESCRIPTION |
|---|---|
Body * |
member inner_body
enum ParsingType
Type of body being parsed.
| VALUE | DESCRIPTION |
|---|---|
ENTITY |
Parsing a macro or object from source. |
OUTPUT |
Parsing |
STRUCTURED_VALUE |
Parsing body in StructuredValue from object file. |
constructor BodyParser
Constructs a BodyParser for parsing an entity or output.
If allow_assigns is true, it will parse an entity (macro or object) and allow assignments. If false, it will parse an output section.
| BodyParser | ( | Tokenizer & tokenizer, | |
| const CPU * cpu, | |||
| std::shared_ptr< Scope > environment, | |||
| bool allow_assigns | ); |
| PARAMETER | DESCRIPTION |
|---|---|
tokenizer |
The tokenizer to parse the entity or output from. |
cpu |
The CPU context. |
environment |
The environment the body is in. |
allow_assigns |
Whether assignments are allowed. |
constructor BodyParser
Constructs a BodyParser for parsing a StructuredValue.
| BodyParser | ( | Tokenizer & tokenizer, | |
| std::shared_ptr< Scope > environment | ); |
| PARAMETER | DESCRIPTION |
|---|---|
tokenizer |
The tokenizer to parse the StructuredValue from. |
environment |
The environment the body is in. |
method add_constantprivate
| void add_constant | ( | Visibility visibility, | |
| const Token & name, | |||
| const Expression & value | ); |
| PARAMETER | DESCRIPTION |
|---|---|
visibility |
|
name |
|
value |
method allow_assignmentconst private
| bool allow_assignment | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method allow_instructionsconst private
| bool allow_instructions | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method allow_memoryconst private
| bool allow_memory | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method current_sizeprivate
| SizeRange current_size | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
SizeRange |
method get_bodyconst private
| Body * get_body | ( | const NestingIndex & nesting_index | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
nesting_index |
| RETURNS | DESCRIPTION |
|---|---|
Body * |
method get_labelconst private
| Expression get_label | ( | const Location & location, | |
| Symbol name | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
location |
|
name |
| RETURNS | DESCRIPTION |
|---|---|
Expression |
method get_pc_labelprivate
| Expression get_pc_label | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Expression |
method handle_nameprivate
| void handle_name | ( | Visibility visibility, | |
| const Token & name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
visibility |
|
name |
method is_definedconst private
| bool is_defined | ( | Symbol symbol | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
symbol |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method is_definedconst private
| bool is_defined | ( | const Token & token | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
token |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method parse
Parses the body from the tokenizer.
| Body parse | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Body |
The parsed body. |
method parse_assignmentprivate
| void parse_assignment | ( | Visibility visibility, | |
| const Token & name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
visibility |
|
name |
method parse_binary_fileprivate
| void parse_binary_file | ( | ); |
method parse_checksumprivate
| void parse_checksum | ( | ); |
method parse_dataprivate
| void parse_data | ( | ); |
method parse_directiveprivate
| void parse_directive | ( | const Token & directive | ); |
| PARAMETER | DESCRIPTION |
|---|---|
directive |
method parse_elseprivate
| void parse_else | ( | ); |
method parse_else_ifprivate
| void parse_else_if | ( | ); |
method parse_errorprivate
| void parse_error | ( | ); |
method parse_ifprivate
| void parse_if | ( | ); |
method parse_instructionprivate
| void parse_instruction | ( | const Token & name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
name |
method parse_instruction_argumentprivate
| std::shared_ptr< Node > parse_instruction_argument | ( | const Token & token | ); |
| PARAMETER | DESCRIPTION |
|---|---|
token |
| RETURNS | DESCRIPTION |
|---|---|
std::shared_ptr< Node > |
method parse_labelprivate
| void parse_label | ( | Visibility visibility, | |
| const Token & name | ); |
| PARAMETER | DESCRIPTION |
|---|---|
visibility |
|
name |
method parse_memoryprivate
| void parse_memory | ( | ); |
method parse_repeatprivate
| void parse_repeat | ( | ); |
method parse_scopeprivate
| void parse_scope | ( | ); |
method parse_unnamed_labelprivate
| void parse_unnamed_label | ( | ); |
method pop_bodyprivate
| void pop_body | ( | ); |
method push_bodyprivate
| void push_body | ( | const NestingIndex & body_index | ); |
| PARAMETER | DESCRIPTION |
|---|---|
body_index |
method push_clauseprivate
| void push_clause | ( | Expression condition | ); |
| PARAMETER | DESCRIPTION |
|---|---|
condition |
method setupstatic
Sets up the FileTokenizer for parsing bodies.
| static void setup | ( | FileTokenizer & tokenizer | ); |
| PARAMETER | DESCRIPTION |
|---|---|
tokenizer |
The FileTokenizer to set up. |
member bodyprivate
member cpuprivate
member current_bodyprivate
member directive_parser_methodsstatic private
member end_tokenprivate
member environmentprivate
member nestingprivate
member nesting_indicesprivate
member next_labelprivate
member parsing_typeprivate
member symbol_pcstatic private
member token_binary_filestatic private
member token_checksumstatic private
member token_datastatic private
member token_elsestatic private
member token_else_ifstatic private
member token_endstatic private
member token_errorstatic private
member token_ifstatic private
member token_lengthstatic private
member token_memorystatic private
member token_repeatstatic private
member token_scopestatic private
member token_startstatic private
member tokenizerprivate
class IfNestingprivate
method add_clause
| void add_clause | ( | Expression condition | ); |
| PARAMETER | DESCRIPTION |
|---|---|
condition |
method body
| Body body | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Body |
method operator[]
| Body * operator[] | ( | size_t index | ); |
| PARAMETER | DESCRIPTION |
|---|---|
index |
| RETURNS | DESCRIPTION |
|---|---|
Body * |
method sizeconst
| size_t size | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
size_t |
member clausesprivate
class Nestingprivate
destructor ~Nestingvirtual
| virtual ~Nesting | ( | ); |
method as
| T * as | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
T * |
method asconst
| const T * as | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
const T * |
method bodyvirtual
| virtual Body body | ( | ) | = 0; |
| RETURNS | DESCRIPTION |
|---|---|
Body |
method isconst
| bool is | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
bool |
method operator[]virtual
| virtual Body * operator[] | ( | size_t index | ) | = 0; |
| PARAMETER | DESCRIPTION |
|---|---|
index |
| RETURNS | DESCRIPTION |
|---|---|
Body * |
class NestingIndexprivate
constructor NestingIndex
| NestingIndex | ( | size_t nesting_index, | |
| size_t sub_index | ); |
| PARAMETER | DESCRIPTION |
|---|---|
nesting_index |
|
sub_index |
member nesting_index
member sub_index
class RepeatNestingprivate
constructor RepeatNesting
| RepeatNesting | ( | Symbol variable, | |
| Location variable_location, | |||
| std::optional< Expression > start, | |||
| Expression end, | |||
| std::shared_ptr< Scope > containing_scope | ); |
| PARAMETER | DESCRIPTION |
|---|---|
variable |
|
variable_location |
|
start |
|
end |
|
containing_scope |
method body
| Body body | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Body |
method operator[]
| Body * operator[] | ( | size_t index | ); |
| PARAMETER | DESCRIPTION |
|---|---|
index |
| RETURNS | DESCRIPTION |
|---|---|
Body * |
member containing_scopeprivate
member endprivate
member inner_bodyprivate
member startprivate
member variableprivate
member variable_locationprivate
class ScopeNestingprivate
method body
| Body body | ( | ); |
| RETURNS | DESCRIPTION |
|---|---|
Body |
method operator[]
| Body * operator[] | ( | size_t index | ); |
| PARAMETER | DESCRIPTION |
|---|---|
index |
| RETURNS | DESCRIPTION |
|---|---|
Body * |