C-Breeze
C Compiler Infrastructure

[ Project home page]
Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

arch_info_parser Class Reference

#include <arch_info_parser.h>

List of all members.

Public Member Functions

 arch_info_parser ()
 ~arch_info_parser ()
bool parse (const char *pFile, arch_info *pArchInfo)

Private Types

typedef arch_info::register_info
*arch_info::* 
reg_info_ptr
typedef arch_info::register_info_list
arch_info::* 
reg_info_list_ptr
typedef string arch_info::* string_ptr
typedef int arch_info::* int_ptr
typedef bool arch_info::* bool_ptr
typedef typeNode *arch_info::* vartype_ptr
typedef arch_info::Lir2Asm_list
arch_info::* 
Lir2Asm_list_ptr
typedef vector< thing_to_parsething_to_parse_array
typedef map< string, mnemonicmnemonic_map
typedef map< string, typeNode * > vartype_map
enum  parse_type {
  type__unknown, type_reg, type_reg_list, type_string,
  type_integer, type_boolean, type_vartype, type_Lir2Asm
}
enum  char_class { WS, LINEBREAK, ALPHANUM, SPECIAL }

Private Member Functions

void init_parser ()
char get_char (bool skipWhitespace=false)
char peek_char (bool skipWhitespace=false)
char do_getc ()
void do_ungetc (char)
bool read_string (string &stringOut, bool readAnyChars=false, bool skipLeadingNewlines=false)
bool parse_reg_item (string keyName, reg_info_ptr toRead)
bool parse_reg_list_item (string keyName, reg_info_list_ptr toRead, bool isMasterList=false, bool allowTokens=false)
bool parse_string_item (string keyName, string_ptr toRead)
bool parse_integer_item (string keyName, int_ptr toRead)
bool parse_bool_item (string keyName, bool_ptr toRead)
bool parse_vartype_item (string keyName, vartype_ptr toRead)
bool parse_Lir2Asm_item (string keyName, Lir2Asm_list_ptr toAppend)

Private Attributes

thing_to_parse_array _thingsToParse
bool _initialized
arch_info_pArchInfo
FILE * _pSpecFile
int _currentLine
int _lastChar
bool _wasNewLine
char_class _charClass [256]
mnemonic_map _mnemonicMap
vartype_map _varTypeMap


Member Typedef Documentation

typedef bool arch_info::* arch_info_parser::bool_ptr [private]
 

Definition at line 101 of file arch_info_parser.h.

typedef int arch_info::* arch_info_parser::int_ptr [private]
 

Definition at line 100 of file arch_info_parser.h.

typedef arch_info::Lir2Asm_list arch_info::* arch_info_parser::Lir2Asm_list_ptr [private]
 

Definition at line 103 of file arch_info_parser.h.

typedef map<string, mnemonic> arch_info_parser::mnemonic_map [private]
 

Definition at line 225 of file arch_info_parser.h.

typedef arch_info::register_info_list arch_info::* arch_info_parser::reg_info_list_ptr [private]
 

Definition at line 98 of file arch_info_parser.h.

typedef arch_info::register_info* arch_info::* arch_info_parser::reg_info_ptr [private]
 

Definition at line 97 of file arch_info_parser.h.

typedef string arch_info::* arch_info_parser::string_ptr [private]
 

Definition at line 99 of file arch_info_parser.h.

typedef vector<thing_to_parse> arch_info_parser::thing_to_parse_array [private]
 

Definition at line 195 of file arch_info_parser.h.

typedef map<string, typeNode *> arch_info_parser::vartype_map [private]
 

Definition at line 229 of file arch_info_parser.h.

typedef typeNode* arch_info::* arch_info_parser::vartype_ptr [private]
 

Definition at line 102 of file arch_info_parser.h.


Member Enumeration Documentation

enum arch_info_parser::char_class [private]
 

Enumeration values:
WS 
LINEBREAK 
ALPHANUM 
SPECIAL 

Definition at line 221 of file arch_info_parser.h.

enum arch_info_parser::parse_type [private]
 

Enumeration values:
type__unknown 
type_reg 
type_reg_list 
type_string 
type_integer 
type_boolean 
type_vartype 
type_Lir2Asm 

