return call;
}
+void Parser::add_type(TypeDeclaration &type)
+{
+ cur_stage->types[type.name] = &type;
+ if(cur_stage->type==Stage::SHARED)
+ global_types.insert(type.name);
+ else
+ stage_types.insert(type.name);
+}
+
RefPtr<TypeDeclaration> Parser::parse_type_declaration()
{
tokenizer.expect("typedef");
type = parse_basic_type_declaration();
tokenizer.expect(";");
- cur_stage->types[type->name] = type.get();
- if(cur_stage->type==Stage::SHARED)
- global_types.insert(type->name);
- else
- stage_types.insert(type->name);
+ add_type(*type);
return type;
}
parse_block(strct->members, true, &Parser::parse_variable_declaration);
tokenizer.expect(";");
- cur_stage->types[strct->name] = strct.get();
- if(cur_stage->type==Stage::SHARED)
- global_types.insert(strct->name);
- else
- stage_types.insert(strct->name);
+ add_type(*strct);
return strct;
}
RefPtr<BinaryExpression> parse_binary(const RefPtr<Expression> &, const Operator &);
RefPtr<TernaryExpression> parse_ternary(const RefPtr<Expression> &, const Operator &);
RefPtr<FunctionCall> parse_function_call(const VariableReference &);
+ void add_type(TypeDeclaration &);
RefPtr<TypeDeclaration> parse_type_declaration();
RefPtr<BasicTypeDeclaration> parse_basic_type_declaration();
RefPtr<ImageTypeDeclaration> parse_image_type_declaration();