Beispiel #1
0
void SymbolTable::addSymbols(const std::vector<GDLNode*> &ast) {
	for (const GDLNode *node : ast) {
		switch (node->getInstanceOf()) {
			case INSTANCE_OF_ROLE_NODE:
				addRole((RoleNode*)node);
				break;
			case INSTANCE_OF_RELATION_NODE:
				addRelation((RelationNode*)node);
				break;
			case INSTANCE_OF_IF_NODE:
				processIfNode((IfNode*)node);
				break;
			case INSTANCE_OF_BASE_NODE:
				processBaseNode((BaseNode*)node);
				break;
			case INSTANCE_OF_INIT_NODE:
				processInitNode((InitNode*)node);
				break;
			case INSTANCE_OF_INPUT_NODE:
				processInputNode((InputNode*)node);
				break;
			default:
				throw Exception("Unexpected node type in the abstract syntax tree");
		}
	}
}
Beispiel #2
0
void User::addRoles(const std::vector<RoleName>& roles) {
    for (std::vector<RoleName>::const_iterator it = roles.begin(); it != roles.end(); ++it) {
        addRole(*it);
    }
}