Definition at line 84 of file arch_info_parser.h.


Constructor & Destructor Documentation

arch_info_parser::arch_info_parser  
 

Definition at line 46 of file arch_info_parser.cc.

References _initialized, _lastChar, _pSpecFile, _wasNewLine, and NO_CHAR.

arch_info_parser::~arch_info_parser  
 

Definition at line 55 of file arch_info_parser.cc.


Member Function Documentation

char arch_info_parser::do_getc   [private]
 

Definition at line 473 of file arch_info_parser.cc.

References _currentLine, and _wasNewLine.

Referenced by peek_char().

void arch_info_parser::do_ungetc char    [private]
 

Definition at line 501 of file arch_info_parser.cc.

References _currentLine, and _wasNewLine.

Referenced by peek_char().

char arch_info_parser::get_char bool    skipWhitespace = false [private]
 

Definition at line 369 of file arch_info_parser.cc.

References _charClass, _lastChar, NO_CHAR, peek_char(), and WS.

Referenced by parse(), parse_bool_item(), parse_integer_item(), parse_Lir2Asm_item(), parse_reg_item(), parse_reg_list_item(), parse_string_item(), parse_vartype_item(), and read_string().

void arch_info_parser::init_parser   [private]
 

Definition at line 59 of file arch_info_parser.cc.

References _charClass, _initialized, _thingsToParse, ALPHANUM, LINEBREAK, SPECIAL, and WS.

Referenced by parse().

bool arch_info_parser::parse const char *    pFile,
arch_info   pArchInfo
 

Definition at line 278 of file arch_info_parser.cc.

References _currentLine, arch_info_parser::thing_to_parse::_data, _lastChar, _pArchInfo, arch_info_parser::thing_to_parse::_parseType, _pSpecFile, arch_info_parser::thing_to_parse::_regIsMasterList, _thingsToParse, get_char(), init_parser(), NO_CHAR, parse_bool_item(), PARSE_ERROR, parse_integer_item(), parse_Lir2Asm_item(), parse_reg_item(), parse_reg_list_item(), parse_string_item(), parse_vartype_item(), peek_char(), read_string(), cbz_util::string_to_lower(), type_boolean, type_integer, type_Lir2Asm, type_reg, type_reg_list, type_string, and type_vartype.

Referenced by arch_info::load_arch_info().

bool arch_info_parser::parse_bool_item string    keyName,
bool_ptr    toRead
[private]
 

Definition at line 700 of file arch_info_parser.cc.

References _pArchInfo, get_char(), PARSE_ERROR, read_string(), and cbz_util::string_to_lower().

Referenced by parse(), and parse_Lir2Asm_item().

bool arch_info_parser::parse_integer_item string    keyName,
int_ptr    toRead
[private]
 

Definition at line 668 of file arch_info_parser.cc.

References _pArchInfo, get_char(), PARSE_ERROR, peek_char(), and read_string().

Referenced by parse().

bool arch_info_parser::parse_Lir2Asm_item string    keyName,
Lir2Asm_list_ptr    toAppend
[private]
 

Definition at line 758 of file arch_info_parser.cc.

References _charClass, arch_info::Lir2Asm::_codeTemplate, arch_info::Lir2Asm::_convertToTypes, arch_info::Lir2Asm::_dataTypes, arch_info::Lir2Asm::_immed, arch_info::Lir2Asm::_killRegs, arch_info::_Lir2Asm_mnemonicLookup, arch_info::_Lir2Asm_records, arch_info::Lir2Asm::_lirInstTypes, _mnemonicMap, _pArchInfo, arch_info::_tempBool, arch_info::_tempParseString, arch_info::_tempRegList, _varTypeMap, get_char(), arch_info::Lir2Asm::Immed_No, arch_info::Lir2Asm::Immed_Yes, parse_bool_item(), PARSE_ERROR, parse_reg_list_item(), parse_string_item(), peek_char(), read_string(), arch_info::Lir2Asm::reset(), cbz_util::string_to_lower(), cbz_util::vector_copy(), and WS.

Referenced by parse().

bool arch_info_parser::parse_reg_item string    keyName,
reg_info_ptr    toRead
[private]
 

