From 92b3dd111fff846e8dfdf115fa0d07890ce5870b Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Mon, 8 Nov 2010 09:08:55 +0000 Subject: Cleanup & version bump. --- src/emu/debug/debugcpu.c | 2 +- src/emu/debug/debugcpu.h | 2 +- src/emu/debug/debugvw.c | 2 +- src/emu/debug/express.c | 80 ++++++++++++++++++++++++------------------------ src/emu/debug/express.h | 38 +++++++++++------------ 5 files changed, 62 insertions(+), 62 deletions(-) (limited to 'src/emu/debug') diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c index 61b06ae91b7..83cd78db618 100644 --- a/src/emu/debug/debugcpu.c +++ b/src/emu/debug/debugcpu.c @@ -154,7 +154,7 @@ void debug_cpu_init(running_machine *machine) /* create a global symbol table */ global->symtable = global_alloc(symbol_table(machine)); - + // configure our base memory accessors debug_cpu_configure_memory(*machine, *global->symtable); diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h index b40e24eccef..0a8fd9c90c8 100644 --- a/src/emu/debug/debugcpu.h +++ b/src/emu/debug/debugcpu.h @@ -97,7 +97,7 @@ public: int m_index; // user reported index UINT8 m_enabled; // enabled? offs_t m_address; // execution address - parsed_expression m_condition; // condition + parsed_expression m_condition; // condition astring m_action; // action }; diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c index 1166df72f1c..2454644c7ed 100644 --- a/src/emu/debug/debugvw.c +++ b/src/emu/debug/debugvw.c @@ -581,7 +581,7 @@ debug_view_expression::~debug_view_expression() void debug_view_expression::set_context(symbol_table *context) { - m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(&m_machine)); + m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(&m_machine)); m_dirty = true; } diff --git a/src/emu/debug/express.c b/src/emu/debug/express.c index 853f6adfa92..fa3cc71b366 100644 --- a/src/emu/debug/express.c +++ b/src/emu/debug/express.c @@ -1,7 +1,7 @@ /*************************************************************************** express.c - + Generic expressions engine. **************************************************************************** @@ -37,24 +37,24 @@ **************************************************************************** - Operator precedence - =================== - 0x0000 ( ) - 0x0001 ++ (postfix), -- (postfix) - 0x0002 ++ (prefix), -- (prefix), ~, !, - (unary), + (unary), b@, w@, d@, q@ - 0x0003 *, /, % - 0x0004 + - - 0x0005 << >> - 0x0006 < <= > >= - 0x0007 == != - 0x0008 & - 0x0009 ^ - 0x000a | - 0x000b && - 0x000c || - 0x000d = *= /= %= += -= <<= >>= &= |= ^= - 0x000e , - 0x000f func() + Operator precedence + =================== + 0x0000 ( ) + 0x0001 ++ (postfix), -- (postfix) + 0x0002 ++ (prefix), -- (prefix), ~, !, - (unary), + (unary), b@, w@, d@, q@ + 0x0003 *, /, % + 0x0004 + - + 0x0005 << >> + 0x0006 < <= > >= + 0x0007 == != + 0x0008 & + 0x0009 ^ + 0x000a | + 0x000b && + 0x000c || + 0x000d = *= /= %= += -= <<= >>= &= |= ^= + 0x000e , + 0x000f func() ***************************************************************************/ @@ -155,9 +155,9 @@ private: static UINT64 internal_getter(symbol_table &table, void *symref); static void internal_setter(symbol_table &table, void *symref, UINT64 value); - // internal state - symbol_table::getter_func m_getter; - symbol_table::setter_func m_setter; + // internal state + symbol_table::getter_func m_getter; + symbol_table::setter_func m_setter; UINT64 m_value; }; @@ -191,7 +191,7 @@ private: //************************************************************************** //------------------------------------------------- -// code_string - return a friendly string for a +// code_string - return a friendly string for a // given expression error //------------------------------------------------- @@ -321,7 +321,7 @@ void integer_symbol_entry::set_value(UINT64 newvalue) //------------------------------------------------- -// internal_getter - internal helper for +// internal_getter - internal helper for // returning the value of a variable //------------------------------------------------- @@ -425,7 +425,7 @@ symbol_table::symbol_table(void *globalref, symbol_table *parent) //------------------------------------------------- -// add - add a new UINT64 pointer symbol +// add - add a new UINT64 pointer symbol //------------------------------------------------- void symbol_table::configure_memory(void *param, valid_func valid, read_func read, write_func write) @@ -438,7 +438,7 @@ void symbol_table::configure_memory(void *param, valid_func valid, read_func rea //------------------------------------------------- -// add - add a new UINT64 pointer symbol +// add - add a new UINT64 pointer symbol //------------------------------------------------- void symbol_table::add(const char *name, read_write rw, UINT64 *ptr) @@ -449,7 +449,7 @@ void symbol_table::add(const char *name, read_write rw, UINT64 *ptr) //------------------------------------------------- -// add - add a new value symbol +// add - add a new value symbol //------------------------------------------------- void symbol_table::add(const char *name, UINT64 value) @@ -460,7 +460,7 @@ void symbol_table::add(const char *name, UINT64 value) //------------------------------------------------- -// add - add a new register symbol +// add - add a new register symbol //------------------------------------------------- void symbol_table::add(const char *name, void *ref, getter_func getter, setter_func setter) @@ -471,7 +471,7 @@ void symbol_table::add(const char *name, void *ref, getter_func getter, setter_f //------------------------------------------------- -// add - add a new function symbol +// add - add a new function symbol //------------------------------------------------- void symbol_table::add(const char *name, void *ref, int minparams, int maxparams, execute_func execute) @@ -500,7 +500,7 @@ symbol_entry *symbol_table::find_deep(const char *symbol) //------------------------------------------------- -// value - return the value of a symbol +// value - return the value of a symbol //------------------------------------------------- UINT64 symbol_table::value(const char *symbol) @@ -511,7 +511,7 @@ UINT64 symbol_table::value(const char *symbol) //------------------------------------------------- -// set_value - set the value of a symbol +// set_value - set the value of a symbol //------------------------------------------------- void symbol_table::set_value(const char *symbol, UINT64 value) @@ -593,7 +593,7 @@ parsed_expression::parsed_expression(symbol_table *symtable, const char *express // if we got an expression parse it if (expression != NULL) parse(expression); - + // if we get a result pointer, execute it if (result != NULL) *result = execute(); @@ -956,7 +956,7 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *& // if we have an 0x prefix, we must be a hex value if (buffer[0] == '0' && buffer[1] == 'x') return parse_number(token, &buffer[2], 16, expression_error::INVALID_NUMBER); - + // if we have a # prefix, we must be a decimal value if (buffer[0] == '#') return parse_number(token, &buffer[1], 10, expression_error::INVALID_NUMBER); @@ -964,7 +964,7 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *& // if we have a $ prefix, we are a hex value if (buffer[0] == '$') return parse_number(token, &buffer[1], 16, expression_error::INVALID_NUMBER); - + // check for a symbol match symbol_entry *symbol = m_symtable->find_deep(buffer); if (symbol != NULL) @@ -979,7 +979,7 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *& } return; } - + // attempt to parse as a number in the default base parse_number(token, buffer, DEFAULT_BASE, expression_error::UNKNOWN_SYMBOL); } @@ -1006,7 +1006,7 @@ void parsed_expression::parse_number(parse_token &token, const char *string, int int digit = ptr - numbers; if (digit >= base) break; - + // shift previous digits up and add in new digit value = (value * (UINT64)base) + digit; string++; @@ -1223,7 +1223,7 @@ void parsed_expression::normalize_operator(parse_token *prevtoken, parse_token & if (peek == NULL) break; - // if we hit an execute function operator, or else a left parenthesis that is + // if we hit an execute function operator, or else a left parenthesis that is // already tagged, then tag us as well if (peek->is_operator(TVL_EXECUTEFUNC) || (peek->is_operator(TVL_LPAREN) && peek->is_function_separator())) { @@ -1252,7 +1252,7 @@ void parsed_expression::infix_to_postfix() { // pre-determine our next token next = token->next(); - + // if the character is an operand, append it to the result string if (token->is_number() || token->is_symbol() || token->is_string()) m_tokenlist.append(*token); @@ -1686,7 +1686,7 @@ UINT64 parsed_expression::execute_tokens() //------------------------------------------------- parsed_expression::parse_token::parse_token(int offset) - : m_next(NULL), + : m_next(NULL), m_type(INVALID), m_offset(offset), m_value(0), @@ -1726,7 +1726,7 @@ inline void parsed_expression::parse_token::set_lval_value(symbol_table *table, // set the value of a symbol if (is_symbol()) m_symbol->set_value(value); - + // or set the value via the memory callbacks else if (is_memory() && table != NULL) table->set_memory_value(m_string, memory_space(), address(), 1 << memory_size(), value); diff --git a/src/emu/debug/express.h b/src/emu/debug/express.h index 8a5282ff855..26f267da282 100644 --- a/src/emu/debug/express.h +++ b/src/emu/debug/express.h @@ -114,7 +114,7 @@ public: // operators operator error_code() const { return m_code; } - + // getters error_code code() const { return m_code; } int offset() const { return m_offset; } @@ -134,7 +134,7 @@ class symbol_entry { friend class tagged_list; -protected: +protected: // symbol types enum symbol_type { @@ -150,10 +150,10 @@ public: // getters symbol_entry *next() const { return m_next; } const char *name() const { return m_name; } - + // type checking bool is_function() const { return (m_type == SMT_FUNCTION); } - + // symbol access virtual bool is_lval() const = 0; virtual UINT64 value() const = 0; @@ -179,7 +179,7 @@ public: // callback functions for getting/setting a symbol value typedef UINT64 (*getter_func)(symbol_table &table, void *symref); typedef void (*setter_func)(symbol_table &table, void *symref, UINT64 value); - + // callback functions for function execution typedef UINT64 (*execute_func)(symbol_table &table, void *symref, int numparams, const UINT64 *paramlist); @@ -196,15 +196,15 @@ public: // construction/destruction symbol_table(void *globalref, symbol_table *parent = NULL); - + // getters symbol_entry *first() const { return m_symlist.first(); } symbol_table *parent() const { return m_parent; } void *globalref() const { return m_globalref; } - + // setters void configure_memory(void *param, valid_func valid, read_func read, write_func write); - + // symbol access void add(const char *name, read_write rw, UINT64 *ptr = NULL); void add(const char *name, UINT64 constvalue); @@ -212,7 +212,7 @@ public: void add(const char *name, void *ref, int minparams, int maxparams, execute_func execute); symbol_entry *find(const char *name) { return m_symlist.find(name); } symbol_entry *find_deep(const char *name); - + // value getter/setter UINT64 value(const char *symbol); void set_value(const char *symbol, UINT64 value); @@ -253,7 +253,7 @@ public: const char *original_string() const { return m_original_string; } symbol_table *symbols() const { return m_symtable; } - // setters + // setters void set_symbols(symbol_table *symtable) { m_symtable = symtable; } // execution @@ -265,7 +265,7 @@ private: class parse_token { friend class simple_list; - + // operator flags enum { @@ -297,7 +297,7 @@ private: public: // construction/destruction parse_token(int offset = 0); - + // getters parse_token *next() const { return m_next; } int offset() const { return m_offset; } @@ -328,7 +328,7 @@ private: parse_token &configure_string(const char *string) { m_type = STRING; m_string = string; return *this; } parse_token &configure_memory(UINT32 address, parse_token &memoryat) { m_type = MEMORY; m_value = address; m_flags = memoryat.m_flags; m_string = memoryat.m_string; return *this; } parse_token &configure_symbol(symbol_entry &symbol) { m_type = SYMBOL; m_symbol = &symbol; return *this; } - parse_token &configure_operator(UINT8 optype, UINT8 precedence) + parse_token &configure_operator(UINT8 optype, UINT8 precedence) { m_type = OPERATOR; m_flags = ((optype << TIN_OPTYPE_SHIFT) & TIN_OPTYPE_MASK) | ((precedence << TIN_PRECEDENCE_SHIFT) & TIN_PRECEDENCE_MASK); return *this; } parse_token &set_function_separator() { assert(m_type == OPERATOR); m_flags |= TIN_FUNCTION_MASK; return *this; } @@ -336,7 +336,7 @@ private: parse_token &set_memory_space(expression_space space) { assert(m_type == OPERATOR || m_type == MEMORY); m_flags = (m_flags & ~TIN_MEMORY_SPACE_MASK) | ((space << TIN_MEMORY_SPACE_SHIFT) & TIN_MEMORY_SPACE_MASK); return *this; } parse_token &set_memory_size(int log2ofbits) { assert(m_type == OPERATOR || m_type == MEMORY); m_flags = (m_flags & ~TIN_MEMORY_SIZE_MASK) | ((log2ofbits << TIN_MEMORY_SIZE_SHIFT) & TIN_MEMORY_SIZE_MASK); return *this; } parse_token &set_memory_source(const char *string) { assert(m_type == OPERATOR || m_type == MEMORY); m_string = string; return *this; } - + // access UINT64 get_lval_value(symbol_table *symtable); void set_lval_value(symbol_table *symtable, UINT64 value); @@ -351,22 +351,22 @@ private: const char * m_string; // associated string symbol_entry * m_symbol; // symbol pointer }; - + // an expression_string holds an indexed string parsed from the expression class expression_string { friend class simple_list; - + public: // construction/destruction expression_string(const char *string, int length = 0) : m_next(NULL), m_string(string, (length == 0) ? strlen(string) : length) { } - + // operators operator const char *() { return m_string; } operator const char *() const { return m_string; } - + private: // internal state expression_string * m_next; // next string in list @@ -376,7 +376,7 @@ private: // internal helpers void copy(const parsed_expression &src); void print_tokens(FILE *out); - + // parsing helpers void parse_string_into_tokens(); void parse_symbol_or_number(parse_token &token, const char *&string); -- cgit v1.2.3