namespace GL {
namespace SL {
-Validator::Validator():
- stage(0),
- last_provoker(0)
-{ }
-
void Validator::diagnose(Node &node, Node &provoking_node, Diagnostic::Severity severity, const string &message)
{
Diagnostic diag;
}
-DeclarationValidator::DeclarationValidator():
- scope(GLOBAL),
- iface_layout(0),
- iface_block(0),
- variable(0)
-{ }
-
const char *DeclarationValidator::describe_variable(ScopeType scope)
{
switch(scope)
}
else if(kind==BasicTypeDeclaration::VOID)
error(var, "Type 'void' not allowed on variable");
- else if(kind==BasicTypeDeclaration::BOOL && !var.interface.empty() && var.source!=BUILTIN_SOURCE)
- error(var, "Type 'bool' not allowed on interface variable");
+ else if(kind==BasicTypeDeclaration::BOOL && var.source!=BUILTIN_SOURCE)
+ {
+ if(scope==INTERFACE_BLOCK)
+ error(var, "Type 'bool' not allowed in an interface block");
+ else if(!var.interface.empty())
+ error(var, "Type 'bool' not allowed on interface variable");
+ }
if(var.init_expression)
{
}
-IdentifierValidator::IdentifierValidator():
- anonymous_block(false)
-{ }
-
void IdentifierValidator::multiple_definition(const string &name, Statement &statement, Statement &previous)
{
error(statement, format("Multiple definition of %s", name));
}
-ExpressionValidator::ExpressionValidator():
- current_function(0),
- constant_expression(false)
-{ }
-
void ExpressionValidator::visit(VariableReference &var)
{
if(var.declaration && constant_expression && !var.declaration->constant)
}
-FlowControlValidator::FlowControlValidator():
- reachable(true)
-{ }
-
void FlowControlValidator::visit(Block &block)
{
for(const RefPtr<Statement> &s: block.body)