Commit 6e78ea76 authored by Sarah Spall's avatar Sarah Spall Committed by Vikram Narayanan

committing to switch branches

parent 5f771595
......@@ -135,13 +135,12 @@ const char* PointerType::name()
return this->type_->name();
}
ProjectionField::ProjectionField(bool in, bool out, bool alloc, bool bind, Type* field_type, const char* field_name, Variable *accessor)
ProjectionField::ProjectionField(bool in, bool out, bool alloc, bool bind, Type* field_type, const char* field_name)
{
this->in_ = in;
this->out_ = out;
this->field_type_ = field_type;
this->field_name_ = field_name;
this->accessor_ = accessor;
}
/*
......
......@@ -158,7 +158,7 @@ class ProjectionField : public Variable //?
Variable *accessor_; //
public:
ProjectionField(bool in, bool out, bool alloc, bool bind, Type* field_type, const char* field_name, Variable *container_projection);
ProjectionField(bool in, bool out, bool alloc, bool bind, Type* field_type, const char* field_name);
~ProjectionField();
// virtual Marshal_type* accept(MarshalVisitor *worker, Registers *data);
virtual Type* type();
......
......@@ -7,7 +7,7 @@
class SymbolTable
{
unsigned int last_tmp_;
vector<const char*> symbols_;
std::vector<const char*> symbols_;
public:
SymbolTable();
const char* unique_tmp();
......
......@@ -182,8 +182,8 @@ Interface = "interface" Space+ id:Identifier Spacing OPEN globals:Parameters S
}}
Typedef = "typedef" Spacing "<" Spacing rt:RealType Spacing "," Spacing mt:Type_form ">" Spacing id:Identifier Spacing {{
Typedef * val = new Typedef((char*) rt.getValue(), (Type*) mt.getValue());
insertType((char*)id.getValue(),val);
Typedef * val = new Typedef((char*) rt.getValue(), (Type*) mt.getValue());
insertType((char*)id.getValue(),val);
}}
Verbatim = "verbatim" Spacing "[" contents:VerbatimContent "]" {{ std::ostringstream total;
......@@ -256,25 +256,26 @@ Include = "#include" Space+ "<" Spacing f:Identifier Spacing ">" Spacing {{
value = str.c_str(); }}
FirstParam = t:Type_form id:Identifier Spacing COMMA Spacing {{
printf("first param: id is %s\n", (char*) id.getValue());
value = new Parameter((Type *) t.getValue(), (char *) id.getValue()); }}
value = new Parameter((Type *) t.getValue(), (char *) id.getValue());
}}
LastParam = t:Type_form id:Identifier Spacing {{
printf("last param: id is %s\n", (char*) id.getValue());
value = new Parameter((Type *) t.getValue(), (char *) id.getValue()); }}
value = new Parameter((Type *) t.getValue(), (char *) id.getValue());
}}
Parameters = f:FirstParam* l:LastParam {{ printf("in param\n");
std::vector<Parameter* >* params = new std::vector<Parameter*>();
for(Value::iterator it = f.getValues().begin(); it != f.getValues().end(); it ++)
{
Parameters = f:FirstParam* l:LastParam {{
std::vector<Parameter* >* params = new std::vector<Parameter*>();
for(Value::iterator it = f.getValues().begin(); it != f.getValues().end(); it ++)
{
const Value & v = *it;
Parameter* p = (Parameter* ) v.getValue();
params->push_back(p);
}
params->push_back((Parameter* ) l.getValue());
value = params; }}
}
params->push_back((Parameter* ) l.getValue());
value = params;
}}
function_pointer = "rpc" Space+ OPENS k:Keyword* CLOSES Spacing rt:Type_form Spacing OPEN Spacing "*" Spacing id:Identifer CLOSE Spacing OPEN p:Parameters CLOSE SEMI Spacing {{
//todo
......@@ -283,7 +284,7 @@ function_pointer = "rpc" Space+ OPENS k:Keyword* CLOSES Spacing rt:Type_form Sp
Rpc = "rpc" Space+ t:Type_form id1:Identifier Spacing OPEN p:Parameters CLOSE SEMI Spacing {{
std::vector<Parameter*>* params = (std::vector<Parameter*>*) p.getValue();
std::vector<Parameter*> params_ = *params;
Rpc* r = new Rpc(new ReturnValue((Type *) t.getValue()), (char *) id1.getValue(), params_);
Rpc* r = new Rpc(new ReturnVariable((Type *) t.getValue()), (char *) id1.getValue(), params_);
int err = get_current_scope()->insert(r);
if(!err) {
printf("Error rpc already in scope with this name %s.\n", rpc->name());
......@@ -291,10 +292,6 @@ Rpc = "rpc" Space+ t:Type_form id1:Identifier Spacing OPEN p:Parameters CLOSE S
value = r;
}}
Projection_constructor = "projection" Space+ id:Identifer Spacing "<" Spacing t:Proj_type ">" Spacing OPEN Spacing p:Parameters Spacing CLOSE Spacing OPENC Spacing // todo Spacing CLOSEC Spacing {{
//todo
}}
Projection = "projection" Space+ id:Identifier Spacing "<" Spacing t:Proj_type ">" Spacing OPENC Spacing p:ProjField+ CLOSEC Spacing {{ std::vector<ProjectionField *> p_fields;
for(Value::iterator it = p.getValues().begin(); it != p.getValues().end(); it ++)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment