mirror of https://github.com/stella-emu/stella.git
Various Expression types
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@637 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
7283b16405
commit
c91d4af440
|
@ -0,0 +1,27 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: BinAndExpression.cxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
#include "BinAndExpression.hxx"
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
BinAndExpression::BinAndExpression(Expression *left, Expression *right)
|
||||||
|
: Expression(left, right)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: BinAndExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#ifndef BINAND_EXPRESSION_HXX
|
||||||
|
#define BINAND_EXPRESSION_HXX
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
|
||||||
|
/**
|
||||||
|
@author B. Watson
|
||||||
|
@version $Id: BinAndExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
*/
|
||||||
|
class BinAndExpression : public Expression
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
BinAndExpression(Expression *left, Expression *right);
|
||||||
|
int evaluate() { return myLHS->evaluate() & myRHS->evaluate(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: BinOrExpression.cxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
#include "BinOrExpression.hxx"
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
BinOrExpression::BinOrExpression(Expression *left, Expression *right)
|
||||||
|
: Expression(left, right)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: BinOrExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#ifndef BINOR_EXPRESSION_HXX
|
||||||
|
#define BINOR_EXPRESSION_HXX
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
|
||||||
|
/**
|
||||||
|
@author B. Watson
|
||||||
|
@version $Id: BinOrExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
*/
|
||||||
|
class BinOrExpression : public Expression
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
BinOrExpression(Expression *left, Expression *right);
|
||||||
|
int evaluate() { return myLHS->evaluate() | myRHS->evaluate(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: BinXorExpression.cxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
#include "BinXorExpression.hxx"
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
BinXorExpression::BinXorExpression(Expression *left, Expression *right)
|
||||||
|
: Expression(left, right)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: BinXorExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#ifndef BINXOR_EXPRESSION_HXX
|
||||||
|
#define BINXOR_EXPRESSION_HXX
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
|
||||||
|
/**
|
||||||
|
@author B. Watson
|
||||||
|
@version $Id: BinXorExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
*/
|
||||||
|
class BinXorExpression : public Expression
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
BinXorExpression(Expression *left, Expression *right);
|
||||||
|
int evaluate() { return myLHS->evaluate() ^ myRHS->evaluate(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: DivExpression.cxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
#include "DivExpression.hxx"
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
DivExpression::DivExpression(Expression *left, Expression *right)
|
||||||
|
: Expression(left, right)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: DivExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#ifndef DIV_EXPRESSION_HXX
|
||||||
|
#define DIV_EXPRESSION_HXX
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
|
||||||
|
/**
|
||||||
|
@author B. Watson
|
||||||
|
@version $Id: DivExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
*/
|
||||||
|
class DivExpression : public Expression
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DivExpression(Expression *left, Expression *right);
|
||||||
|
int evaluate() { return myLHS->evaluate() / myRHS->evaluate(); } // FIXME: div by zero?
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: EqualsExpression.hxx,v 1.1 2005-07-13 02:54:13 urchlay Exp $
|
// $Id: EqualsExpression.hxx,v 1.2 2005-07-13 04:26:19 urchlay Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef EQUALS_EXPRESSION_HXX
|
#ifndef EQUALS_EXPRESSION_HXX
|
||||||
|
@ -22,11 +22,8 @@
|
||||||
#include "Expression.hxx"
|
#include "Expression.hxx"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This class provides an implementation of an constant expression;
|
|
||||||
that is, one that consists solely of a constant integer value.
|
|
||||||
|
|
||||||
@author B. Watson
|
@author B. Watson
|
||||||
@version $Id: EqualsExpression.hxx,v 1.1 2005-07-13 02:54:13 urchlay Exp $
|
@version $Id: EqualsExpression.hxx,v 1.2 2005-07-13 04:26:19 urchlay Exp $
|
||||||
*/
|
*/
|
||||||
class EqualsExpression : public Expression
|
class EqualsExpression : public Expression
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: LogAndExpression.cxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
#include "LogAndExpression.hxx"
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
LogAndExpression::LogAndExpression(Expression *left, Expression *right)
|
||||||
|
: Expression(left, right)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: LogAndExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#ifndef LOGAND_EXPRESSION_HXX
|
||||||
|
#define LOGAND_EXPRESSION_HXX
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
|
||||||
|
/**
|
||||||
|
@author B. Watson
|
||||||
|
@version $Id: LogAndExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
*/
|
||||||
|
class LogAndExpression : public Expression
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LogAndExpression(Expression *left, Expression *right);
|
||||||
|
int evaluate() { return myLHS->evaluate() && myRHS->evaluate(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: LogOrExpression.cxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
#include "LogOrExpression.hxx"
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
LogOrExpression::LogOrExpression(Expression *left, Expression *right)
|
||||||
|
: Expression(left, right)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: LogOrExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#ifndef LOGOR_EXPRESSION_HXX
|
||||||
|
#define LOGOR_EXPRESSION_HXX
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
|
||||||
|
/**
|
||||||
|
@author B. Watson
|
||||||
|
@version $Id: LogOrExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
*/
|
||||||
|
class LogOrExpression : public Expression
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LogOrExpression(Expression *left, Expression *right);
|
||||||
|
int evaluate() { return myLHS->evaluate() || myRHS->evaluate(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: MinusExpression.hxx,v 1.1 2005-07-13 02:54:13 urchlay Exp $
|
// $Id: MinusExpression.hxx,v 1.2 2005-07-13 04:26:19 urchlay Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef MINUS_EXPRESSION_HXX
|
#ifndef MINUS_EXPRESSION_HXX
|
||||||
|
@ -22,11 +22,8 @@
|
||||||
#include "Expression.hxx"
|
#include "Expression.hxx"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This class provides an implementation of an constant expression;
|
|
||||||
that is, one that consists solely of a constant integer value.
|
|
||||||
|
|
||||||
@author B. Watson
|
@author B. Watson
|
||||||
@version $Id: MinusExpression.hxx,v 1.1 2005-07-13 02:54:13 urchlay Exp $
|
@version $Id: MinusExpression.hxx,v 1.2 2005-07-13 04:26:19 urchlay Exp $
|
||||||
*/
|
*/
|
||||||
class MinusExpression : public Expression
|
class MinusExpression : public Expression
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: ModExpression.cxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
#include "ModExpression.hxx"
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
ModExpression::ModExpression(Expression *left, Expression *right)
|
||||||
|
: Expression(left, right)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: ModExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#ifndef MOD_EXPRESSION_HXX
|
||||||
|
#define MOD_EXPRESSION_HXX
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
|
||||||
|
/**
|
||||||
|
@author B. Watson
|
||||||
|
@version $Id: ModExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
*/
|
||||||
|
class ModExpression : public Expression
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ModExpression(Expression *left, Expression *right);
|
||||||
|
int evaluate() { return myLHS->evaluate() % myRHS->evaluate(); } // FIXME: div by zero?
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: MultExpression.cxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
#include "MultExpression.hxx"
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
MultExpression::MultExpression(Expression *left, Expression *right)
|
||||||
|
: Expression(left, right)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// SSSS tt lll lll
|
||||||
|
// SS SS tt ll ll
|
||||||
|
// SS tttttt eeee ll ll aaaa
|
||||||
|
// SSSS tt ee ee ll ll aa
|
||||||
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||||
|
// SS SS tt ee ll ll aa aa
|
||||||
|
// SSSS ttt eeeee llll llll aaaaa
|
||||||
|
//
|
||||||
|
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||||
|
//
|
||||||
|
// See the file "license" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id: MultExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#ifndef MULT_EXPRESSION_HXX
|
||||||
|
#define MULT_EXPRESSION_HXX
|
||||||
|
|
||||||
|
#include "Expression.hxx"
|
||||||
|
|
||||||
|
/**
|
||||||
|
@author B. Watson
|
||||||
|
@version $Id: MultExpression.hxx,v 1.1 2005-07-13 04:26:19 urchlay Exp $
|
||||||
|
*/
|
||||||
|
class MultExpression : public Expression
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MultExpression(Expression *left, Expression *right);
|
||||||
|
int evaluate() { return myLHS->evaluate() * myRHS->evaluate(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: PlusExpression.hxx,v 1.1 2005-07-13 02:54:13 urchlay Exp $
|
// $Id: PlusExpression.hxx,v 1.2 2005-07-13 04:26:19 urchlay Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef PLUS_EXPRESSION_HXX
|
#ifndef PLUS_EXPRESSION_HXX
|
||||||
|
@ -22,11 +22,8 @@
|
||||||
#include "Expression.hxx"
|
#include "Expression.hxx"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This class provides an implementation of an constant expression;
|
|
||||||
that is, one that consists solely of a constant integer value.
|
|
||||||
|
|
||||||
@author B. Watson
|
@author B. Watson
|
||||||
@version $Id: PlusExpression.hxx,v 1.1 2005-07-13 02:54:13 urchlay Exp $
|
@version $Id: PlusExpression.hxx,v 1.2 2005-07-13 04:26:19 urchlay Exp $
|
||||||
*/
|
*/
|
||||||
class PlusExpression : public Expression
|
class PlusExpression : public Expression
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,6 +9,14 @@ MODULE_OBJS := \
|
||||||
src/debugger/EqualsExpression.o \
|
src/debugger/EqualsExpression.o \
|
||||||
src/debugger/PlusExpression.o \
|
src/debugger/PlusExpression.o \
|
||||||
src/debugger/MinusExpression.o \
|
src/debugger/MinusExpression.o \
|
||||||
|
src/debugger/MultExpression.o \
|
||||||
|
src/debugger/DivExpression.o \
|
||||||
|
src/debugger/ModExpression.o \
|
||||||
|
src/debugger/LogAndExpression.o \
|
||||||
|
src/debugger/LogOrExpression.o \
|
||||||
|
src/debugger/BinAndExpression.o \
|
||||||
|
src/debugger/BinOrExpression.o \
|
||||||
|
src/debugger/BinXorExpression.o \
|
||||||
src/debugger/PackedBitArray.o \
|
src/debugger/PackedBitArray.o \
|
||||||
src/debugger/CpuDebug.o \
|
src/debugger/CpuDebug.o \
|
||||||
src/debugger/RamDebug.o \
|
src/debugger/RamDebug.o \
|
||||||
|
|
Loading…
Reference in New Issue