Renamed IntMethodExpression to CpuMethodExpression, preparatory to adding

TiaMethodExpression, RiotMethodExpression, etc classes.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@674 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
urchlay 2005-07-18 23:50:28 +00:00
parent fec77cf261
commit 8e1b13a136
7 changed files with 27 additions and 27 deletions

View File

@ -13,14 +13,14 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: IntMethodExpression.cxx,v 1.1 2005-07-15 02:30:47 urchlay Exp $
// $Id: CpuMethodExpression.cxx,v 1.1 2005-07-18 23:50:26 urchlay Exp $
//============================================================================
#include "Expression.hxx"
#include "IntMethodExpression.hxx"
#include "CpuMethodExpression.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IntMethodExpression::IntMethodExpression(CPUDEBUG_INT_METHOD method)
CpuMethodExpression::CpuMethodExpression(CPUDEBUG_INT_METHOD method)
: Expression(0, 0)
{
myMethod = method;

View File

@ -13,24 +13,24 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: IntMethodExpression.hxx,v 1.1 2005-07-15 02:30:47 urchlay Exp $
// $Id: CpuMethodExpression.hxx,v 1.1 2005-07-18 23:50:27 urchlay Exp $
//============================================================================
#ifndef INTMETHOD_EXPRESSION_HXX
#define INTMETHOD_EXPRESSION_HXX
#ifndef CPUMETHOD_EXPRESSION_HXX
#define CPUMETHOD_EXPRESSION_HXX
#include "Debugger.hxx"
//#include "Debugger.hxx"
#include "CpuDebug.hxx"
#include "Expression.hxx"
/**
@author B. Watson
@version $Id: IntMethodExpression.hxx,v 1.1 2005-07-15 02:30:47 urchlay Exp $
@version $Id: CpuMethodExpression.hxx,v 1.1 2005-07-18 23:50:27 urchlay Exp $
*/
class IntMethodExpression : public Expression
class CpuMethodExpression : public Expression
{
public:
IntMethodExpression(CPUDEBUG_INT_METHOD method);
CpuMethodExpression(CPUDEBUG_INT_METHOD method);
int evaluate() { return CALL_CPUDEBUG_METHOD(myMethod); }
private:

View File

@ -5,7 +5,7 @@ MODULE_OBJS := \
src/debugger/DebuggerParser.o \
src/debugger/EquateList.o \
src/debugger/Expression.o \
src/debugger/IntMethodExpression.o \
src/debugger/CpuMethodExpression.o \
src/debugger/ByteDerefExpression.o \
src/debugger/WordDerefExpression.o \
src/debugger/ConstExpression.o \

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: YaccParser.cxx,v 1.14 2005-07-18 02:13:57 urchlay Exp $
// $Id: YaccParser.cxx,v 1.15 2005-07-18 23:50:27 urchlay Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -32,7 +32,7 @@
#include "BinNotExpression.hxx"
#include "BinOrExpression.hxx"
#include "BinXorExpression.hxx"
#include "IntMethodExpression.hxx"
#include "CpuMethodExpression.hxx"
#include "ByteDerefExpression.hxx"
#include "WordDerefExpression.hxx"
#include "ConstExpression.hxx"
@ -190,7 +190,7 @@ int const_to_int(char *c) {
// special methods that get e.g. CPU registers
// TODO: store in a map or something
CPUDEBUG_INT_METHOD getSpecial(char *c) {
CPUDEBUG_INT_METHOD getCpuSpecial(char *c) {
if(strcmp(c, "a") == 0)
return &CpuDebug::a;
@ -253,7 +253,7 @@ int yylex() {
case ST_IDENTIFIER:
{
CPUDEBUG_INT_METHOD meth;
CPUDEBUG_INT_METHOD cpuMeth;
char *bufp = idbuf;
*bufp++ = *c++; // might be a base prefix
@ -276,9 +276,9 @@ int yylex() {
if(Debugger::debugger().equates()->getAddress(idbuf) > -1) {
yylval.equate = idbuf;
return EQUATE;
} else if( (meth = getSpecial(idbuf)) ) {
yylval.intMethod = meth;
return INT_METHOD;
} else if( (cpuMeth = getCpuSpecial(idbuf)) ) {
yylval.cpuMethod = cpuMeth;
return CPU_METHOD;
} else {
yylval.val = const_to_int(idbuf);
if(yylval.val >= 0)

View File

@ -21,7 +21,7 @@ void yyerror(char *e) {
%union {
int val;
char *equate;
CPUDEBUG_INT_METHOD intMethod;
CPUDEBUG_INT_METHOD cpuMethod;
Expression *exp;
}
@ -29,7 +29,7 @@ void yyerror(char *e) {
%token <val> NUMBER
%token <val> ERR
%token <equate> EQUATE
%token <intMethod> INT_METHOD
%token <cpuMethod> CPU_METHOD
/* Non-terminals */
%type <exp> expression
@ -80,7 +80,7 @@ expression: expression '+' expression { fprintf(stderr, " +"); $$ = new PlusExpr
| '(' expression ')' { fprintf(stderr, " ()"); $$ = $2; lastExp = $$; }
| NUMBER { fprintf(stderr, " %d", $1); $$ = new ConstExpression($1); lastExp = $$; }
| EQUATE { fprintf(stderr, " %s", $1); $$ = new EquateExpression($1); lastExp = $$; }
| INT_METHOD { fprintf(stderr, " (intMethod)"); $$ = new IntMethodExpression($1); lastExp = $$; }
| CPU_METHOD { fprintf(stderr, " (CpuMethod)"); $$ = new CpuMethodExpression($1); lastExp = $$; }
| ERR { fprintf(stderr, " ERR"); yyerror("Invalid label or constant"); return 1; }
;
%%

View File

@ -6,7 +6,7 @@
# define NUMBER 257
# define ERR 258
# define EQUATE 259
# define INT_METHOD 260
# define CPU_METHOD 260
# define LOG_OR 261
# define LOG_AND 262
# define LOG_NOT 263
@ -44,7 +44,7 @@ void yyerror(char *e) {
typedef union {
int val;
char *equate;
CPUDEBUG_INT_METHOD intMethod;
CPUDEBUG_INT_METHOD cpuMethod;
Expression *exp;
} yystype;
# define YYSTYPE yystype
@ -138,7 +138,7 @@ static const short yyrline[] =
/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
static const char *const yytname[] =
{
"$", "error", "$undefined.", "NUMBER", "ERR", "EQUATE", "INT_METHOD",
"$", "error", "$undefined.", "NUMBER", "ERR", "EQUATE", "CPU_METHOD",
"'-'", "'+'", "'*'", "'/'", "'%'", "LOG_OR", "LOG_AND", "LOG_NOT",
"'|'", "'^'", "'&'", "SHR", "SHL", "'<'", "'>'", "GTE", "LTE", "NE",
"EQ", "DEREF", "UMINUS", "'~'", "'!'", "'@'", "'('", "')'", "statement",
@ -1069,7 +1069,7 @@ case 29:
break;
case 30:
#line 83 "stella.y"
{ fprintf(stderr, " (intMethod)"); yyval.exp = new IntMethodExpression(yyvsp[0].intMethod); lastExp = yyval.exp; }
{ fprintf(stderr, " (CpuMethod)"); yyval.exp = new CpuMethodExpression(yyvsp[0].cpuMethod); lastExp = yyval.exp; }
break;
case 31:
#line 84 "stella.y"

View File

@ -5,7 +5,7 @@
typedef union {
int val;
char *equate;
CPUDEBUG_INT_METHOD intMethod;
CPUDEBUG_INT_METHOD cpuMethod;
Expression *exp;
} yystype;
# define YYSTYPE yystype
@ -14,7 +14,7 @@ typedef union {
# define NUMBER 257
# define ERR 258
# define EQUATE 259
# define INT_METHOD 260
# define CPU_METHOD 260
# define LOG_OR 261
# define LOG_AND 262
# define LOG_NOT 263