-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
428 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* AssingmentStatement.cpp | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#include "AssingmentStatement.h" | ||
|
||
namespace ParseTree { | ||
|
||
AssingmentStatement::AssingmentStatement(Identifier *id, Value *value) { | ||
this->id=id; | ||
this->value=value; | ||
} | ||
|
||
AssingmentStatement::~AssingmentStatement() { | ||
// TODO Auto-generated destructor stub | ||
} | ||
|
||
} /* namespace ParseTree */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* AssingmentStatement.h | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#ifndef ASSINGMENTSTATEMENT_H_ | ||
#define ASSINGMENTSTATEMENT_H_ | ||
|
||
#include "Statement.h" | ||
#include "Identifier.h" | ||
|
||
namespace ParseTree { | ||
|
||
class AssingmentStatement: public ParseTree::Statement { | ||
private: | ||
Identifier *id; | ||
Value *value; | ||
public: | ||
AssingmentStatement(Identifier *id, Value *value); | ||
virtual ~AssingmentStatement(); | ||
}; | ||
|
||
} /* namespace ParseTree */ | ||
#endif /* ASSINGMENTSTATEMENT_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* BinOpValue.cpp | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#include "BinOpValue.h" | ||
|
||
namespace ParseTree { | ||
|
||
BinOpValue::BinOpValue(std::string op, Value *a, Value *b) { | ||
this->op=op; | ||
this->a=a; | ||
this->b=b; | ||
} | ||
|
||
BinOpValue::~BinOpValue() { | ||
// TODO Auto-generated destructor stub | ||
} | ||
|
||
} /* namespace ParseTree */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* BinOpValue.h | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#ifndef BINOPVALUE_H_ | ||
#define BINOPVALUE_H_ | ||
|
||
#include "Value.h" | ||
|
||
namespace ParseTree { | ||
|
||
class BinOpValue: public ParseTree::Value { | ||
private: | ||
std::string op; | ||
Value *a; | ||
Value *b; | ||
public: | ||
BinOpValue(std::string op, Value *a, Value *b); | ||
virtual ~BinOpValue(); | ||
}; | ||
|
||
} /* namespace ParseTree */ | ||
#endif /* BINOPVALUE_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* ExitStatement.cpp | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#include "ExitStatement.h" | ||
|
||
namespace ParseTree { | ||
|
||
ExitStatement::ExitStatement() { | ||
// TODO Auto-generated constructor stub | ||
|
||
} | ||
|
||
ExitStatement::~ExitStatement() { | ||
// TODO Auto-generated destructor stub | ||
} | ||
|
||
} /* namespace ParseTree */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* ExitStatement.h | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#ifndef EXITSTATEMENT_H_ | ||
#define EXITSTATEMENT_H_ | ||
|
||
#include "Statement.h" | ||
|
||
namespace ParseTree { | ||
|
||
class ExitStatement: public ParseTree::Statement { | ||
public: | ||
ExitStatement(); | ||
virtual ~ExitStatement(); | ||
}; | ||
|
||
} /* namespace ParseTree */ | ||
#endif /* EXITSTATEMENT_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Identifier.cpp | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#include "Identifier.h" | ||
|
||
namespace ParseTree { | ||
|
||
using namespace std; | ||
|
||
Identifier::Identifier(string name) { | ||
this->Name = name; | ||
} | ||
|
||
string Identifier::getName(){ | ||
return this->Name; | ||
} | ||
|
||
Identifier::~Identifier() { | ||
// TODO Auto-generated destructor stub | ||
} | ||
|
||
} /* namespace ParseTree */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Identifier.h | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#ifndef IDENTIFIER_H_ | ||
#define IDENTIFIER_H_ | ||
|
||
#include "Value.h" | ||
|
||
namespace ParseTree { | ||
|
||
class Identifier: public ParseTree::Value { | ||
private: | ||
std::string Name; | ||
public: | ||
Identifier(std::string name); | ||
std::string getName(); | ||
void setValue(std::string value); | ||
virtual ~Identifier(); | ||
}; | ||
|
||
} /* namespace ParseTree */ | ||
#endif /* IDENTIFIER_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
CXX=distcc g++ | ||
CXX=distcc clang++ | ||
#CFLAGS= -O2 -pipe -march=native | ||
CFLAGS=-ggdb | ||
CXXFLAGS=$(CFLAGS) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Node.cpp | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#include "Node.h" | ||
|
||
namespace ParseTree { | ||
|
||
Node::Node() { | ||
// TODO Auto-generated constructor stub | ||
|
||
} | ||
|
||
Node::~Node() { | ||
// TODO Auto-generated destructor stub | ||
} | ||
|
||
} /* namespace ParseTree */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Node.h | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#ifndef NODE_H_ | ||
#define NODE_H_ | ||
|
||
namespace ParseTree { | ||
|
||
class Node { | ||
public: | ||
Node(); | ||
virtual ~Node(); | ||
}; | ||
|
||
} /* namespace ParseTree */ | ||
#endif /* NODE_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* PrintStatement.cpp | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#include "PrintStatement.h" | ||
|
||
namespace ParseTree { | ||
|
||
PrintStatement::PrintStatement(Value *output) { | ||
this->value=output; | ||
} | ||
|
||
PrintStatement::~PrintStatement() { | ||
// TODO Auto-generated destructor stub | ||
} | ||
|
||
} /* namespace ParseTree */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* PrintStatement.h | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#ifndef PRINTSTATEMENT_H_ | ||
#define PRINTSTATEMENT_H_ | ||
|
||
#include "Statement.h" | ||
#include "Value.h" | ||
|
||
namespace ParseTree { | ||
|
||
class PrintStatement: public ParseTree::Statement { | ||
private: | ||
Value *value; | ||
public: | ||
PrintStatement(Value *output); | ||
virtual ~PrintStatement(); | ||
}; | ||
|
||
} /* namespace ParseTree */ | ||
#endif /* PRINTSTATEMENT_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Statement.cpp | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#include "Statement.h" | ||
|
||
#include <iostream> | ||
|
||
namespace ParseTree { | ||
|
||
using namespace std; | ||
|
||
Statement::Statement() { | ||
cerr << "Creation of abstract statement" << endl; | ||
} | ||
|
||
void Statement::Execute(){ | ||
cerr << "Attempted execution of abstract statement" << endl; | ||
} | ||
|
||
Statement::~Statement() { | ||
// TODO Auto-generated destructor stub | ||
} | ||
|
||
} /* namespace ParseTree */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Statement.h | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#ifndef STATEMENT_H_ | ||
#define STATEMENT_H_ | ||
|
||
#include "Node.h" | ||
|
||
namespace ParseTree { | ||
|
||
class Statement: public ParseTree::Node { | ||
public: | ||
Statement(); | ||
virtual void Execute(); | ||
virtual ~Statement(); | ||
}; | ||
|
||
} /* namespace ParseTree */ | ||
#endif /* STATEMENT_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* StringValue.cpp | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#include "StringValue.h" | ||
|
||
namespace ParseTree { | ||
|
||
using namespace std; | ||
|
||
StringValue::StringValue(string value) { | ||
this->value = value; | ||
} | ||
|
||
string StringValue::getValue(){ | ||
return this->value; | ||
} | ||
|
||
StringValue::~StringValue() { | ||
// TODO Auto-generated destructor stub | ||
} | ||
|
||
} /* namespace ParseTree */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* StringValue.h | ||
* | ||
* Created on: Apr 26, 2013 | ||
* Author: jimtahu | ||
*/ | ||
|
||
#ifndef STRINGVALUE_H_ | ||
#define STRINGVALUE_H_ | ||
|
||
#include "Value.h" | ||
|
||
namespace ParseTree { | ||
|
||
class StringValue: public ParseTree::Value { | ||
private: | ||
std::string value; | ||
public: | ||
StringValue(std::string value); | ||
std::string getValue(); | ||
virtual ~StringValue(); | ||
}; | ||
|
||
} /* namespace ParseTree */ | ||
#endif /* STRINGVALUE_H_ */ |
Oops, something went wrong.