Merge branch 'master' of git.tuxzone.org:woc2013
This commit is contained in:
@@ -46,6 +46,9 @@ void CodeGenVisitor::visit(BinOpExpression* e) {
|
||||
case BinOp::EQUALS:
|
||||
value_ = builder_->CreateICmpEQ(lhs, rhs, "eqtmp");
|
||||
break;
|
||||
case BinOp::LESS:
|
||||
value_ = builder_->CreateICmpSLT(lhs, rhs, "eqtmp");
|
||||
break;
|
||||
default:
|
||||
// TODO error
|
||||
break;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "AST/ForStatement.h"
|
||||
#include "AST/ASTVisitor.h"
|
||||
|
||||
ForStatement::ForStatement(Expression *init, Expression *cond, Expression *step, Statement *stmt) : init_(init), cond_(cond), step_(step), stmt_(stmt) {
|
||||
ForStatement::ForStatement(Statement *init, Expression *cond, Statement *step, Statement *stmt) : init_(init), cond_(cond), step_(step), stmt_(stmt) {
|
||||
//
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ void ForStatement::accept(ASTVisitor* visitor) {
|
||||
visitor->visit(this);
|
||||
}
|
||||
|
||||
Expression* ForStatement::getInit() {
|
||||
Statement* ForStatement::getInit() {
|
||||
return init_;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ Expression* ForStatement::getCond() {
|
||||
return cond_;
|
||||
}
|
||||
|
||||
Expression* ForStatement::getStep() {
|
||||
Statement* ForStatement::getStep() {
|
||||
return step_;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "AST/RandomForStatement.h"
|
||||
#include "AST/ASTVisitor.h"
|
||||
|
||||
RandomForStatement::RandomForStatement(Expression *init, Expression *prob, Expression *step, Statement *stmt) : init_(init),prob_(prob),step_(step),stmt_(stmt)
|
||||
RandomForStatement::RandomForStatement(Statement *init, Expression *prob, Statement *step, Statement *stmt) : init_(init),prob_(prob),step_(step),stmt_(stmt)
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -14,7 +14,7 @@ void RandomForStatement::accept(ASTVisitor *visitor) {
|
||||
visitor->visit(this);
|
||||
}
|
||||
|
||||
Expression* RandomForStatement::getInit() {
|
||||
Statement *RandomForStatement::getInit() {
|
||||
return init_;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ Expression* RandomForStatement::getProb() {
|
||||
return prob_;
|
||||
}
|
||||
|
||||
Expression* RandomForStatement::getStep() {
|
||||
Statement* RandomForStatement::getStep() {
|
||||
return step_;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ int main() {
|
||||
lexertl::lookup (state_machine, results);
|
||||
std::string s(results.start, results.end);
|
||||
if (results.id != T_WHITESPACE) {
|
||||
std::cout << "Id: " << results.id << ", Token: " << s << std::endl;
|
||||
//std::cout << "Id: " << results.id << ", Token: " << s << std::endl;
|
||||
scullyParser(parser, results.id, new Token(s), cv);
|
||||
}
|
||||
} while (results.id != 0);
|
||||
|
||||
Reference in New Issue
Block a user