X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogramsyntax.cpp;h=c6e0f6d40e9bc9ca97583adf07454af208bcadf9;hb=b6fd887102ab8e4109fa2edd40b9e51f80f88410;hp=83cfbb089b4d5d3278722b384c82a91a382aa4d1;hpb=2b073e0a3808f8ece4b93669395e4b812214cf5d;p=libs%2Fgl.git diff --git a/source/programsyntax.cpp b/source/programsyntax.cpp index 83cfbb08..c6e0f6d4 100644 --- a/source/programsyntax.cpp +++ b/source/programsyntax.cpp @@ -72,6 +72,7 @@ void Assignment::visit(NodeVisitor &visitor) FunctionCall::FunctionCall(): + declaration(0), constructor(false) { } @@ -87,12 +88,24 @@ void ExpressionStatement::visit(NodeVisitor &visitor) } +void Import::visit(NodeVisitor &visitor) +{ + visitor.visit(*this); +} + + void Layout::visit(NodeVisitor &visitor) { visitor.visit(*this); } +void InterfaceLayout::visit(NodeVisitor &visitor) +{ + visitor.visit(*this); +} + + StructDeclaration::StructDeclaration() { members.use_braces = true; @@ -130,7 +143,15 @@ void InterfaceBlock::visit(NodeVisitor &visitor) FunctionDeclaration::FunctionDeclaration(): - definition(false) + definition(0) +{ } + +FunctionDeclaration::FunctionDeclaration(const FunctionDeclaration &other): + return_type(other.return_type), + name(other.name), + parameters(other.parameters), + definition(other.definition==&other ? this : other.definition), + body(other.body) { } void FunctionDeclaration::visit(NodeVisitor &visitor) @@ -207,6 +228,11 @@ void TraversingVisitor::visit(ExpressionStatement &expr) expr.expression->visit(*this); } +void TraversingVisitor::visit(InterfaceLayout &layout) +{ + layout.layout.visit(*this); +} + void TraversingVisitor::visit(StructDeclaration &strct) { strct.members.visit(*this); @@ -214,6 +240,8 @@ void TraversingVisitor::visit(StructDeclaration &strct) void TraversingVisitor::visit(VariableDeclaration &var) { + if(var.layout) + var.layout->visit(*this); if(var.init_expression) var.init_expression->visit(*this); if(var.array_size)