Package edu.iu.jrsalata
Class StatementBuilder
java.lang.Object
edu.iu.jrsalata.AbstractStatementBuilder
edu.iu.jrsalata.StatementBuilder
The StatementBuilder class is responsible for processing SIC/XE assembly statements
and generating corresponding Statement objects based on the mnemonic and arguments.
It extends the AbstractStatementBuilder class and provides implementations for
handling different formats of statements, including macros and assembler directives.
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
The base address for the BASE directive, when it is setFields inherited from class edu.iu.jrsalata.AbstractStatementBuilder
absoluteExpressions, block, externalDefinitions, externalReferences, formatTable, instructionTable, line, lineNum, literals, locctrTable, name, referenceModifications, registerTable, startTable, statements
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected DirectiveStatement
handleAsmStatement
(String mnemonic, String args) Handles assembler directives and generates a corresponding DirectiveStatement object.void
processStatement
(String statement) Processes an assembly statement and generates a corresponding Statement object.Methods inherited from class edu.iu.jrsalata.AbstractStatementBuilder
addLocctr, addLocctr, addStatement, assembleLiterals, evaluateExpression, getExternalDefinitions, getExternalReferences, getLocctr, getLocctr, getName, getReferenceModifications, getStart, getStart, getStatements, getTotalLength, handleByte, handleExpression, handleLabels, handleLiteral, handleModification, loadInstructions, loadRegisters, setName, setStart, splitStatement
-
Field Details
-
base
The base address for the BASE directive, when it is set
-
-
Constructor Details
-
StatementBuilder
public StatementBuilder()Constructor for StatementBuilder. Initializes the StatementBuilder by calling the superclass constructor.
-
-
Method Details
-
processStatement
Processes an assembly statement and generates a corresponding Statement object.- Specified by:
processStatement
in classAbstractStatementBuilder
- Parameters:
statement
- The assembly statement to process.- Throws:
InvalidAssemblyFileException
- If the statement is invalid or contains errors.
-
handleAsmStatement
protected DirectiveStatement handleAsmStatement(String mnemonic, String args) throws InvalidAssemblyFileException Handles assembler directives and generates a corresponding DirectiveStatement object.- Overrides:
handleAsmStatement
in classAbstractStatementBuilder
- Parameters:
mnemonic
- The mnemonic of the assembler directive.args
- The arguments for the assembler directive.- Returns:
- The generated Statement object.
- Throws:
InvalidAssemblyFileException
- If the directive is invalid or contains errors.
-