From 8e1b13a136033cccd7cfeea452ffb25a29708339 Mon Sep 17 00:00:00 2001 From: urchlay Date: Mon, 18 Jul 2005 23:50:28 +0000 Subject: [PATCH] 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 --- ...ethodExpression.cxx => CpuMethodExpression.cxx} | 6 +++--- ...ethodExpression.hxx => CpuMethodExpression.hxx} | 14 +++++++------- stella/src/debugger/module.mk | 2 +- stella/src/yacc/YaccParser.cxx | 14 +++++++------- stella/src/yacc/stella.y | 6 +++--- stella/src/yacc/y.tab.c | 8 ++++---- stella/src/yacc/y.tab.h | 4 ++-- 7 files changed, 27 insertions(+), 27 deletions(-) rename stella/src/debugger/{IntMethodExpression.cxx => CpuMethodExpression.cxx} (84%) rename stella/src/debugger/{IntMethodExpression.hxx => CpuMethodExpression.hxx} (74%) diff --git a/stella/src/debugger/IntMethodExpression.cxx b/stella/src/debugger/CpuMethodExpression.cxx similarity index 84% rename from stella/src/debugger/IntMethodExpression.cxx rename to stella/src/debugger/CpuMethodExpression.cxx index c945b501c..15ed2f311 100644 --- a/stella/src/debugger/IntMethodExpression.cxx +++ b/stella/src/debugger/CpuMethodExpression.cxx @@ -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; diff --git a/stella/src/debugger/IntMethodExpression.hxx b/stella/src/debugger/CpuMethodExpression.hxx similarity index 74% rename from stella/src/debugger/IntMethodExpression.hxx rename to stella/src/debugger/CpuMethodExpression.hxx index a89ee8b72..12aa9ae05 100644 --- a/stella/src/debugger/IntMethodExpression.hxx +++ b/stella/src/debugger/CpuMethodExpression.hxx @@ -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: diff --git a/stella/src/debugger/module.mk b/stella/src/debugger/module.mk index 45927a5cc..94760ba4e 100644 --- a/stella/src/debugger/module.mk +++ b/stella/src/debugger/module.mk @@ -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 \ diff --git a/stella/src/yacc/YaccParser.cxx b/stella/src/yacc/YaccParser.cxx index 190f391c2..314a636a3 100644 --- a/stella/src/yacc/YaccParser.cxx +++ b/stella/src/yacc/YaccParser.cxx @@ -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) diff --git a/stella/src/yacc/stella.y b/stella/src/yacc/stella.y index 4657e25c1..a257b67f1 100644 --- a/stella/src/yacc/stella.y +++ b/stella/src/yacc/stella.y @@ -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 NUMBER %token ERR %token EQUATE -%token INT_METHOD +%token CPU_METHOD /* Non-terminals */ %type 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; } ; %% diff --git a/stella/src/yacc/y.tab.c b/stella/src/yacc/y.tab.c index d9bcaf8ec..86e8b8d5e 100644 --- a/stella/src/yacc/y.tab.c +++ b/stella/src/yacc/y.tab.c @@ -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" diff --git a/stella/src/yacc/y.tab.h b/stella/src/yacc/y.tab.h index 008f84622..70765b908 100644 --- a/stella/src/yacc/y.tab.h +++ b/stella/src/yacc/y.tab.h @@ -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