Definition at line 541 of file arch_info_parser.cc.

References _pArchInfo, arch_info::find_register_info(), get_char(), PARSE_ERROR, peek_char(), and read_string().

Referenced by parse().

bool arch_info_parser::parse_reg_list_item string    keyName,
reg_info_list_ptr    toRead,
bool    isMasterList = false,
bool    allowTokens = false
[private]
 

Definition at line 584 of file arch_info_parser.cc.

References arch_info::register_info::_id, arch_info::register_info::_name, arch_info::_nextRegId, _pArchInfo, arch_info::_regMap, arch_info::find_register_info(), get_char(), PARSE_ERROR, and read_string().

Referenced by parse(), and parse_Lir2Asm_item().

bool arch_info_parser::parse_string_item string    keyName,
string_ptr    toRead
[private]
 

Definition at line 642 of file arch_info_parser.cc.

References _pArchInfo, get_char(), PARSE_ERROR, and peek_char().

Referenced by parse(), and parse_Lir2Asm_item().

bool arch_info_parser::parse_vartype_item string    keyName,
vartype_ptr    toRead
[private]
 

Definition at line 729 of file arch_info_parser.cc.

References _pArchInfo, _varTypeMap, get_char(), PARSE_ERROR, read_string(), and cbz_util::string_to_lower().

Referenced by parse().

char arch_info_parser::peek_char bool    skipWhitespace = false [private]
 

Definition at line 386 of file arch_info_parser.cc.

References _charClass, _lastChar, do_getc(), do_ungetc(), NO_CHAR, and WS.

Referenced by get_char(), parse(), parse_integer_item(), parse_Lir2Asm_item(), parse_reg_item(), parse_string_item(), and read_string().

bool arch_info_parser::read_string string &    stringOut,
bool    readAnyChars = false,
bool    skipLeadingNewlines = false
[private]
 

Definition at line 513 of file arch_info_parser.cc.

References _charClass, ALPHANUM, get_char(), and peek_char().

Referenced by parse(), parse_bool_item(), parse_integer_item(), parse_Lir2Asm_item(), parse_reg_item(), parse_reg_list_item(), and parse_vartype_item().


Member Data Documentation

char_class arch_info_parser::_charClass[256] [private]
 

Definition at line 222 of file arch_info_parser.h.

Referenced by get_char(), init_parser(), parse_Lir2Asm_item(), peek_char(), and read_string().

int arch_info_parser::_currentLine [private]
 

Definition at line 213 of file arch_info_parser.h.

Referenced by do_getc(), do_ungetc(), and parse().

bool arch_info_parser::_initialized [private]
 

Definition at line 206 of file arch_info_parser.h.

Referenced by arch_info_parser(), and init_parser().

int arch_info_parser::_lastChar [private]
 

Definition at line 217 of file arch_info_parser.h.

Referenced by arch_info_parser(), get_char(), parse(), and peek_char().

mnemonic_map arch_info_parser::_mnemonicMap [private]
 

Definition at line 226 of file arch_info_parser.h.

Referenced by parse_Lir2Asm_item().

arch_info* arch_info_parser::_pArchInfo [private]
 

Definition at line 209 of file arch_info_parser.h.

Referenced by parse(), parse_bool_item(), parse_integer_item(), parse_Lir2Asm_item(), parse_reg_item(), parse_reg_list_item(), parse_string_item(), and parse_vartype_item().

FILE* arch_info_parser::_pSpecFile [private]
 

Definition at line 212 of file arch_info_parser.h.

Referenced by arch_info_parser(), and parse().

thing_to_parse_array arch_info_parser::_thingsToParse [private]
 

Definition at line 198 of file arch_info_parser.h.

Referenced by init_parser(), and parse().

vartype_map arch_info_parser::_varTypeMap [private]
 

Definition at line 230 of file arch_info_parser.h.

Referenced by parse_Lir2Asm_item(), and parse_vartype_item().

bool arch_info_parser::_wasNewLine [private]
 

Definition at line 218 of file arch_info_parser.h.

Referenced by arch_info_parser(), do_getc(), and do_ungetc().


The documentation for this class was generated from the following files:

Generated on August 27, 2003
Back to the C-Breeze home page