|
OpenASIP 2.2
|
#include <AssemblerParser.hh>


Classes | |
| struct | definition |
Public Member Functions | |
| AssemblerParser (TPEF::Binary &aBin, const TTAMachine::Machine &aMach, AssemblyParserDiagnostic *parserDiagnostic, bool codeLinesOnly=false) | |
| AssemblerParser. | |
| bool | compile (const std::string &asmCode) const |
| void | finalize (bool littleEndian) const |
| void | cleanup () |
| UValue | errorLine () |
| bool | codeLinesOnly () const |
Private Attributes | |
| TPEF::Binary & | bin_ |
| TPEF where to program is compiled. | |
| MachineResourceManager | resourceManager_ |
| Generates string, resource, null and address space sections. | |
| DataSectionCreator | dataSectionCreator_ |
| Creates data sections. | |
| CodeSectionCreator | codeSectionCreator_ |
| Creates code section. | |
| LabelManager | labelManager_ |
| Creates symbol and relocation sections. | |
| ParserTemp | parserTemp_ |
| Temp-structure containing most recent parsed tokens. | |
| bool | codeLinesOnly_ = false |
| Controls start symbol of the grammar. False: the default symbol (program) for parsing assembly files. True: 'codeLines' symbol suitable for inline assembly parsing. | |
Definition at line 331 of file AssemblerParser.hh.
| AssemblerParser::AssemblerParser | ( | TPEF::Binary & | aBin, |
| const TTAMachine::Machine & | aMach, | ||
| AssemblyParserDiagnostic * | parserDiagnostic, | ||
| bool | codeLinesOnly = false |
||
| ) |
Grammar constructor.
| aBin | TPEF where to program is compiled. |
| aMach | Machine which for program is compiled. |
| parent | Error message manager of the compiler. |
| codeLinesOnly | If true start symbol for the grammar is 'codeLines'. The option is suitable for inline assembly parsing. Default is false. |
Constructor.
| aBin | TPEF object where to create program. |
| aMach | Machine which for program is written. |
| parserDiagnostic | Assembler root class for warning handling. |
Definition at line 231 of file AssemblerParser.cc.
| void AssemblerParser::cleanup | ( | ) |
Frees all resources allocated by parser.
Definition at line 247 of file AssemblerParser.cc.
References CodeSectionCreator::cleanup(), DataSectionCreator::cleanup(), LabelManager::cleanup(), codeSectionCreator_, dataSectionCreator_, and labelManager_.
Referenced by Assembler::compile().

|
inline |
Definition at line 938 of file AssemblerParser.hh.
References codeLinesOnly_.
Referenced by AssemblerParser::definition< ScannerT >::start().
| bool AssemblerParser::compile | ( | const std::string & | asmCode | ) | const |
Definition at line 254 of file AssemblerParser.cc.
Referenced by Assembler::compile(), and InlineAsmParser::parse().
| UValue AssemblerParser::errorLine | ( | ) |
Returns line number where parse error happened in assembler file.
Definition at line 268 of file AssemblerParser.cc.
References ParserTemp::lineNumber, and parserTemp_.
Referenced by Assembler::compile(), and InlineAsmParser::parse().
| void AssemblerParser::finalize | ( | bool | littleEndian | ) | const |
Finalizes parsed TPEF.
After calling this successfully parser should contain valid tpef.
Definition at line 278 of file AssemblerParser.cc.
References bin_, codeSectionCreator_, dataSectionCreator_, TPEF::Binary::FA_TTA_TUT, LabelManager::finalize(), CodeSectionCreator::finalize(), DataSectionCreator::finalize(), TPEF::Binary::FT_PARALLEL, labelManager_, TPEF::Binary::setArch(), and TPEF::Binary::setType().
Referenced by Assembler::compile(), and InlineAsmParser::parse().

|
private |
TPEF where to program is compiled.
Definition at line 943 of file AssemblerParser.hh.
Referenced by finalize().
|
private |
Controls start symbol of the grammar. False: the default symbol (program) for parsing assembly files. True: 'codeLines' symbol suitable for inline assembly parsing.
Definition at line 960 of file AssemblerParser.hh.
Referenced by codeLinesOnly().
|
mutableprivate |
Creates code section.
Definition at line 950 of file AssemblerParser.hh.
Referenced by cleanup(), AssemblerParser::definition< ScannerT >::definition(), and finalize().
|
mutableprivate |
Creates data sections.
Definition at line 948 of file AssemblerParser.hh.
Referenced by cleanup(), AssemblerParser::definition< ScannerT >::definition(), and finalize().
|
mutableprivate |
Creates symbol and relocation sections.
Definition at line 952 of file AssemblerParser.hh.
Referenced by cleanup(), AssemblerParser::definition< ScannerT >::definition(), and finalize().
|
mutableprivate |
Temp-structure containing most recent parsed tokens.
Definition at line 955 of file AssemblerParser.hh.
Referenced by AssemblerParser::definition< ScannerT >::definition(), and errorLine().
|
mutableprivate |
Generates string, resource, null and address space sections.
Definition at line 946 of file AssemblerParser.hh.
Referenced by AssemblerParser::definition< ScannerT >::definition().